Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Introduction to anonymous arrays and hashes

by demerphq (Chancellor)
on Nov 06, 2004 at 10:44 UTC ( [id://405743]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @list_of_refs=map { +{ $_ => 1 } } 1..10;
    @list_of_refs=map { my %hash=($_=>1); \%hash } 1..10;
    ...
      print @$foo;
      print @$ref;
    }
    
  2. or download this
    my $ref_to_anon={ a=>1 };
    my %named=(a=>1);
    my $ref_to_named=\%named;
    # realistically there is no way to tell which ref is to an anonymous a
    +rray
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-23 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found