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.
In reply to Re: Formatting dynamic method names
by zwon
in thread Formatting dynamic method names
by clinton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |