#!/bin/perl -w use strict; open( NOTES, "+ to pick it up properly later) # when you are ready to read it seek NOTES, $pos, 0; # reset filehandle to the right position my $fromfile=; # read chomp $fromfile; # rememebr that \n? You might want to remove it now if ($fromfile eq "test") {print "Yes, this works"}