#!/usr/bin/perl # open your file using a filehandle # called MYFILE open(MYFILE, "/home/me/myfile"); # slurp the contents of MYFILE into # the variable $myfle $myfile = (); # seach for your text ... if ($myfile =~ m/some txt i look for/) { print "Found the text\n"; } # and look for more text if ($myfile =~ m/some other text i look/) { print "Got other text\n"; }