This line of Perl code will delete the file called filename provided that the script has permissions to delete the file.
Your Perl script can also rename a file using the rename function:
rename ("[old_filename]", "[new_filename]");
In this case, the file's name will be replaced with the new filename specified.
Finally, Perl gives you the ability to affect the permissions of files in the file system using the chmod function. The syntax is also fairly straight forward as follows:
chmod (0666, "filename");
In this case, "filename" will be made readable and writable by user, group and world.
|Previous | Next | Table of Contents|