in reply to how to suppress warning from rmtree command

eval { mkpath($dir) }; if ($@) { print "Couldn't create $dir: $@"; # leave this out if you want si +lence } # untested code. should not be used to control laser brain surgery sy +stems


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re^2: how to suppress warning from rmtree command
by runrig (Abbot) on Aug 19, 2011 at 22:00 UTC
    The OP is not creating a directory, but removing it. Maybe the error is due to not being able to create the directory in the first place, but it also may be due to the the directory being removed while it's the current directory...but there's not enough code above to tell. And eval doesn't suppress warnings, it suppresses errors. Or did I miss the OP changing beyond recognition after you posted your answer :-)