So is this the correct syntax for sysopen to do the following. If filepath does not exist create a file with the name contained in the filepath with permissions 666, print some stuff to the file and then close it?
sysopen (FILEHANDLE, ">>$filepath",O_CREAT, 0666)||&ErrorMessage;
print FILEHANDLE "$pageoutput";
close FILEHANDLE;