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 :-) This is with the smoke-me/davem/sub_argsB3 branch.Thread Previous | Thread Next