sub foo { print "foo\n" ;} # now redefining it: *foo = sub { print "bar\n" ;}