Or, how to make this work in Perl: create a function x() that can return an unblessed scalar, or an object if it is tried to be called as an object. For example:
print makeupname(); # prints "John Smith" print makeupname()->first; # prints "John"
Is it possible?
In reply to Is there a wantobject like wantarray? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |