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

Re: Back to Remedial Perl for Me: map{} function

by Anonymous Monk
on Dec 15, 2000 at 21:52 UTC ( [id://46872]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # a way to count the number of elements in a list
    my $count = 0;
    my @listOfThings = ('one', 'two', 'three');
    map { ++$count } @listOfThings;
    print "There are $count things in your list of things.\n";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-24 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found