Perl-Sensitive Sunglasses | |
PerlMonks |
Re: OO Pattern Container x Elements and Method Chainingby choroba (Cardinal) |
on Oct 08, 2021 at 15:38 UTC ( [id://11137354]=note: print w/replies, xml ) | Need Help?? |
Something like this?
You should probably make some of the slots weak. Update: Oh, I know see what the problem is. It works for chained methods *exclusively*, i.e. it doesn't work for non-chained methods.
For that, you need a wrapper. Maybe it's possible to overload it so it returns the wrapped element's ref when compared numerically, so $e1 == $e2 still holds?
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
In Section
Seekers of Perl Wisdom
|
|