Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Introduction to anonymous arrays and hashes

by bobf (Monsignor)
on Nov 06, 2004 at 21:22 UTC ( #405812=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    %title = ( value => 'Welcome to my website!',
               char_ct => 22,
    ...
                  word_ct => 5,
                  repeat_ct => 2 );
    etc...
    
  2. or download this
    %tags = ( title    => { value => 'Welcome to my website!',
                            char_ct => 22,
    ...
                            char_ct => 31,
                            word_ct => 5,
                            repeat_ct => 2 } );
    
  3. or download this
    $title{value} = 'Welcome to my website!';
    
  4. or download this
    $tags{title}{value} = 'Welcome to my website!';
    
  5. or download this
    ( $num_chars, $num_words ) = count_chars_words( $tags{title} );
    
    ...
        my $value = ${ $hashref }{value};
        # count stuff and return
    }
    
  6. or download this
    $tags{keywords}{val_list} = [ ( split( ', ', $tags{keywords}{value} ) 
    +) ];
    print ${ $tags{keywords}{val_list} }[2]; # pop
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2023-03-24 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?