Acme-EyeDrops

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	    LICENSE and README were inconsistent with META.yml
	    all should be consistent now
	- minor code improvements for perl 5.6+ requirement:
	    added "use warnings" to EyeDrops.pm
	    use lexical file handles now
	    can use readline() function now
	- documentation: removed "A Slow Day" section
	- documentation: added new "Victoria Bra, Secret Tango" section
	- new shape: bra
	- new shape: spider
	- 01_mug.t: fixed rt #72163: perl -Mstrict -e 'open$['
	  'Can't use string ("0") as a symbol ref while "strict refs" in use'
	  This seems to be a long-standing perl bug fixed in 5.16
	  Fixed test simply by removing -Mstrict in 01_mug.t
	- 16_astride.t: threads test, adjusted to avoid annoying
	  "Tests out of sequence" failure reports from CPAN testers

1.61	Mon May 20 21:59:42 2013

	- Bug fix release for Perl 5.18.0
	- Tragically, perl 5.18 requires a leading "use re 'eval'"

lib/Acme/EyeDrops.pm  view on Meta::CPAN


    sightly.pl -r 1 -f program_to_be_converted >f.tmp

Apart from reducing the (key-)stroke count, you must avoid regexes
and strive to replace alphanumeric characters with sightly ones,
which do not require sightly encoding.

To illustrate, consider the intriguing problem of creating
I<Buffy looking in the mirror>. Let's start with F<k.pl>:

    open$[;chop,($==y===c)>$-&&($-=$=)for@:=<0>;
    print$"x-(y---c-$-).reverse.$/for@:

Notice that EyeDrops-generated programs, by default, contain no
trailing spaces, which complicates the above program.

Buffy looking in the mirror can now be created with:

    sightly.pl -r 1 -f k.pl -s buffy2 >b.pl
    cat b.pl        (should show Buffy's face)
    perl b.pl       (should show Buffy looking in the mirror)

lib/Acme/EyeDrops.pm  view on Meta::CPAN

            )|+                 (   '/'
           )).                  (   '['
          ^((                  (     '+'
         )))              ).('`'      |((
         '%'          ))).      (     '`'
        |((       '.')           )     ).+
        (((     ((                (     (((
        (((    (                   (    (((
        (((   (                     '\\')))
       )))    )                      ) )  )
       )   )))) ))))))      .'$[;'     .  (
       (  (  ((                        (  (
       (  (      ( (( (     ( (( (     (   (
       (  (       '`')       ))))      )   )
       )   )                        )))    )
       )    )))                     )      )
       )|      (       (   (        (     ((
       '#'      )        )          )    )))
        ).(('`')|                   ('(')).(
        '`'|'/').    ('['^'+')     .',(\\$'
        .'=='.('['     ^'"')     . '==='.+(

t/01_mug.t  view on Meta::CPAN

# $outstr =~ s/^ //mg;
# $outstr =~ s/ +$//mg;
# $outstr =~ s/\n//; chop $outstr;
# $outstr eq $camel_Y_str or print "not ";
# ++$itest; print "ok $itest - 12032 camels Y shape trail\n";

# -------------------------------------------------
# Test Buffy looking in the mirror example.

my $src = <<'END_SRC_STR';
open$[;chop,($==y===c)>$-&&($-=$=)for@:=<0>;
print$"x-(y---c-$-).reverse.$/for@:
END_SRC_STR
$prog = sightly( { Regex         => 1,
                   Compact       => 1,
                   Shape         => 'buffy2',
                   InformHandler => sub {},
                   SourceString  => $src } );
build_file($tmpf, $prog);
my $buffyprogstr = my $buffyprog = $prog;
$buffyprogstr =~ tr/!-~/#/;



( run in 0.464 second using v1.01-cache-2.11-cpan-27979f6cc8f )