in reply to abstraction - reusing OO module subs
Note: Not 100% tested code.sub _put_list ($@) { my $target = shift; my $self = shift ; push @{$self->{$target}}, @_; return scalar(@_); } eval "sub $_ { return _put_list($_ => \@_);}" for qw{column table};
Hope this is of use.. Quite liked the dynamic evaluation but that is not neccessary.
Hope this helpssub column { return _put_list(column => @_); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: abstraction - reusing OO module subs
by chromatic (Archbishop) on Nov 21, 2002 at 20:20 UTC |