in reply to about file handling

You can indeed create files with open (follow the link for exhaustive detail on ways to open a file for reading, writing, and some combinations of the two). To delete files, have a look at unlink.

I'm sure it's possible to write or to find a module which manipulates inodes directly, to create files that way, but I would recommend against that in most cases.

If your shell supports such niceties, you can always redirect the output of your program to a file with the < or << syntax, but that's not really a Perl solution for creating a file.