in reply to AUTOLOAD returns '' as undef
The attribute can be set to '' only if it was previously set to something else. If the attribute was never previously initialized, and this is the first time you want to set it with the initial value of '', the if statement above will not test true (that is not what you intended) and will not allow you set it.if( "$new_value" ne "$self->{$function}") {
It is a simple logical error, for a somewhat rare situation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: AUTOLOAD returns '' as undef
by BarMeister (Beadle) on Oct 27, 2005 at 08:37 UTC |