in reply to Re: Search Script
in thread Search Script
Thank you very much for the advice! I'm still having some issues with the search, any thoughts? arebcprint"\n"; print "Please enter file name and path:"; chomp($filename = <STDIN>); print "File Name: $filename"; print "\n"; open DAFILE, "$filename"; open (HintsFile, "Hints.txt") or die "Can't find file\n"; #$input = <DAFILE>; $hints = <HintsFile>; open(testfile,"Hints.txt"); $i=0; @daarray = (); while(<testfile>){ $daarray[$i] = $_; $i++; } close(testfile); for($j=0; $j<$i; $j++) { $hints = $daarray[$j]; ($first,$last) = split(/\ == /,$hints); if($first =~ m/$input/i) {print "Found: $last"; print "\n"; } } print "Search Complete\n"; close DAFILE; close HintsFile;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Search Script
by Roy Johnson (Monsignor) on May 04, 2005 at 17:48 UTC |