Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How can I use the value of a scalar as the name of an array variable?

by eg (Friar)
on Dec 03, 2000 at 15:51 UTC ( [id://44666]=note: print w/replies, xml ) Need Help??


in reply to How can I use the value of a scalar as the name of an array variable?

An alternative method is to use eval. In the while loop, try something like this in place of the bare push:
eval "push \@$category, $item;";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-03-28 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found