I have a routine with a prototype like this:
sub printFoo(%) { my (%hashFoo) =@ _;
But I would like to additionally pass the second scalar argument as follows:
sub printFoo(%;$) { my (%hashFoo,$optionalArg) =@ _;
I understand that in warning mode this is no-no, but I'm not sure why.
I suppose I can use the global variable flag, but any advice on how to elegantly execute this type of function signature?
source share