in reply to Removing directories with rmdir!

From perldoc -f rmdir:
Deletes the directory specified by FILENAME if that directory is empty.
Is your directory empty?

Also, you should print $!, not $?

Replies are listed 'Best First'.
Re^2: Removing directories with rmdir!
by Anonymous Monk on Jan 05, 2012 at 20:51 UTC
    No, I read on it, the directory(ies) is/ are not empty.
      What about something like this:
      #!/usr/bin/perl use strict; use warnings; use File::Path qw(remove_tree); remove_tree('dir');