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