2 # Filename: unbleach.pl
3 # Purpose: for really dirty perl programs
4 # Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports: see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2.
7 ################################################################################
9 # This script will replace all the unsighted unprintable characters bleached out of your source file by a:
11 # directive with elegant (perhaps) ASCII perl code.
14 my $washing = pop or carp("Usage: unbleach.pl [file]\n");
15 open white,"<$washing" or carp("Can't get $washing");
17 s/(.*)^\s*use\s+Acme::Bleach\s*;\n(?: \t){8}/$1/
18 or carp("$washing is not bleached!");
19 open line,">$washing" or carp("Can't dry $washing");
21 sub out {s/\n//g;tr/ \t/01/;pack "b*",$_;}
22 sub carp {print shift and exit}
26 unbleach.pl - For I<really> unclean programs
34 This script will replace all the unsighted unprintable
35 characters bleached out of your source file by a:
39 directive with elegant (perhaps) ASCII perl code.
41 It also removes the use bleach line when it rewrites
42 the source code. The code continues to work exactly
43 as it did before, but now looks like normal!
47 =item C<Can't get '%s'>
49 unbleach.pl could not read the source file.
51 =item C<'%s' is not bleached!>
53 unbleach.pl will only process files that have been
54 previously bleached and have the expected format.
56 =item C<Can't dry '%s'>
58 unbleach.pl could not open the source file to modify it.
62 http://www.cpan.org/authors/id/DCONWAY/Acme-Bleach-1.12.tar.gz
63 http://www.perlmonks.com
67 not Damian Conway (as if you couldn't guess)
71 Copyright (c) 2001, tachyon. All Rights Reserved.
72 This script is free software. It may be used, redistributed
73 and/or modified under the terms of the Perl Artistic License
74 (see http://www.perl.com/perl/misc/Artistic.html)