I'm a begginer to PERL, but i can't seem to get round this problem.
In my prog. the user introduces a value to search for, and it all works fine, except that some of the data contains '+' and '-' , which causes confusion. The use of these signs in the data is essential. Here is a bit of the code. The user will introduce one of the 5 items in a line.
Thanks
In my prog. the user introduces a value to search for, and it all works fine, except that some of the data contains '+' and '-' , which causes confusion. The use of these signs in the data is essential. Here is a bit of the code. The user will introduce one of the 5 items in a line.
Code:
for($count=1;$count<=245;$count++) {
$line[$count]=<DATA>;
}
$inlook=<STDIN>;
chop($inlook);
for($count=1;$count<=245;$count++) {
if($line[$count]=~ /\b$inlook\b/i) {
print("$line[$count]");
}
}
__END__
K 2-5 014.9+06.4 17:54:25.0 -12:48:18 ES
Na 1 018.0+20.1 17:12:51.3 -03:15:57 RS
M 3-52 018.9+04.1 18:10:26.0 -10:29.1 ES
M 3-55 021.7-00.6 18:33:14.7 -10:15:07 BR
M 3-28 021.8-00.4 18:32:41.2 -10:05:48 Q
M 1-57 022.1-02.4 18:40:20.2 -10:39:47 B
MaC 1-13 022.5+01.0 18:28:35.1 -08:43:24 NC
MA 2 022.5+04.8 18:15:13.0 -06:57.2 RS
Thanks