in reply to Re (tilly) 1: Passing parameters to a module's import function
in thread Passing parameters to a module's import function
An aside. Here's another way of coding it:
sub import { my $self = shift; my @exports = grep { "HASH" ne ref($_) } @_; my @options = grep { "HASH" eq ref($_) } @_; foreach (@options) { # handle options here } @_ = ($self, @exports); goto &Exporter::import; }
Question: will grep interfere with @_ (making the above a bit dangerous)?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: An alternate way of implementing import with options
by japhy (Canon) on Feb 13, 2001 at 21:32 UTC | |
by tilly (Archbishop) on Feb 13, 2001 at 21:43 UTC | |
by japhy (Canon) on Feb 13, 2001 at 21:46 UTC | |
|
Re: An alternate way of implementing import with options
by merlyn (Sage) on Feb 13, 2001 at 21:28 UTC | |
by tilly (Archbishop) on Feb 13, 2001 at 21:48 UTC |