in reply to remove directory in perl

There is rmdir (for empty dirs) and File::Path::rmtree (for entire trees).

Replies are listed 'Best First'.
Re^2: remove directory in perl
by Anonymous Monk on May 20, 2009 at 15:33 UTC
    i want to delete directories/sub directories based on their modified date
      See stat for some information on how to get Modify Time of a directory. It returns an array with various data on a supplied file or directory.
      #last modify time of /usr/bin: print scalar localtime((stat("/usr/bin"))[9]); # Thu May 14 13:52:17 2009 my $SECONDS_IN_DAY = 60*60*24; $days_old = (time-(stat($dirname))[9]) / $SECONDS_IN_DAY; if($days_old > 5){ #do_something }

        -M is simpler.

        The OP already asked this question here and here

        -M is simpler.

        The OP already asked this question here and here