curtisb has asked for the wisdom of the Perl Monks concerning the following question:
I can't seem to get the matching right somewhere. The errors I'm getting are as follows.#!/usr/bin/perl -w print "\nWhat file would you like to open: "; $file = <STDIN>; print "\nAttempting to open $file\n"; open(FILE, "< $file") || die "Unable to open file: $file\n"; while(<FILE>) { 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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching Question
by Zaxo (Archbishop) on Sep 20, 2002 at 18:49 UTC | |
|
Re: Matching Question
by dws (Chancellor) on Sep 20, 2002 at 18:35 UTC | |
|
Re: Matching Question
by thelenm (Vicar) on Sep 20, 2002 at 18:35 UTC | |
by curtisb (Monk) on Sep 20, 2002 at 18:50 UTC | |
by thelenm (Vicar) on Sep 20, 2002 at 19:02 UTC | |
|
Re: Matching Question
by Anonymous Monk on Sep 20, 2002 at 18:45 UTC | |
by Anonymous Monk on Sep 20, 2002 at 18:49 UTC | |
by curtisb (Monk) on Sep 20, 2002 at 20:17 UTC | |
by mr2 (Friar) on Sep 21, 2002 at 09:38 UTC | |
by curtisb (Monk) on Sep 23, 2002 at 11:24 UTC | |
|
Re: Matching Question
by curtisb (Monk) on Sep 20, 2002 at 18:23 UTC | |
|
Re: Matching Question
by Nemp (Pilgrim) on Sep 20, 2002 at 18:34 UTC |