Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

  (email not shown publicly)

Journal of djberg96 (2603)

Thursday March 14, 2002
02:30 PM


[ #3520 ]
Ok, a conversation came up in pdcawley's journal, and I thought I should share something with y'all as most people don't seem to know about it.

Basically, the topic centered around whether or not to always return $self (for method chaining) or a value (for, say, an lvalue).

With Want, by Robin Houston (robin), you can distinguish based on calling context. So, for example, you can tell the difference between these:



$val = $obj->method;


Want can do much more than this (eg rvalue subs, etc), but I find the "want('OBJECT')" call to be the most useful. :)


The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.