#/usr/bin/perl -pi.bak $count++ if s/^go/\//; END { print STDERR "There were $count lines starting with 'go' in the file\n"; }