http://www.perlmonks.org?node_id=892942


in reply to Re: My questions: new to perl
in thread My questions: new to perl

local temporarily saves a package variable. The previous value of the variable will be restored when the current scoped is exited.
That's an incomplete answer. local can localized elements of lexical arrays (and hashes) as well.
my @foo; sub hello {say "@foo";} @foo = qw[Hello, world!]; hello; { local $foo[1] = "earth!"; hello; } __END__ Hello, world! Hello, earth!
strict detects errors that aren't detected by default for backwards compatibility reasons.
That's the first time I hear someone claim strict has anything to do with backwards compatibility reasons. If that were true, no code written in the past 15 years would have had the need for "no strict".
use warnings; detects lots of situations which are very likely to have resulted from errors.
But on other cases, it's just plain wrong - specially in cases where a linter would have been more appropriate. For instance, the code I posted above isn't warnings free (but what is warned about should be done by a linter, not by warnings, IMO).