in reply to file comparison

If you just want to know if the two versions are exactly the same, just put them both in a string and use string compare

my $answer= log_in_box_and_do_something(); open(F,'<',$filename) or die "Could not open $filename\n"; my $compare= <F>; if ($answer eq $compare) { #both are equal }

This is a very basic method, the slightest difference will throw it off, even if it is only a space character. If you want more, you could use a command line utility like diff (on unix/linux) or extract the important elements with some regexes and compare those to the file