Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Deleting corrupted perl files - modifying the perl runtime

by Corion (Patriarch)
on Jul 29, 2008 at 06:38 UTC ( [id://700738]=note: print w/replies, xml ) Need Help??


in reply to Re: Deleting corrupted perl files - modifying the perl runtime
in thread Deleting corrupted perl files - modifying the perl runtime

Personally, I've learned to not do rm -- "$i" but to use the following idiom:

for i in *; do perl -c "$i" || echo rm -- "$i"; done

This allows me to inspect what would happen if I were to run the command. When I'm confident that the output is what I want, I either delete the echo from the line or pipe the whole output into another shell:

for i in *; do perl -c "$i" || echo rm -- "$i"; done |bash

I employ a similar technique before issuing a manual DELETE command on a database.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2025-11-10 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (66 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.