in reply to monitor rm command ?

In the long run, you'll be better off using something like this, otherwise, do what tirwhan said.
unlink @files or warn "wtf: $!";

-Paul

Replies are listed 'Best First'.
Re^2: monitor rm command ?
by rovf (Priest) on Sep 02, 2009 at 11:45 UTC
    Your example wouldn't show which files are deleted. For this, you would need something like

    for @files { unlink and push @deleted,$_ }

    -- 
    Ronald Fischer <ynnor@mm.st>
      Yours doesn't really show errors either...
      for(@files) { if( unlink ) { push @deleted, $_; } else { warn "$_ doesn't want to die: $!" } }

      -Paul

        Yours doesn't really show errors either...

        Correct, but that was not requested by the OP ;-)

        -- 
        Ronald Fischer <ynnor@mm.st>