{ package foo; use strict; sub get_coderef { sub { print "hello world\n" } } } use Data::Dumper; $Data::Dumper::Deparse = 1; print Dumper(foo->get_coderef); __END__ $VAR1 = sub { package foo; use strict 'refs'; print "hello world\n"; };