Files
pcas/configure/tools/rm.pl
Marty Kraimer c5f680196f added
1999-09-14 12:32:51 +00:00

33 lines
348 B
Perl
Executable File

#!/usr/bin/perl
#
# UNIX-rm in Perl
use File::Path;
use File::Find;
use Getopt::Std;
getopt "";
foreach $arg ( @ARGV )
{
next unless -e $arg;
if (-d $arg)
{
if ($opt_r and $opt_f)
{
rmtree $arg;
}
else
{
rmdir ($arg) or die "Cannot delete $arg";
}
}
else
{
unlink ($arg) or die "Cannot delete $arg";
}
}
# EOF rm.pl