![]() |
|
Syntactic Confectionery Delight | |
PerlMonks |
Re^2: undef is undefby jozef (Sexton) |
on Aug 29, 2012 at 09:07 UTC ( #990411=note: print w/replies, xml ) | Need Help?? |
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.
In Section
Seekers of Perl Wisdom
|
|