#!/usr/bin/perl -w print "\nWhat file would you like to open: "; chomp ($file = ); print "\nAttempting to open $file\n"; open(FILE, "$file") || die "Unable to open file: $file\n"; while() { $text =~ $_; if($text eq "go"){ $text =~ s/^go/\//g; $count++; } } print "There are $count lines in this file\n"; close FILE;