in reply to running notpade from perl

Here is a safer, and more user-friendly way to accomplish what you want, based on the file EXTENSION:
my $generatedfile = "outfile.txt"; system $generatedfile ;
Notice the absence of any reference to NOTEPAD.

This makes the program independent of the Name or location of Notepad. It makes the program more friendly, because it invokes the DEFAULT text editor, which may be different from notepad (Mine is ConText, not notepad).

Yes, it adds a dependency on the file type, but that is under your control, and I think the friendliness and resiliancy of this method make it superior.

"Experience is a wonderful thing. It enables you to recognize a mistake when you make it again."