Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: An eighth use of local

by xdg (Monsignor)
on Dec 01, 2005 at 16:51 UTC ( #513340=note: print w/ replies, xml ) Need Help??


in reply to Re^2: An eighth use of local
in thread An eighth use of local

It's a special case of something that's unmentioned: creating temporary values in aggregates.

That's a great point. If you missed it, consider this:

my $item = 'wibble'; my @things = qw /foo bar baz/; local $things[1] = 'qux'; # Legal local $item = 'wobble'; # Dies with 'Can't localize lexical variable + $item'

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


Comment on Re^3: An eighth use of local
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://513340]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-12-25 19:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (162 votes), past polls