Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL unlink Function
Syntax
Definition and Usage
Deletes the files specified by LIST, or the file specified by $_ otherwise. Be careful while using this function because there is no recovering once a file gets deleted.
Return Value
Example
Create two files t1.txt and t2.txt in /tmp directory and then use the following program to delete these two files.
#!/usr/bin/perl -w
unlink( "/tmp/t1.txt", "/tmp/t2.txt" );
|
It will produce following results:
Both the files t1.txt and t2.txt will be deleted from /tmp.
| |
|

|
|
|