in reply to $x | $y | $z = $z | ($x | $y) ?
use feature ":5.14"; use warnings FATAL => qw(all); use strict; use Data::Dump qw(dump pp); sub foo() {package foo; use overload '|' => \&p; sub p {bless [@{$_[0]},@{$_[1]}]} } my $x = bless ["x"], "foo"; my $y = bless ["y"], "foo"; my $z = bless ["z"], "foo"; my $p = $x | $y | $z; pp($p)
Produces:
bless(["x", "y", "z"], "foo")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: $x | $y | $z = $z | ($x | $y) ?
by perl5ever (Pilgrim) on Sep 06, 2012 at 16:07 UTC |