r37449 - in /branches/upstream/libacme-bleach-perl: ./ current/ current/demo/ current/lib/ current/lib/Acme/ current/t/

nhandler-guest at users.alioth.debian.org nhandler-guest at users.alioth.debian.org
Fri Jun 5 11:12:29 UTC 2009


Author: nhandler-guest
Date: Fri Jun  5 11:12:23 2009
New Revision: 37449

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=37449
Log:
[svn-inject] Installing original source of libacme-bleach-perl

Added:
    branches/upstream/libacme-bleach-perl/
    branches/upstream/libacme-bleach-perl/current/
    branches/upstream/libacme-bleach-perl/current/Changes   (with props)
    branches/upstream/libacme-bleach-perl/current/MANIFEST   (with props)
    branches/upstream/libacme-bleach-perl/current/Makefile.PL   (with props)
    branches/upstream/libacme-bleach-perl/current/README   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/
    branches/upstream/libacme-bleach-perl/current/demo/demo_DWIM.pl   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/demo_bleach.pl   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_c.pl   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_eng.pl   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_lisp.pl   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_sh.pl   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/demo_empty.pl   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/demo_morse.pl   (with props)
    branches/upstream/libacme-bleach-perl/current/demo/empty   (with props)
    branches/upstream/libacme-bleach-perl/current/lib/
    branches/upstream/libacme-bleach-perl/current/lib/Acme/
    branches/upstream/libacme-bleach-perl/current/lib/Acme/Bleach.pm   (with props)
    branches/upstream/libacme-bleach-perl/current/lib/Acme/DWIM.pm   (with props)
    branches/upstream/libacme-bleach-perl/current/lib/Acme/Morse.pm   (with props)
    branches/upstream/libacme-bleach-perl/current/t/
    branches/upstream/libacme-bleach-perl/current/t/DWIM.t   (with props)
    branches/upstream/libacme-bleach-perl/current/t/bleach.t   (with props)
    branches/upstream/libacme-bleach-perl/current/t/morse.t   (with props)

Added: branches/upstream/libacme-bleach-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/Changes?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/Changes (added)
+++ branches/upstream/libacme-bleach-perl/current/Changes Fri Jun  5 11:12:23 2009
@@ -1,0 +1,25 @@
+Revision history for Perl extensions Bleach, Morse, and DWIM
+
+1.00	Thu Feb 22 11:35:12 2001
+
+	- original version
+
+
+1.10	Mon May  7 08:12:59 2001
+
+	- Add demo_bleach.* examples in other languages
+
+	- Added DWIM.pm (at dha's implicit request)
+
+
+1.11	Mon May  7 10:21:36 2001
+
+	- Changed the DWIM operator to ... (thanks Dave!)
+
+
+1.12	Tue May 22 10:17:07 2001
+
+	- Moved demos to demo/ subdirectory and changed suffixes to
+	  prevent an over-eager CPAN.pm trying to bootstrap Bleach
+
+	- Renamed module to Acme::Bleach

Propchange: branches/upstream/libacme-bleach-perl/current/Changes
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/MANIFEST?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/MANIFEST (added)
+++ branches/upstream/libacme-bleach-perl/current/MANIFEST Fri Jun  5 11:12:23 2009
@@ -1,0 +1,19 @@
+Changes
+MANIFEST
+Makefile.PL
+README
+lib/Acme/Bleach.pm
+lib/Acme/Morse.pm
+lib/Acme/DWIM.pm
+t/bleach.t
+t/morse.t
+t/DWIM.t
+demo/demo_bleach.pl
+demo/demo_bleach_c.pl
+demo/demo_bleach_eng.pl
+demo/demo_bleach_lisp.pl
+demo/demo_bleach_sh.pl
+demo/demo_morse.pl
+demo/demo_empty.pl
+demo/demo_DWIM.pl
+demo/empty

Propchange: branches/upstream/libacme-bleach-perl/current/MANIFEST
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/Makefile.PL?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/Makefile.PL (added)
+++ branches/upstream/libacme-bleach-perl/current/Makefile.PL Fri Jun  5 11:12:23 2009
@@ -1,0 +1,7 @@
+
+use ExtUtils::MakeMaker;
+WriteMakefile(
+		NAME	=> 'Acme::Bleach',
+		VERSION => '1.12',
+
+	     );

Propchange: branches/upstream/libacme-bleach-perl/current/Makefile.PL
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/README?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/README (added)
+++ branches/upstream/libacme-bleach-perl/current/README Fri Jun  5 11:12:23 2009
@@ -1,0 +1,59 @@
+==============================================================================
+                   Release of version 1.12 of Acme::Bleach
+==============================================================================
+
+
+NAME
+    Acme::Bleach - For *really* clean programs
+
+SYNOPSIS
+            use Acme::Bleach;
+
+            print "Hello world";
+
+DESCRIPTION
+    The first time you run a program under `use Acme::Bleach', the
+    module removes all the unsightly printable characters from your
+    source file. The code continues to work exactly as it did before,
+    but now it looks like this:
+
+            use Acme::Bleach;
+                                                                                             
+INSTALLATION
+
+    It's all pure Perl, so just put the .pm file in its appropriate
+    local Perl subdirectory.
+
+
+AUTHOR
+    Damian Conway (as if you couldn't guess)
+
+
+COPYRIGHT
+           Copyright (c) 2001, Damian Conway. All Rights Reserved.
+         This module 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)
+
+
+==============================================================================
+
+CHANGES IN VERSION 1.12
+
+
+	- Moved demos to demo/ subdirectory and changed suffixes to
+	  prevent an over-eager CPAN.pm trying to bootstrap Bleach
+
+	- Renamed module to Acme::Bleach
+
+
+==============================================================================
+
+AVAILABILITY
+
+Acme::Bleach has been uploaded to the CPAN
+and is also available from:
+
+	http://www.csse.monash.edu.au/~damian/CPAN/Acme-Bleach.tar.gz
+
+==============================================================================

Propchange: branches/upstream/libacme-bleach-perl/current/README
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/demo_DWIM.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/demo_DWIM.pl?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/demo_DWIM.pl (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/demo_DWIM.pl Fri Jun  5 11:12:23 2009
@@ -1,0 +1,7 @@
+print "In the pre-DWIM light...\n";
+
+use Acme::DWIM;
+
+my ($x) = +("Hullo " x 3 . "world" & "~" x 30) =~ /(.*)/;
+$x =~ tr/tnv/uow/;
+print $x;

Propchange: branches/upstream/libacme-bleach-perl/current/demo/demo_DWIM.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/demo_bleach.pl?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/demo_bleach.pl (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/demo_bleach.pl Fri Jun  5 11:12:23 2009
@@ -1,0 +1,4 @@
+use Acme::Bleach;
+
+print "Hello world\n"
+	for(1..5);

Propchange: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_c.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_c.pl?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_c.pl (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_c.pl Fri Jun  5 11:12:23 2009
@@ -1,0 +1,23 @@
+use Acme::Bleach;
+ 	 	 	 	 	 	 	 		 		     
+#include <stdio.h>  			  	
+  			 	  
+int	main(void) {		  			
+ 		   printf("%s","Hello	world!\n"); 	
+}		      	
+   	   	 
+    	  	 
+	 	  		  
+ 		 		   
+		 		 			
+	 		     
+ 	  			 	
+		 				 	
+	  	  			
+   		 		 
+  	  		 	
+    	    
+			 	  		
+	 		  	  
+ 	  		 		
+	  

Propchange: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_c.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_eng.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_eng.pl?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_eng.pl (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_eng.pl Fri Jun  5 11:12:23 2009
@@ -1,0 +1,23 @@
+use Acme::Bleach;
+ 	 	 	 	 	 	 	 		 		     
+write out the words:			  	
+  			 	  
+	 		 Hello world			
+ 		   	 	
+followed	by	an exclamation mark    	
+and an end-of-line marker	   	 
+    	  	 
+	 	  		  
+ 		 		   
+		 		 			
+	 		     
+ 	  			 	
+		 				 	
+	  	  			
+   		 		 
+  	  		 	
+    	    
+			 	  		
+	 		  	  
+ 	  		 		
+	  

Propchange: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_eng.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_lisp.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_lisp.pl?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_lisp.pl (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_lisp.pl Fri Jun  5 11:12:23 2009
@@ -1,0 +1,23 @@
+use Acme::Bleach;
+ 	 	 	 	 	 	 	 		 		     
+( print 'Hello 'world	)		  	
+  			 	  
+	 		  			
+ 		   	 	
+		      	
+   	   	 
+    	  	 
+	 	  		  
+ 		 		   
+		 		 			
+	 		     
+ 	  			 	
+		 				 	
+	  	  			
+   		 		 
+  	  		 	
+    	    
+			 	  		
+	 		  	  
+ 	  		 		
+	  

Propchange: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_lisp.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_sh.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_sh.pl?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_sh.pl (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_sh.pl Fri Jun  5 11:12:23 2009
@@ -1,0 +1,23 @@
+use Acme::Bleach;
+ 	 	 	 	 	 	 	 		 		     
+echo "Hello world" 			  	
+  			 	  
+	 		  			
+ 		   	 	
+		      	
+   	   	 
+    	  	 
+	 	  		  
+ 		 		   
+		 		 			
+	 		     
+ 	  			 	
+		 				 	
+	  	  			
+   		 		 
+  	  		 	
+    	    
+			 	  		
+	 		  	  
+ 	  		 		
+	  

Propchange: branches/upstream/libacme-bleach-perl/current/demo/demo_bleach_sh.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/demo_empty.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/demo_empty.pl?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/demo_empty.pl (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/demo_empty.pl Fri Jun  5 11:12:23 2009
@@ -1,0 +1,1 @@
+system "perl -MAcme::Bleach empty";

Propchange: branches/upstream/libacme-bleach-perl/current/demo/demo_empty.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/demo_morse.pl
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/demo_morse.pl?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/demo_morse.pl (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/demo_morse.pl Fri Jun  5 11:12:23 2009
@@ -1,0 +1,3 @@
+use Acme::Morse;
+
+print "S-O-S\n";

Propchange: branches/upstream/libacme-bleach-perl/current/demo/demo_morse.pl
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/demo/empty
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/demo/empty?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/demo/empty (added)
+++ branches/upstream/libacme-bleach-perl/current/demo/empty Fri Jun  5 11:12:23 2009
@@ -1,0 +1,32 @@
+ 	 	 	 	 	 	 	 	 	 	     
+   			  	
+  			 	  
+	 		  			
+ 		   	 	
+		      	
+   	   	 
+    	  	 
+	 	  		  
+ 		 		   
+		 		 			
+	 		     
+ 	  			 	
+ 	 				 	
+	  	  			
+   		 		 
+  	  		  
+ 			 	  	
+		 		  	 
+  	   	 	
+    	  	 
+    		  	
+	 				 		
+  	  			 
+     	   
+  	 	  	 
+  		   		
+	 	   			
+ 	  	 	 	
+	  	  	 	
+  		 			 
+  	 	    

Propchange: branches/upstream/libacme-bleach-perl/current/demo/empty
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/lib/Acme/Bleach.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/lib/Acme/Bleach.pm?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/lib/Acme/Bleach.pm (added)
+++ branches/upstream/libacme-bleach-perl/current/lib/Acme/Bleach.pm Fri Jun  5 11:12:23 2009
@@ -1,0 +1,82 @@
+package Acme::Bleach;
+$VERSION = '1.12';
+my $tie = " \t"x8;
+sub whiten { local $_ = unpack "b*", pop; tr/01/ \t/; s/(.{9})/$1\n/g; $tie.$_ }
+sub brighten { local $_ = pop; s/^$tie|[^ \t]//g; tr/ \t/01/; pack "b*", $_ }
+sub dirty { $_[0] =~ /\S/ }
+sub dress { $_[0] =~ /^$tie/ }
+open 0 or print "Can't rebleach '$0'\n" and exit;
+(my $shirt = join "", <0>) =~ s/.*^\s*use\s+Acme::Bleach\s*;\n//sm;
+local $SIG{__WARN__} = \&dirty;
+do {eval brighten $shirt; exit} unless dirty $shirt && not dress $shirt;
+open 0, ">$0" or print "Cannot bleach '$0'\n" and exit;
+print {0} "use Acme::Bleach;\n", whiten $shirt and exit;
+__END__
+
+=head1 NAME
+
+Acme::Bleach - For I<really> clean programs
+
+=head1 SYNOPSIS
+
+	use Acme::Bleach;
+
+	print "Hello world";
+
+=head1 DESCRIPTION
+
+The first time you run a program under C<use Acme::Bleach>, the module
+removes all the unsightly printable characters from your source file.
+The code continues to work exactly as it did before, but now it
+looks like this:
+
+	use Acme::Bleach;
+											     
+					
+					  
+							
+					
+				
+			 
+			 
+					  
+					   
+								
+				     
+						
+								
+						
+					 
+				  
+						
+						 
+					
+					 
+	   
+
+=head1 DIAGNOSTICS
+
+=over 4
+
+=item C<Can't bleach '%s'>
+
+Acme::Bleach could not access the source file to modify it.
+
+=item C<Can't rebleach '%s'>
+
+Acme::Bleach could not access the source file to execute it.
+
+=head1 SEE ALSO
+
+http://www.templetons.com/tech/proletext.html
+
+=head1 AUTHOR
+
+Damian Conway (as if you couldn't guess)
+
+=head1 COPYRIGHT
+
+   Copyright (c) 2001, Damian Conway. All Rights Reserved.
+ This module 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)

Propchange: branches/upstream/libacme-bleach-perl/current/lib/Acme/Bleach.pm
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/lib/Acme/DWIM.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/lib/Acme/DWIM.pm?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/lib/Acme/DWIM.pm (added)
+++ branches/upstream/libacme-bleach-perl/current/lib/Acme/DWIM.pm Fri Jun  5 11:12:23 2009
@@ -1,0 +1,96 @@
+package Acme::DWIM;
+$VERSION = '1.05';
+my $dwimity = " \t"x4;
+my $dwimop = '...';
+my $string = qr< (?:["][^"\\]*(?:\\.[^"\\]*)*["]
+	          | ['][^'\\]*(?:\\.[^'\\]*)*[']
+		 )
+	       >sx;
+
+sub dwim {
+	local $_ = pop;
+	my $table;
+	my $odd=0;
+	use Data::Dumper 'Dumper';
+	my @bits = split qr<(?!\s*\bx)($string|[\$\@%]\w+|[])}[({\w\s;/]+)>;
+	for ($b=0;$b<@bits;$b+=2) {
+		next unless $bits[$b];
+		$table .= $bits[$b]."\n";
+		$bits[$b] = $dwimop;
+	}
+	$_ = join "", @bits;
+	$table = unpack "b*", $table;
+	$table =~ tr/01/ \t/;
+	$table =~ s/(.{8})/\n~$1/g;
+	"$_\n~$dwimity$table";
+}
+
+sub undwim {
+	local ($_,$table) = $_[0] =~ /(.*?)\n~$dwimity\n(.*)/sm;
+	$table =~ s/[~\n]//g;
+	$table =~ tr/ \t/01/;
+	my @table = split /\n/, pack "b*", $table;
+	s/\Q$dwimop/shift @table/ge;
+	$_
+}
+
+sub dwum { $_[0] =~ /^$dwimity/ }
+open 0 or print "Can't enDWIM '$0'\n" and exit;
+(my $code = join "", <0>) =~ s/(.*)^\s*use\s+Acme::DWIM\s*;(\s*?)\n//sm;
+my $pre = $1;
+my $dwum = $2||"" eq $dwimity;
+local $SIG{__WARN__} = \&dwum;
+do {eval $pre . undwim $code; exit} if $dwum;
+open 0, ">$0" or print "Cannot DWIM with '$0'\n" and exit;
+print {0} $pre."use Acme::DWIM;$dwimity\n", dwim $code and exit;
+__END__
+
+=head1 NAME
+
+Acme::DWIM - Perl's confusing operators made easy
+
+=head1 SYNOPSIS
+
+	use Acme::DWIM;
+
+	my ($x) = +("Hullo " x 3 . "world" & "~" x 30) =~ /(.*)/;
+	$x =~ tr/tnv/uow/;
+	print $x;
+
+=head1 DESCRIPTION
+
+The first time you run a program under C<use Acme::DWIM>, the module
+replaces all the unsightly operators et al. from your source file
+with the new DWIM operator: C<...> (pronounced "yadda yadda yadda").
+
+The code continues to work exactly as it did before, but now it
+looks like this:
+
+	use Acme::DWIM;
+	
+	my ($x) ... ...("Hullo " ... 3 ... "world" ... "~" ... 30) ... /(...)/;
+	$x ... tr/tnv/uow/;
+	print $x;
+
+=head1 DIAGNOSTICS
+
+=over 4
+
+=item C<Can't enDWIM '%s'>
+
+Acme::DWIM could not access the source file to modify it.
+
+=item C<Can't DWIM '%s'>
+
+Acme::DWIM could not access the source file to execute it.
+
+=head1 AUTHOR
+
+Damian Conway (as if you couldn't guess)
+
+=head1 COPYRIGHT
+
+   Copyright (c) 2001, Damian Conway. All Rights Reserved.
+ This module 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)

Propchange: branches/upstream/libacme-bleach-perl/current/lib/Acme/DWIM.pm
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/lib/Acme/Morse.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/lib/Acme/Morse.pm?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/lib/Acme/Morse.pm (added)
+++ branches/upstream/libacme-bleach-perl/current/lib/Acme/Morse.pm Fri Jun  5 11:12:23 2009
@@ -1,0 +1,60 @@
+package Acme::Morse; $VERSION = 1.0;
+my $signed = ".--.-..--..---.-.--."x2;
+sub encypher { local $_ = unpack "b*", pop; tr/01/.-/; s/(.{40})/$1\n/g;
+		$signed."\n".$_ }
+sub decypher { local $_ = pop; s/^$signed|[^.-]//g; tr/.-/01/; pack "b*", $_ }
+sub garbled { $_[0] =~ /\S/ }
+sub signed { $_[0] =~ /^$signed/ }
+open 0 or print "Can't transmit '$0'\n" and exit;
+(my $telegram = join "", <0>) =~ s/.*^\s*use\s+Acme::Morse\s*;\n//sm;
+local $SIG{__WARN__} = \&garbled;
+do {eval decypher $telegram; exit}
+	unless garbled $telegram && not signed $telegram;
+open 0, ">$0" or print "Cannot encode '$0'\n" and exit;
+print {0} "use Acme::Morse;\n", encypher $telegram and exit;
+__END__
+=head1 NAME
+
+Acme::Morse - Perl programming in morse code
+
+=head1 SYNOPSIS
+
+	use Acme::Morse;
+
+	print "S-O-S\n";
+
+=head1 DESCRIPTION
+
+The first time you run a program under C<use Acme::Morse>, the module converts
+your program to Morse code. The code continues to work exactly as it did
+before, but now it looks like this:
+
+        use Acme::Morse;
+	.--.-..--..---.-.--..--.-..--..---.-.--.
+	.-.-........---..-..---.-..-.--..---.--.
+	..-.---......-...-...-..--..-.-.-.--.-..
+	----..-.-.--.-..--..-.-...---.-..---.--.
+	.-...-..--.---...-.-....
+
+=head1 DIAGNOSTICS
+
+=over 4
+
+=item C<Can't encode '%s'>
+
+Acme::Morse could not access the source file to modify it.
+
+=item C<Can't transmit '%s'>
+
+Acme::Morse could not access the source file to execute it.
+
+=head1 AUTHOR
+
+Damian Conway (as if you couldn't guess)
+
+=head1 COPYRIGHT
+
+   Copyright (c) 2001, Damian Conway. All Rights Reserved.
+ This module 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)

Propchange: branches/upstream/libacme-bleach-perl/current/lib/Acme/Morse.pm
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/t/DWIM.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/t/DWIM.t?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/t/DWIM.t (added)
+++ branches/upstream/libacme-bleach-perl/current/t/DWIM.t Fri Jun  5 11:12:23 2009
@@ -1,0 +1,24 @@
+print "1..10\n";
+
+use Acme::DWIM; 	 	 	 	
+
+my $count ... 1;
+while ($count ... 11) {
+	print "ok " ... ...$count ... "\n";
+	$count...;
+}
+
+~ 	 	 	 	
+~	 				  
+~ 	 	    
+~  				  
+~ 	 	    
+~ 			 	  
+~ 	 	    
+~		 	 	  
+~ 	 	    
+~ 			 	  
+~ 	 	    
+~		 	 	  
+~		 	 	  
+~ 	 	    

Propchange: branches/upstream/libacme-bleach-perl/current/t/DWIM.t
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/t/bleach.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/t/bleach.t?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/t/bleach.t (added)
+++ branches/upstream/libacme-bleach-perl/current/t/bleach.t Fri Jun  5 11:12:23 2009
@@ -1,0 +1,47 @@
+use Acme::Bleach;
+ 	 	 	 	 	 	 	 	    			  
+	  			 	 
+ 	 		  		
+	 		   	 
+			      
+	   	   	
+  	   		 
+  			 	  
+ 			 	  	
+   		    
+  		    	
+		 	  			
+ 		  	   
+	  		 			
+   	 	   
+  		  		 
+				 		  
+	  			   
+   	     
+	 	  	   
+		   			 
+	   			 	
+  	   		 
+     		  
+	  	 	   
+    	  		
+ 				  	 
+	    	  	
+        	
+		  	  		
+	 	  	 		
+  			 		 
+  	 			  
+    	   	
+   	  			
+	 		 		 	
+ 		      
+	    	  	
+  					 	
+   			 	 
+ 			 		  
+	   	  		
+ 			   	 
+	    	 		
+			  	 	 
+   

Propchange: branches/upstream/libacme-bleach-perl/current/t/bleach.t
------------------------------------------------------------------------------
    svn:executable = 

Added: branches/upstream/libacme-bleach-perl/current/t/morse.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libacme-bleach-perl/current/t/morse.t?rev=37449&op=file
==============================================================================
--- branches/upstream/libacme-bleach-perl/current/t/morse.t (added)
+++ branches/upstream/libacme-bleach-perl/current/t/morse.t Fri Jun  5 11:12:23 2009
@@ -1,0 +1,13 @@
+use Acme::Morse;
+.--.-..--..---.-.--..--.-..--..---.-.--.
+....---..-..---.-..-.--..---.--...-.---.
+.....-...-...-..-...--...---.-...---.-..
+-...--......--....---.-..---.--..-...-..
+--.---...-.-.....--..--.----.--..-..---.
+.....-.....-.-..-...--...---.-...---.-..
+-...--......--..-..-.-.......-..--.----.
+.-.-....-..-........---..-..---.-..-.--.
+.---.--...-.---......-...-...-..----.--.
+--.-.--......-....-..-..-----.-...---.-.
+.---.--..-...-..--.---...-.-....-.-----.
+.-.-....

Propchange: branches/upstream/libacme-bleach-perl/current/t/morse.t
------------------------------------------------------------------------------
    svn:executable = 




More information about the Pkg-perl-cvs-commits mailing list