[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] exists $ENV{...} not working?



Chris Nandor writes:
|At 00.06 12/23/97, Brian L. Matthews wrote:
|>Version: 5.004
|>exists $ENV{'REQUEST_METHOD'} = ''
|>exists $ENV{'TMPDIR'} = ''
|>$ENV{'REQUEST_METHOD'} = 'GET'
|>$ENV{'TMPDIR'} = 'Macintosh HD:Temporary Items:'
|>exists $ENV{'REQUEST_METHOD'} = '1'
|>exists $ENV{'TMPDIR'} = '1'
|>Interesting how hash elements that don't exist can still have values. :-)
|%ENV on MacPerl is especially magic.  You might also notice that
|while(($k,$v)=each(%ENV)) does not work.  The basic idea is that for each()
|or exists() to work, the KEY has to be invoked first:

So are you saying this behavior is on purpose? If so, I don't like it. :-)
I realize %ENV is magic, in all versions of perl, but being it's used
so often, one (well, at least I) would think it should work the same on
the Mac as on Unix, at least within a perl script.

Brian

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch