Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: playing with map

by merlyn (Sage)
on Mar 09, 2001 at 23:21 UTC ( [id://63319]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: playing with map
in thread playing with map

If act_on returns a list then all members are pushed into @old.
In a list context, act_on must return a list! And map (and the map-equivalents) are providing list context.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Re: Re: playing with map
by mirod (Canon) on Mar 09, 2001 at 23:28 UTC

    OK, I was not clear. I should have written "if act_on returns a list with more than one element" then the original code is not equivalent to a map (and I can play with fonts too ;--). If act_on returns a scalar or a 1 element list then the original code behaves the same way as a map.

Log In?
Username:
Password:

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

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

    No recent polls found