perl -wle'sub new { bless $_[1] } sub foo { print "foo!" } main->new(\my @x); (\@x)->foo()' #### perl -wle'sub foo { print "foo!" } use Tie::Array; @ISA="Tie::StdArray"; tie @x, "main"; tied(@x)->foo()'