kylespitz has asked for the wisdom of the Perl Monks concerning the following question:
Hi! I have a challenge for all you perl monks.
Let's assume I have thousands of corrupted perl files, like so:
Good file:
print "hello world!\n";
Corrupt file:
pr;int "hello world!\n";
except that they are each hundreds of lines long and I have some that work and many more that don't. I don't care about salvaging the broken files, all I'm trying to do (ha) is modify the perl compiler so that it deletes or lists any file that is broken. If I have a list, then I can use a script to delete the files. If the compiler can delete the file itself then that is fine too. Also, (here's the fun part) if the file isn't broken then I would like the script to run.
I'm asking you monks here because although I've tried to modify the compiler (I replaced a line that printed an error message with a delete command), there are so many errors that perl checks for and tries to fix on its own (one of the many things I love about perl) that I can't find and replace every instance within the compiler (/usr/bin/perl).
Any ideas? Thanks in advance for any docs you might point me to or tips on modifying the compiler itself.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Deleting corrupted perl files - modifying the perl runtime
by moritz (Cardinal) on Jul 28, 2008 at 22:09 UTC | |
by Corion (Patriarch) on Jul 29, 2008 at 06:38 UTC | |
Re: Deleting corrupted perl files - modifying the perl runtime
by TGI (Parson) on Jul 28, 2008 at 23:25 UTC | |
by blazar (Canon) on Jul 29, 2008 at 08:24 UTC | |
Re: Deleting corrupted perl files - modifying the perl runtime
by ysth (Canon) on Jul 29, 2008 at 00:18 UTC | |
Re: Deleting corrupted perl files - modifying the perl runtime
by pc88mxer (Vicar) on Jul 28, 2008 at 22:52 UTC | |
Re: Deleting corrupted perl files - modifying the perl runtime
by MidLifeXis (Monsignor) on Jul 29, 2008 at 17:32 UTC | |
Re: Deleting corrupted perl files - modifying the perl runtime
by ggvaidya (Pilgrim) on Jul 30, 2008 at 04:48 UTC |