Total Pageviews

Friday, April 13, 2012

Delete a File Using unlink in Perl

unlink("hohofiles/koko.html");
-We called Perl's built-in unlink function.
-We enclosed the path to the file we want deleted in quotation marks.
Copy and Paste Perl Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
unlink("hohofiles/koko.html") || print $!;
print " -Done";
exit;

No comments:

Post a Comment