in reply to Re: what is the difference between 'my' and 'local'?
in thread what is the difference between 'my' and 'local'?
In your last example you missed the localising, it should be:
{ undef local $/; # with localising open (FH, $filename); while(<FH>) { blah } }
And then - as nobody has done this yet - I add the two definitive links to that topic, both articles from mjd found on his website Coping with Scoping and Seven useful uses of local.
-- Hofmator
|
|---|