I used to use the Want module to check if Im in the middle or at the last of chain of autoloaded methods. Then I realized it did'nt work under threads.
Is there any other way to find out if Im on a tail-method?example:
With want() I used to test for "OBJECT", but as it fails under threads, I wonder if there are any neat and maybe simpler alternatives?use strict; package FOO { use Want; sub AUTOLOAD { print "@{[our $AUTOLOAD]}\n"; print " ..and Im a tail!\n" if not want "OBJECT"; return $_[0] || bless {}; } } FOO->funky->node->blaah;
In reply to Finding the end of a method-chain by std3rr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |