Re: Until loop
[email protected] (Nicholas Clark) Mon, 1 Apr 2002 11:09:43 +0100
| Newsgroups | perl.riscos |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Apr 01, 2002 at 09:47:49AM +0100, Richard Torrens (RiscOS) wrote:
> an anyone tell me why the following gets stuck?
>
> until ($ENV{'BlackHole$BinDir'} eq "") {
> system ('Unset BlackHole$BinDir');
> }
>
> It gets stuck in a loop as if the test is only tested once.
From memory, I think that's pretty close to what actually happens.
I think that perl is actually caching things as they get read in %ENV.
[I seem to remember I just re-used most of the existing VMS code that handles
this sort of thing when porting]
Try this
delete $ENV{'BlackHole$BinDir'};
in place of the loop. I think it should work (not in a position to test it
right now) as I think it will punch out to the real RISC OS environment and
delete it there (with no error if it never was there in the first place)
Nicholas Clark
--
Even better than the real thing: http://nms-cgi.sourceforge.net/