use strict; use warnings; my @words = qw{january february egypt}; open my $file, '<', 'file.txt'; my $text = do { local $/; scalar <$file>; }; close $file; for my $word (@words) { print (($text =~ /\Q$word\E/) ? $word : "$word not present"); }
Didn't test it, however.
upd: fixed syntax error
In reply to Re: How to club different lines of program into one
by akho
in thread How to club different lines of program into one
by ashok13123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |