On Mon, Jul 25, 2016 at 03:27:30AM -0000, Father Chrysostomos wrote: > I wrote: > > I wrote: > > > package T { sub TIESCALAR{bless[]} sub STORE { warn "Storing $_[1]" } } > > > foo(); > > > use experimental "signatures"; > > > sub bar ($x=3) { > > > sub foo { tie $x, "T" } > > > } > > > bar(); > > > > Here is the goto version: > > > > package T { sub TIESCALAR{bless[]} sub STORE { warn "Storing $_[1]" } } > > use experimental "signatures"; > > sub bar ($=$_ == 1 && goto foo, $y=3) { > > foo: > > tie $y, "T" if $_ == 1 > > } > > $_ = 1; > > bar(); > > $_ = 0; > > bar(); > > And since I am in the mood for torturing people right now: > > $ ./perl -Ilib -e 'use experimental "signatures"; use Scalar::Util "weaken"; sub foo($x=weaken (my $y = \@_)) {} foo' > Assertion failed: (!SvMAGICAL(defav)), function Perl_pp_argelem, file pp.c, line 6648. > Abort trap: 6 > > :-) You are a sick and twisted individual ;-) I'll have to revisit my assumptions. -- The Enterprise is captured by a vastly superior alien intelligence which does not put them on trial. -- Things That Never Happen in "Star Trek" #10Thread Previous