Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by Anonymous Monk
on Dec 15, 2000 at 21:52 UTC ( #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? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2023-03-23 07:13 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?