Basically what you claim to be doing shouldn't produce this error. You'd be getting this error if you were calling
Green::updateRec(%ARGS)
(no backslash in front of $ARGS). So a few possibilities:
- are you calline Green::updateRec in two different places? (the one you've shown us is correct, but the other is wrong, and you're confusing the error messages?)
- is this "code" maybe being written into a string which will get eval'd later on? If so, could this be an interpolated string, such that "\%ARGS" is interpolated as "%ARGS" (the backslash merely escaping the percent)?
One thing I can tell is that you are clearly either passing %ARGS as a hash (not a reference) or you are doing something between the
sub updateRec {
$new = shift @_;
somewhere along the lines of
$new = (%$new);
Or, in other words: loading $new with one of the keys in the hash %$new. It'd be a lot easier to make this mistake in your parameter passing, though... so I'd look there first.
One other question: are you really not using strict?
sub updateRec {
my $new = shift @_;
------------
:Wq
Not an editor command: Wq