Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re^2: Non-destructive array processing

by ihb (Deacon)
on Jan 22, 2003 at 19:09 UTC ( #229110=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Non-destructive array processing
in thread Non-destructive array processing

But what will simply alias the lexical @array with the dynamical @array. So I don't see what you've achieved by doing this.

One problem with this that you probably didn't foresee is that lexicals are resolved before dynamic variables. Example:

my @foo = 1..4; local *foo = ['a'..'d']; print @foo; # 1234
The problem is solved through our() since that creates an aliased lexical:
my @foo = 1..4; our @foo = 'a'..'d'; print @foo; # abcd

ihb


Comment on Re: Re^2: Non-destructive array processing
Select or Download Code

Log In?
Username:
Password:

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

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

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





    Results (182 votes), past polls