Insert this line at the start of the sub, before %new_data is initialized:
my $scalar_data = shift;See perldoc -f shift for an explanation of shift, and what it does with no parameters. I should note that you had already selected the proper order (scalar then hash) to do this as easily as possible.
In reply to Re: Passing a hash, and a scalar to subroutine
by meredith
in thread Passing a hash, and a scalar to subroutine
by gorillaman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |