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

Re: [MacPerl] $_ global?



>Why is '$_' acting as a local variable? 

It's the implied variable in your foreach loop, and "The variable is 
implicitly local to the loop and regains its former value upon exiting 
the loop" (Camel 2nd ed., p. 100).

>I want it to be global, so how to make it work?

Use a differently-named variable for your foreach loop.

--
 Jamie McCarthy          http://www.absence.prismatix.com/jamie/
 jamie@voyager.net        Co-Webmaster of http://www.nizkor.org/