in reply to Re^2: Strange behavior: passing $1 to AUTOLOAD
in thread Strange behavior: passing $1 to AUTOLOAD
As Elian says, make copies when passing in ephemeral values such as $1, $!, $@; one easy way to do that is to stringify, as long as that doesn't lose you information:
$person->name("$1");
If just the string is not enough (eg to pass the dualvar $!), I think the easiest way is to make a copy:
my $error = $!; $log->error($error);
Hugo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Strange behavior: passing $1 to AUTOLOAD
by revdiablo (Prior) on Sep 22, 2004 at 23:35 UTC |