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

Re: Er...

by Solo (Deacon)
on Feb 10, 2003 at 22:26 UTC ( [id://234259]=note: print w/replies, xml ) Need Help??


in reply to Er...
in thread Finding the size of an array in a hash?

Actually, push @anything, "$lines" creates an array of scalars, which is why jeffa warns against it--since it may not be what you wanted.

To your original question, push @{$FULLLINES{$account}}, “$lines”; is populating an anonymous arrayref for key $account in the %FULLLINES hash. %FULLLINES would look something like this:

( 'account1' => [ 'lines','lines', ], 'account2' => [ 'lines', ], )

When in doubt, you can

use Data::Dumper; print Dumper(\%FULLLINES);
--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.

Replies are listed 'Best First'.
Re: Re: Er...
by Nkuvu (Priest) on Feb 11, 2003 at 17:04 UTC
    Hrm. I'll have to take your (that's a "your" plural, btw) word for it. This is why I don't use hashes of arrays or arrays of hashes.

    I've had to update some scripts by co-workers who use variables like $rvw (your guess is almost as good as mine on what that variable represents (my only advantage is I have some context)) and insane compositions such as the above (actually the above make the compositions I'm dealing with look like cake sometimes). And of course the previous developer didn't know what a comment was. They're always hard for me to decipher, and are a good indication on why people think Perl looks like line noise...

    Anyway, thanks for the clarification.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 19:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found