Ah ... I see. Using a slurpy parameter @settings will solve this and fits much better into your use-case.
from perlsub
After positional parameters, additional arguments may be captured in a slurpy parameter. The simplest form of this is just an array variable:sub foo ($filter, @inputs) { print $filter->($_) foreach @inputs; }
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^5: Distinguish between missing and undefined arguments with subroutine signatures (slurpy parameter)
by LanX
in thread Distinguish between missing and undefined arguments with subroutine signatures
by jo37
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |