perl -pe 's/sub\s+(\w+)\s+{/sub $1 { print STDERR "entering $1\n"; /'