The ref method returns the class name. It will return undef if it's argument is not a ref, in which case the || will give the class name.
In the discussion mentioned above, people debate whether this is good form or not. I tend to say you should not make methods with multiple calling conventions, but Perl is about freedom and many wise programmers disagree with me.
Phil
In reply to Re: Objects and references
by philcrow
in thread Objects and references
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |