open F, './Simple.pm'; while () { next unless /^(sub\s+\w+)/; print "$1;\n"; }