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. | [reply] |
Speaking of inodes ....
The sysadmin course at University of Colorado, Boulder,
has an early lab that starts "First, learn Perl. Then use Perl to
access the raw disk device and walk the inode table to
find /etc/motd ...". You got no credit for learning Perl,
only applying it.
And you thought freshman calculus homework was hard :-) | [reply] |