perl5ever has asked for the wisdom of the Perl Monks concerning the following question:
as if it were$x | $y | $z
I was hoping to a new (left-associative) operation on a new data type (objects of a certain class), so that I could write:$z | ($x | $y)
and have it translate to:$x | $y | $z
where the order of the arguments to f matters, but it doesn't look like I can do that with overloading.f(f($x,$y),$z)
The SO post with more details: http://stackoverflow.com/questions/12293640/why-does-perl-parse-x-y-z-as-z-x-y
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $x | $y | $z = $z | ($x | $y) ?
by philiprbrenan (Monk) on Sep 06, 2012 at 16:00 UTC | |
by perl5ever (Pilgrim) on Sep 06, 2012 at 16:07 UTC | |
|
Re: $x | $y | $z = $z | ($x | $y) ?
by ikegami (Patriarch) on Sep 07, 2012 at 00:06 UTC | |
|
Re: $x | $y | $z = $z | ($x | $y) ?
by locked_user sundialsvc4 (Abbot) on Sep 06, 2012 at 19:54 UTC |