note
olus
<p>
You can also <code>shift</code> the args.</p>
<p>Also, since the arguments are passed as a list, you could start considering passing references to the arrays and deref them in the sub. That way you can pass other args after the first array, or multiple arrays (that would otherwise be considered a single one).</p>
<code>
use strict;
use warnings;
my $arg1 = "abc";
my @arg2 = (1, 2, 3, 4);
show_args($arg1, \@arg2);
sub show_args {
my $arg1 = shift;
my $arg2 = shift;
my @lines = @{$arg2};
print @lines;
}
</code>
748856
748856