On Tue, 25 Sep 2007, Yuval Yaari wrote:
> Yona Shlomo wrote:
>> Is well in place, but alas, I'm too lazy to implement
>> several dozens of functions/methods that are the same except
>> for their name... and then change (all of them with no
>> mistakes) then when needed...
>>
> How about...
>
> <UGLY>
> BEGIN {
> no strict 'refs';
> *{__PACKAGE__ . '::' . $_} = sub {}
> for qw/foo bar baz DESTROY/;
> }
> </UGLY>
Way cool!! :-)
This actually defines the subs automatically in the BEGIN
block.
Now the question is what is more ugly: to use AUTOLOAD or to
use this.
--
Shlomo Yona
[EMAIL PROTECTED]
http://yeda.cs.technion.ac.il/~yona/
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl