Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Working with an Array of Array Names

by bruceb3 (Pilgrim)
on Oct 07, 2007 at 23:38 UTC ( [id://643343]=note: print w/replies, xml ) Need Help??


in reply to Working with an Array of Array Names

Fist of all, I am not sure exactly what you are trying to do, so here is an answer with my best guess at what you are wanting to achieve.

You really need to read perlref. If you are using a *NIX server, from the command line type;

perldoc perlref

And study away. Now to my "solution";

#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my $arr; push @{$arr->{car}}, ( 4,3,2,1 ); print Dumper $arr;

Some explaination; The $arr->{car} is a reference to a hash where the key is the string "car". The @{ } says to treat the value of the hash as an array. And you know what push does. perlref will be explain it completely.

Replies are listed 'Best First'.
Re^2: Working with an Array of Array Names
by idiotek (Initiate) on Oct 07, 2007 at 23:59 UTC
    Thanks a lot guys, and thanks for the reading material. Like I said, I'm a complete scripting noob, but I've somehow managed to get a lot done by goggling and reading through some stuff on this and other forum. From what I've seen so far, there's a lot of shorthand, and too much I don't yet know. Thanks for your help.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 00:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found