#!/usr/bin/perl # main program; print "Enter the filename to be parsed\n"; my $file = ; open (FILE,$file); @lines = ; close (FILE); print "Enter the keyword to be searched in the file\n"; chop (my $key = ); if (grep {$_ eq $key} @lines) # Search for the key pattern in the file information. { print "$_ \n"; # If found print the line } else { print "Keyword not found\n"; }