in reply to Re: undef is undef
in thread undef is undef
Well, even for one level it is necessary to check first. here's real world example:
my $avatar = $usr->person->avatar;usr and person (extended information about user) are two tables. not every user has to have extended information and the code snipped just wants to find out if user has avatar.
Adding accessor to usr sounds like a wise solution to hide test ifs, but it will mask the fact that avatar is accessor of person.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: undef is undef
by moritz (Cardinal) on Aug 29, 2012 at 10:11 UTC |
In Section
Seekers of Perl Wisdom