#!/usr/bin/perl use strict; use warnings; my $keyword = 'file'; # Search for the key pattern in the file information. while (defined (my $line = )) { next if $line !~ /\b\Q$keyword\E\b/; print "Found key word $keyword on line $.\n"; exit; } print "Keyword not found\n"; __DATA__ Hi, I am a newbie to perl. I am trying to pass the filename and search for a keyword in that file and if found print that line else print not found message. However though my file has the keyword I get not found message.Please help.I #### Found key word file on line 2