Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: monitor rm command ?

by jettero (Monsignor)
on Sep 02, 2009 at 10:25 UTC ( [id://792865]=note: print w/replies, xml ) Need Help??


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>

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://792865]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 16:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found