Time Modified Issue Please Assist

I am trying to periodically check that the environment variables have not been changed on a HP-UX server. This was going to be easy except I ran into the odd circumstance of having two files that should be created equally be created differently when one is created by command line and the other is created in the korn script. This occurs when i create one text file by doing env > env.txt on the command line and the other one env > envDiff.txt in the korn script. They end up different somehow. Anyway I am now trying to figure out a way where I can periodically refresh the env.txt within the script. If I didn't then issues would arise whenever environment variables are changed on purpose. I decided to try to do this based on time modified but HP-UX doesn't have stat. HP-UX also doesn't have -mmin from what I have read. I also looked into using find but I couldnt get anything to work. Does find always return true even when it doesn't find anything? I would appreciate any ideas/solutions. Below is a breakdown of what I need to accomplish in a korn script:

if(file has not been modified in this long)
{
env > env.txt
}

Thanks for your time!

#!/bin/ksh
# filetimes compared with now 
filetimediff()
{
    perl  -e '
          use POSIX qw(strftime);
          
          $mtime = (stat $ARGV[0])[9];             
          $seconds1 = strftime "%s\n", localtime($mtime);
          $seconds = time;
          $seconds -= $seconds1;
          print "$seconds: ";         # total seconds comment out if not needed
                   ' $1
}
#usage example
dt=$(filetimediff  "$1")
if [[ $dt -gt 3600 ]] ; then  # 3600 seconds in 1 hour - change to suit
    env > env.txt
fi