in reply to AUTOLOAD returns '' as undef

if( "$new_value" ne "$self->{$function}") {
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.

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
    Thanks, I have looked at this code for so long I figured it was some simple logic error....my eyes have just glazed over after trying to debug this for so long...I initially thought it was how DBI was handling empty strings...since that is where I am populating the data from.

    Thanks for the help.