Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

This script will replace all the unsighted unprintable characters bleached out of your source file by a:

use Acme::Bleach;

directive with elegant (perhaps) ASCII perl code.

#!/usr/bin/perl # unbleach.pl - for really dirty programs use strict; my $washing = pop or carp("Usage: unbleach.pl [file]"); open white,"<$washing" or carp("Can't get $washing"); local $/; $_=<white>; s/(.*)^\s*use\s+Acme::Bleach\s*;\n(?: \t){8}/$1/ or carp("$washing is not bleached!"); open line,">$washing" or carp("Can't dry $washing"); print line out($_); sub out {s/\n//g;tr/ \t/01/;pack "b*",$_;} sub carp {print shift and exit} =head1 NAME unbleach.pl - For I<really> unclean programs =head1 SYNOPSIS unbleach.pl [file] =head1 DESCRIPTION This script will replace all the unsighted unprintable characters bleached out of your source file by a: use Acme::Bleach; directive with elegant (perhaps) ASCII perl code. It also removes the use bleach line when it rewrites the source code. The code continues to work exactly as it did before, but now looks like normal! =head1 DIAGNOSTICS =item C<Can't get '%s'> unbleach.pl could not read the source file. =item C<'%s' is not bleached!> unbleach.pl will only process files that have been previously bleached and have the expected format. =item C<Can't dry '%s'> unbleach.pl could not open the source file to modify it. =head1 SEE ALSO http://www.cpan.org/authors/id/DCONWAY/Acme-Bleach-1.12.tar.gz http://www.perlmonks.com =head1 AUTHOR not Damian Conway (as if you couldn't guess) =head1 COPYRIGHT Copyright (c) 2001, tachyon. All Rights Reserved. This script is free software. It may be used, redistributed and/or modified under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html)

In reply to unbleach.pl by tachyon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found