$x = 4; $xx = sub{\@_}->(\$x, \$x); $y = \4; $yy = sub{\@_}->($y, $y); bless \$xx->[0], 'Foo'; bless \$xx->[1], 'Bar'; bless \$yy->[0], 'Foo'; bless \$yy->[1], 'Bar'; use Data::Dumper; print Dumper $xx, $yy;