On Sat, Mar 14, 2009 at 4:01 PM, Evgeny <[email protected]> wrote:
>
> Now there is also another issue I remember having.
> How can I pass an unspecified amount of arguments to a function, since a
> function does not really care how many parameters it gets - I just read them
> one by one with "shift". I want to have a generic $callback->(.........)
> where instead of the dots I dont use an array, but "explode" this array into
> multiple arguments.
> In ruby it is done exactly like that callback( * array ) where the * is
> exploding it.
I am not sure I understand you
sub f {
my @args = @_;
}
or
sub g {
my ($self, $arg1, $arg2, @more_args) = @_;
}
something along those lines.
BTW are we having a Perl course on the Ruby list now ? :-)
Gabor
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl