Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Formatting dynamic method names

by zwon (Abbot)
on Oct 10, 2009 at 13:43 UTC ( #800458=note: print w/replies, xml ) Need Help??

in reply to Formatting dynamic method names

Perhaps it should be

Method 2: --------- for ( keys %hash ) { $object->${ \"set_$_" }( $hash{$_} ); }

Update: concerning the question, I would prefer first method. It explains itself, so it is clear what it is doing even for newbie. Second statement, though shorter, will require more time to read and understand for some persons.

Replies are listed 'Best First'.
Re^2: Formatting dynamic method names
by clinton (Priest) on Oct 10, 2009 at 13:45 UTC
    You mean, without the space before the arrow? Yes, it should, but given that I use Perl::Tidy on my code, it's always going to put the space in there. Sorry - just realised that I'd left out the value :$ - will update

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://800458]
[oiskuu]: from each height difference, there's a fixed number of "moves right" - "moves left". So it's a number of combinations.
[Discipulus]: I already know how much distinct paths exists but to demonstrate the property i want to have them all
[oiskuu]: ie C(n, k); where n is height difference, k is position in the line
[Discipulus]: infact there are 70 distinct path to reach the tale wich holds 70
[Discipulus]: what i want is to compute them
[oiskuu]: You want to draw the path? $iter = combinations( $TOP_HEIGHT .. $NODE_HEIGHT, $pos); then get the path from the iter, level change at depth x, for(..) $pos += $level_change; something like that

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2018-03-19 11:05 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (239 votes). Check out past polls.