Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: making arrays that act like hashes at runtime

by perrin (Chancellor)
on Jul 01, 2002 at 13:45 UTC ( [id://178549]=note: print w/replies, xml ) Need Help??


in reply to making arrays that act like hashes at runtime

You may be able to get what you need by using the enum module. It would let you do this:

use enum qw(first=1 second); my @foo; @foo[first, second] = qw(hello world);
That puts the constants in the package namespace though, which you might not want. It's good for making objects based on array refs. If this isn't what you're after, try ArrayHashMonster.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (9)
As of 2024-04-19 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found