Re: use strict, aliases, local

2005-10-03 Thread Peter Scott
On Sun, 02 Oct 2005 21:08:48 +0200, Gerard Robin wrote: I pick up this example in a tutorial (it is old but it exists and there are many examples and most of them are understandable (imho)) because I searched some example of scripts which used local. I encounter some problems to figure out

Re: use strict, aliases, local

2005-10-02 Thread Jeff 'japhy' Pinyan
On Oct 2, Gerard Robin said: use warnings; # use strict; $foo = 26; @foo = (here's, a, list); testsub (*foo); print (The value of \$foo is now $foo\n); sub testsub { local (*printarray) = @_; foreach $element ( @printarray) { print ($element\n); } $printarray = 61; } it gives the expected

Re: use strict, aliases, local

2005-10-02 Thread Gerard Robin
On Sun, Oct 02, 2005 at 08:49:30AM -0400 Jeff 'japhy' Pinyan wrote: ... If you REALLY want to use package variables instead of lexicals, then you need to follow the instructions in the 'strict' documentation for declaring your global variables: use strict; our ($foo,