in reply to i don't know rather take a look below
That way, you're using Perl to name your arguments for you. The @{$args}{qw(ARG1 ARG2 ARG3)} syntax is a hashslice of a hashref.sub first_sub { my ($args) = @_; # ... Do stuff here with $args->{FOO} ... $object->method(@{$args}{qw(ARG1 ARG2 ARG3)}); # ... Do more stuff here, this time with $args->{ETC} ... } first_sub( { ARG1 => 0, ARG2 => 1, ARG3 => 2, FOO => 'bar', ETC => 'etc', }, );
is equivalent tomy @temp = @{$args}{qw(ARG1 ARG2 ARG3)};
my @temp; push @temp, $args->{ARG1}; push @temp, $args->{ARG2}; push @temp, $args->{ARG3};
------
/me wants to be the brightest bulb in the chandelier!
Vote paco for President!
|
|---|