http://www.perlmonks.org?node_id=618446


in reply to eval order of args to a sub

Slightly OT perhaps, but the freely available chapter 9 of Perl Best Pratices (PDF) recommends:
Use a hash of named arguments for any subroutine that has more than three parameters. Named arguments should always be passed to a subroutine inside a single hash, like so:
sub padded { my ($arg_ref) = @_; my $gap = $arg_ref->{cols} - length $arg_ref->{text}; my $left = $arg_ref->{centered} ? int($gap/2) : 0; my $right = $gap - $left; return $arg_ref->{filler} x $left . $arg_ref->{text} . $arg_ref->{filler} x $right; }
# and then...
for my $line (@lines) { $line = padded({ text=>$line, cols=>20, centered=>1, filler=>$SPAC +E }); }
Andreas

--