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 # Latest change: Feb 26 2005 [mika]
8 ################################################################################
10 # This script will replace all the unsighted unprintable characters bleached out of your source file by a:
12 # directive with elegant (perhaps) ASCII perl code.
15 my $washing = pop or carp("Usage: unbleach.pl [file]\n");
16 open white,"<$washing" or carp("Can't get $washing");
18 s/(.*)^\s*use\s+Acme::Bleach\s*;\n(?: \t){8}/$1/
19 or carp("$washing is not bleached!");
20 open line,">$washing" or carp("Can't dry $washing");
22 sub out {s/\n//g;tr/ \t/01/;pack "b*",$_;}
23 sub carp {print shift and exit}
27 unbleach.pl - For I<really> unclean programs
35 This script will replace all the unsighted unprintable
36 characters bleached out of your source file by a:
40 directive with elegant (perhaps) ASCII perl code.
42 It also removes the use bleach line when it rewrites
43 the source code. The code continues to work exactly
44 as it did before, but now looks like normal!
48 =item C<Can't get '%s'>
50 unbleach.pl could not read the source file.
52 =item C<'%s' is not bleached!>
54 unbleach.pl will only process files that have been
55 previously bleached and have the expected format.
57 =item C<Can't dry '%s'>
59 unbleach.pl could not open the source file to modify it.
63 http://www.cpan.org/authors/id/DCONWAY/Acme-Bleach-1.12.tar.gz
64 http://www.perlmonks.com
68 not Damian Conway (as if you couldn't guess)
72 Copyright (c) 2001, tachyon. All Rights Reserved.
73 This script is free software. It may be used, redistributed
74 and/or modified under the terms of the Perl Artistic License
75 (see http://www.perl.com/perl/misc/Artistic.html)