Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 perusing the Monastery: (2)
As of 2023-01-29 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?