Don't ask to ask, just ask | |
PerlMonks |
Re: Contextual::Return and Want, any major difference?by duelafn (Parson) |
on Mar 03, 2012 at 14:47 UTC ( [id://957683]=note: print w/replies, xml ) | Need Help?? |
Want dispatches based on immediate context, whereas Contextual::Return dispatches based on first use. Example:
And the result
In the second case, Want "fails" because it was not called in hashref context. Note: rreturn only needed in :lvalue subs Update: Showed that the want code works when used inline. Good Day,
In Section
Seekers of Perl Wisdom
|
|