P
Philip Scobie
I am searching "myfile.txt" which looks like this:
Perl.1234
HTML.1234
PHP.1234
CGI.1234
I am trying to print a single line based on a variable name, such as
"Perl" or "HTML". Maybe if I show you my code it will make more sense:
my $value = param ('incoming_parameter') (e.g. 'Perl')
open (LOG, "myfile.txt");
while (<LOG>){
if(/$value/){ <-Search for the word "Perl"???
print $_; <-If matched, print the current line.
}
}
With an 'incoming_parameter' of "Perl", it should match and print
"Perl.1234". But it doesn't.
HELP!
Perl.1234
HTML.1234
PHP.1234
CGI.1234
I am trying to print a single line based on a variable name, such as
"Perl" or "HTML". Maybe if I show you my code it will make more sense:
my $value = param ('incoming_parameter') (e.g. 'Perl')
open (LOG, "myfile.txt");
while (<LOG>){
if(/$value/){ <-Search for the word "Perl"???
print $_; <-If matched, print the current line.
}
}
With an 'incoming_parameter' of "Perl", it should match and print
"Perl.1234". But it doesn't.
HELP!