Perl Programming/Keywords/unlink

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Previous: unless Keywords Next: unpack

The unlink keyword[edit | edit source]

unlink deletes a LIST of files and returns the number of files successfully deleted. If it is unsuccessful, it it returns false and sets $! to the error number (errno).

Syntax[edit | edit source]

  unlink LIST

Example[edit | edit source]

my $unlinked = unlink 'a', 'b', 'c';
unlink @files;
unlink glob "*.pl";

See also[edit | edit source]

Previous: unless Keywords Next: unpack