Test script:
--- cut ---
#!perl -w
print "Diagnostic: my gid '$)'\n";
&test();
exit 0;
sub test {
local($));
return 1;
}
--- cut ---
test run:
--- cut ---
Diagnostic: my gid '10 200 5 10'
Argument "10 200 5 10" isn't numeric for return at bugtest line 3.
--- cut ---
I guess localising $) doesn't work, but the error message sure confused
me until I managed to track down where the argument was coming from.
Note especially the line number given for the error (ie the line number
of the call to &test rather than of the return statement itself).
Separate question: is there an easy way to establish from the docs
which magic variables can be preserved by localising?
Hugo van der Sanden
--- cut ---
#!perl -w
print "Diagnostic: my gid '$)'\n";
&test();
exit 0;
sub test {
local($));
return 1;
}
--- cut ---
test run:
--- cut ---
Diagnostic: my gid '10 200 5 10'
Argument "10 200 5 10" isn't numeric for return at bugtest line 3.
--- cut ---
I guess localising $) doesn't work, but the error message sure confused
me until I managed to track down where the argument was coming from.
Note especially the line number given for the error (ie the line number
of the call to &test rather than of the return statement itself).
Separate question: is there an easy way to establish from the docs
which magic variables can be preserved by localising?
Hugo van der Sanden