sub foo { print STDERR "Entering sub foo(@_)\n"; # Do something print STDERR "Exiting sub foo: return value $bar\n"; return $bar; }