jalebie has asked for the wisdom of the Perl Monks concerning the following question:
i am working on a larger program where i am having an error due to the above problem. Please if anyone knows a way i can match this without changing my input argument or the temp.mine file let me know asap. Thanks Warisuse strict; my $var1 = $ARGV[0]; print $var1."\n"; open(IN, "temp.mine") or die "Error opening temp.mine\n"; while(<IN>) { my $line = $_; print "input = $line\n"; if($line =~ /$var1/m) { print "found \n"; close(IN) or die "Error closing file\n"; exit 0; } } close(IN) or die "Error closing temp.mine\n"; print "not found \n"; #contents of file temp.mine #a+b
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: matching + character in a file
by tachyon (Chancellor) on Aug 07, 2001 at 01:05 UTC | |
|
Re: matching + character in a file
by runrig (Abbot) on Aug 07, 2001 at 01:08 UTC | |
|
2 small things
by dga (Hermit) on Aug 07, 2001 at 02:54 UTC | |
|
Re: matching + character in a file
by mischief (Hermit) on Aug 07, 2001 at 15:00 UTC |