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

Re: [MacPerl] $^O stickiness (fwd)



At 15.56 12/23/97, Mark Manning/Muniz Eng. wrote:
>According to Chris Nandor:
>>
>> If you change the value of $^O, it sticks between subsequent invocations of
>> other scripts.  :)
>
>Isn't that because $^O is a global variable of Perl (or
>rather MacPerl)?  Thus, it is like a program calling a
>function.  All of the global variables defined within the
>program will also be defined within the function.

I don't follow.  Global variables work that way, yes.  But that has nothing
to do with separate invocations of the program.  $^X is a global as well,
but does not work in the same way:

print $^X;
print $^O;
$^X = $^O = 'aaa';

This will print "MacPerlMacOS" the first time around.  Every following time
it is invoked in that session of the MacPerl app (i.e., without restarting
the app), it prints "MacPerlaaa".

--
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