Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Cruel references

by japhy (Canon)
on Mar 06, 2005 at 00:27 UTC ( [id://436971]=note: print w/replies, xml ) Need Help??


in reply to Cruel references

It's because you have \[] instead of just []. [] is a reference to an anonymous array, and \[] is a reference TO a reference to an anonymous array.
_____________________________________________________
Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: Cruel references
by uksza (Canon) on Mar 06, 2005 at 00:51 UTC
    of course!!
    Thanks a lot!
    This is right way:
    $pets{$color}=[]; push @{$pets{$color}},"cat";

Log In?
Username:
Password:

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

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

    No recent polls found