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

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



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:

$ENV{'SERVER_SOFTWARE'} = $ENV{'SERVER_SOFTWARE'};
print exists(+$ENV{'SERVER_SOFTWARE'}),"<BR>\n\n";

And when going through the each() loop, SERVER_SOFTWARE will show up, but
none of the others will.

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



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