EPP also suggests you use 'local' when messing with variables in another module's namespace, but I can't think of a RL situation where that could be justified - why not just scope a local variable? Perhaps someone could enlighten me?Well, an example.
%hash = ( one => "a\tb", two => chr(7) ); { use Data::Dumper; local $Data::Dumper::Useqq = 1; local $Data::Dumper::Terse = 1; print Dumper \%hash; }
This way you temporarily replace the value of settings, while perl resets them back to their original state afterwards.
In reply to Re: The difference between my and local
by bart
in thread The difference between my and local
by cLive ;-)
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |