Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Changing name of ARRAY in each iteration

by Velaki (Chaplain)
on Aug 10, 2006 at 13:14 UTC ( [id://566607]=note: print w/replies, xml ) Need Help??


in reply to Changing name of ARRAY in each iteration

It looks like you're trying to dynamically create a new array name, e.g. @energyA, @energyB.

You should probably make it a hash of array references.

push @{$energy{$x}}, $Winenergy{$ell};

This way, you'll have %energy, which would contain references to the arrays, for example, $energy{'A'} and $energy{'B'}, etc. Then you could simply dereference them, e.g. @{$energy{'A'}}), to access the elements.

Hope this helped,
-v.

"Perl. There is no substitute."

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-25 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found