Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by merlyn (Sage)
on Dec 15, 2000 at 22:00 UTC ( [id://46875]=note: print w/replies, xml ) Need Help??


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

I'd just write that as
++$count for @listOfThings;
Shorter even. {grin}

And yeah, for this specific example, I wouldn't even use a loop, as in:

$count += @listOfThings;

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Re: Back to Remedial Perl for Me: map{} function
by Anonymous Monk on Dec 16, 2000 at 04:08 UTC

    Of course...

    I just wanted to point out that you don't have to really do anything with the elements of @listOfThings if you don't want to; you can do something completely unrelated.

    As an aside, and you may call this trolling (or you may not), I just wanted to see what people would say about this sort of use of map. It's probably a Bad Idea. It would be really interesting to see if somebody could convince me it's a Good Idea. :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-24 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found