Next Tricks of the Wizards 130

Booleanumbers

        sub delete_files {
          my ($dir) = @_;
          opendir my $dh, $dir or return;
          my $deleted = "0e0";
          for (readdir $dh) { ++$deleted if unlink }
          return $deleted;
        }
        unless (delete_files(...)) { die... }
        $num_deleted = delete_files(...);


Next Copyright © 2003 M. J. Dominus