Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Method Calls on multiple objects

by Fletch (Bishop)
on Mar 27, 2004 at 02:20 UTC ( [id://340195]=note: print w/replies, xml ) Need Help??


in reply to Re: Method Calls on multiple objects
in thread Method Calls on multiple objects

Or even capturing return values:

my @rets = map { $_->$method( @args ) } @objs;

Or allowing returns of lists:

my @rets = map { [ $_->$method( @args ) ] } @objs;

Replies are listed 'Best First'.
Re: Re: Re: Method Calls on multiple objects
by dragonchild (Archbishop) on Mar 27, 2004 at 03:31 UTC
    So, why would an aggregate be better? What syntactic sugar are you looking for?

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

      What syntactic sugar are you looking for?

      He was arguing (as I was) against your post that there never comes a need to call a method against a collection of objects. It was *you* who were were saying the demand for an aggregate was a red-flag in a code-review, and then you complain our percieved advocacy of aggregates, neither of which we have posted. Both fletch and I have mentioned foreach, map, grep, and so on -- not aggregates. Please reread our posts, as I think you are confusing our posts with those of Limbic~Region, who created a very special-case agg. (not just 'RandomSpaceTravelers' (which is a fair collection class if you really need one) but a much different (and bizarre) function calling interface for a list of random space travellers). We aren't the same people, and we aren't making the same points.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-04-23 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found