MrQuest has asked for the wisdom of the Perl Monks concerning the following question:

is there any syntax other than open (I heard from someone (note: I think this person doesn't know enough about Perl to be giving advice yet) that open creates the file, which I have tried in the past and it did not create files) to create files? also, is there a syntax to delete files?

Replies are listed 'Best First'.
Re: about file handling
by chromatic (Archbishop) on Jun 14, 2000 at 06:03 UTC
    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.

Re: about file handling
by gnat (Beadle) on Jun 14, 2000 at 23:55 UTC
    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 :-)