hello guys
i set this code , and i would like to know if its possible put "quotes" on the searched word.
Thank You
#word searching program within a txt file
#!C:/perl/bin/perl.exe
start:
#Handle Area - file opening
open FILE, "c:/perl/notice.txt" or die "failed to open notice.txt $!\n";
@read=<FILE>;
close FILE;
chomp @read;
#Searching Area
print "Search a word\?\n";
$choose=<STDIN>; chomp $choose;
unless($choose =~/y|Y|[Y,y]es/){
print "invalid \n";
goto start;
}
print "Type the word\n";
$choose=<STDIN>; chomp $choose;
my @result= grep(/$choose/,@read);
print "Sorry, this word was not found" unless(@result);
foreach(@result) {
print "results: ''$_''";
}
i set this code , and i would like to know if its possible put "quotes" on the searched word.
Thank You
#word searching program within a txt file
#!C:/perl/bin/perl.exe
start:
#Handle Area - file opening
open FILE, "c:/perl/notice.txt" or die "failed to open notice.txt $!\n";
@read=<FILE>;
close FILE;
chomp @read;
#Searching Area
print "Search a word\?\n";
$choose=<STDIN>; chomp $choose;
unless($choose =~/y|Y|[Y,y]es/){
print "invalid \n";
goto start;
}
print "Type the word\n";
$choose=<STDIN>; chomp $choose;
my @result= grep(/$choose/,@read);
print "Sorry, this word was not found" unless(@result);
foreach(@result) {
print "results: ''$_''";
}