Acme-EyeDrops

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	- improved documentation
	- new functions: get_builtin_shapes, get_eye_shapes
	- extra tests added

0.03	Sun Sep 30 14:07:03 2001

	- fixed die within eval with new TrapEvalDie attribute
	- new test t/nasty.t added to test TrapEvalDie
	- fixed SIG warnings with new TrapWarn attribute
	- improved filler: added $_ to $:
	- changed encoding from octal (%o) to hex (%x)
	  for chars in range 128..255; this reduces binary
	  encoding size
	- minor performance improvements
	- minor shape improvements

0.04	Sun Oct 7 11:31:42 2001

	- minor improvements to documentation
	- new tests t/recur.t and t/limit.t
	- crude test for END block added

Changes  view on Meta::CPAN

1.01	Sun Nov 11 11:10:09 2001

	- new shape from Ryan King: larry2
	- minor improvements to documentation

1.02	Sun Dec 9 17:11:42 2001

	- minor improvements to documentation
	- minor enhancements to demo/sightly.pl
	- left-justified spoon.eye
	- changed parameters to border_shape function
	- new attributes: BorderGapLeft, BorderGapRight etc.
	-                 BorderWidthLeft, BorderWidthRight etc.
	- new attribute: Indent
	- new attribute: Reflect
	- new attribute: FillerVar
	- new shape: merlyn
	- fixed module bug raised by Mark Puttnam
	- added new test program module.t to test Mark's bug

1.03	Sat Dec 15 18:42:09 2001

Changes  view on Meta::CPAN

	- minor fixes to shape: pony, buffy2
	- new shape: london
	- new shape: pony2
	- new shape: eugene
	- new shape: tpr

1.07	Sun Mar 31 15:12:17 2002

	- improved documentation, added Buffy looking in the mirror
	- fixed EyeDrops.pm to work with Perl 5.7.3
	  only needed to change:
	   $src =~ tr#\\[]{}<>^_|~'`#/()()()H-!T""#;
	  to:
	   $src =~ tr#_\\[]{}<>^|~'`#-/()()()H!T""#;
	  due to 'invalid range' H-! error
	- minor change to shapes: damian, camel
	- new shape: kermit (thanks Jason)
	- new shape: pgolf (thanks `/anick)
	- fixed bug where EyeDrops sometimes generated an
	  invalid program or more shapes than it needed to
	- new test: limit2.t to verify above bug fixed
	- new test: sightly2.t
	- made sure test programs clean up all .tmp files
	- added -Mstrict to all test programs to ensure
	  they work with -w and 'use strict' too
	- localised file globals appropriately in all test programs
	- tested under Win98 and adjusted nasty.t accordingly

1.08	Sun Apr 21 16:13:18 2002

	- documentation: added sub-sections to Examples section
	- documentation: added 'Dueling Dingos' sub-section
	- minor change to shape: pgolf
	- new shape: eye
	- new shape: mosquito
	- new shape: coffee
	- new shape: yanick
	- new shape: yanick2
	- new shape: yanick3

1.09	Sun May 19 17:09:12 2002

	- new attributes: Reduce and Expand
	- new attributes: RotateType and RotateFlip
	- new functions: reduce_shape and expand_shape
	- new rtype/flip parameters added to rotate_shape function
	- rotate 90 and 270 now work, no longer squashed
	- added support for new attributes to demo/sightly.pl
	- new test: reshape.t (tests Reduce, Expand, Rotate)
	- new test: camel.t
	- documentation: added 'Thirty Two Camels' sub-section
	- minor change to shape yanick (identical dimensions to camel now)

1.10	Wed May 29 19:08:11 2002

	- new attribute: Compact
	- function pour_sightly: added new compact parameter
	- added support for Compact attribute to demo/sightly.pl
	- test camel.t: enhanced with Compact tests
	- documentation: increased from 'Thirty Two Camels'
	  to 'Twelve Thousand and Thirty Two Camels'
	- documentation: improved 'Buffy Looking in the Mirror'

Changes  view on Meta::CPAN

	- documentation: added 'Somersaulting Camels' section

1.12	Sun Aug 4 14:17:01 2002

	- new shape: llama
	- new shape: parrot
	- new shape: simon
	- new shape: jon
	- new shape: yanick4
	- new shape: tonick
	- documentation: minor changes
	- documentation: added 'Abbreviated History of Perl 6' section

1.13	Sun Sep 15 17:05:09 2002

	- new shape: siertri
	- new shape: undies
	- minor change to shape: simon
	- documentation: minor changes
	- documentation: added 'Sierpinski Triangles' section

1.14	Sun Sep 22 18:42:14 2002

	- converted siertri shape to a built-in (removed siertri.eye)
	- documentation: retracted claim that Mtv's Sierpinski program
	  is the shortest (thankyou Adam and Eugene)
	- documentation: minor changes

1.15	Sun Oct 6 19:31:14 2002

	- new shape: acme
	- code: minor changes
	- documentation: minor changes

1.16	Sun Nov 3 19:31:14 2002

	- new shape: schwern
	- new shape: naw
	- new shape: gelly
	- minor change to shape: acme
	- documentation: minor changes
	- documentation: added 'Naked Arm Wrestling' section

1.17	Sun Dec 8 12:21:04 2002

	- new shape from cam.pm: snow
	- new program to generate table: demo/gentable.pl
	- fixed bug where EyeDrops sometimes generated an
	  invalid program
	- extended limit2.t (test 9) to verify above bug fixed
	- minor code improvements

Changes  view on Meta::CPAN

	- new shape derived from Yanni's Ascii Art collection: candle
	- new shape derived from Yanni's Ascii Art collection: china1
	- new shape derived from Yanni's Ascii Art collection: panda
	- new shape derived from Yanni's Ascii Art collection: santa2
	- minor code improvements

1.19	Sun Jan 5 15:09:04 2003

	- new shape from cam.pm: beer
	- new shape: campm
	- minor change to shape: candle
	- minor change to shape: china1
	- documentation: minor changes
	- minor code improvements

1.20	Sun Jan 12 12:21:55 2003

	- documentation: added 'EyeDropping EyeDrops.pm' section
	- minor code improvements

1.21	Sun Jan 19 14:01:12 2003

	- documentation: minor changes
	- minor code improvements

1.30	Sun Feb 23 17:19:04 2003

	- new function: pour_text
	- new attributes: Text, TextFiller
	- added support for new attributes to demo/sightly.pl
	- new test: text.t
	- documentation: added 'Snowflakes' section
	- minor code improvements

Changes  view on Meta::CPAN


	- There were getting to be too many .eye files cluttering the
	  vitally important Acme root directory, so I moved them from
	  Acme directory to Acme/EyeDrops directory (if you have installed
	  a previous version of Acme::EyeDrops, suggest you delete old
	  .eye files in the Acme root directory)
	- new shape: flag_canada (to mark Canada day, thanks `/anick)
	- new shape: map_australia
	- new shape: hipowls
	- new built-in shape: all
	- minor change to shape: rose
	- removed demo/helloworld.pl from distribution
	- removed demo/hellotest.pl from distribution
	- removed demo/examples.pl from distribution
	- updated test programs to not rely on demo directory

1.41	Sun July 27 18:22:04 2003

	- new shapes: smiley, smiley2, smiley3
	- built-in shape 'all': now supports Width parameter
	- documentation: shortened some examples

Changes  view on Meta::CPAN

	- tests: new long running test 13_to.t
	- documentation: added "Getting Started" section
	- documentation: fixed program in "Naked Arm Wrestling" section
	- documentation: updated 'Abbreviated History of Perl 6' section

1.43	Sun Aug 31 17:12:55 2003

	- new shapes: alpaca, bighorn, map_italy
	- removed functions set_eye_dir, add_builtin_shape, del_builtin_shape
	  which were mistakenly added to version 1.41 (these are not really
	  necessary and change module state, which is a Bad Thing)
	- documentation: added 'twang bra-strap' to acme shape description
	- tests: merged old 13_to.t, old 12_Beer.t to new 19_surrounds.t
	         new Test::Pod test, 18_sky.t
	         11_bold.t now tested in taint mode (no banner test)
	         12_Beer.t now banner test only (not taint safe)

1.44	Sun Apr 25 19:07:41 2004

	- Bug fix release for Perl 5.8.4: some of the tests broke because
	  they were naughtily exploiting a Perl bug re use strict inside
	  (?{...}) constructions in regexps (see 01_mug.t/05_Parrot.t)
	- new shapes: map_world1, map_world2, map_world3, map_japan, map_uk
	- new shapes: music, dan, bottle3
	- Build.PL: fixed for Module::Build v0.24 (_find_file_by_type changed)
	- new attribute: SourceHandle
	- new test: 14_gulp.t tests SourceHandle (and other invalid attributes)
	- minor code improvements (removed $this_dir, check for invalid
	  attrs in sightly(), allow SourceFile/SourceString of '0')
	- documentation: updated stale URL links

1.45	Mon Dec 27 17:15:04 2004

	- new shape: halloween (thanks TheEnigma)
	- new shape: koaladile (thanks Schwern)
	- new shape: saturn
	- renamed function slurp_tfile() to _slurp_tfile()
	- regenerated zgen.t (gen.t changed due to slurp_tfile() change)
	     (regenerated it with: perl -w -I lib t/gen.t generate)
	- pod coverage: documented slurp_yerself()
	- tests: improved the ugly test suite a little
	     new test: 16_astride.t simple threads test
	     new test: 17_Orange.t tests pod coverage
	     split 00_Coffee.t into two (last bit is now 15_Buffy.t)
	     added slurp_yerself() tests to 13_to.t
	     added Regex => 0 tests to 05_Parrot.t
	     exercise regex_binmode_print_sightly() in 05_Parrot.t
	     new tests added to 05_Parrot.t/06_not.t/10_Ponie.t et al

Changes  view on Meta::CPAN

	- documentation: updated 'Abbreviated History of Perl 6' section
	- tests: added new test to 05_Parrot.t
	- Build.PL: simplified for Module::Build 0.26 and above
	- Temporarily renamed Build.PL to xBuild.PL to stop CPAN tester
	  robots from using Build.PL (got a lot of unexplained failures
	  with v1.46, yet they worked fine when installed manually)

1.50	Sat August 6 23:08:42 2005

	- First attempt at "shape properties" -- note that these
	  are experimental and subject to change in future releases
	- Added new .eyp (properties) files for all .eye shapes
	- new functions: get_eye_properties
	                 find_eye_shapes
	                 get_eye_keywords
	- new internal functions: _get_properties
	                          _get_eye_shapes
	                          _get_eye_string
	                          _get_eye_properties
	                          _find_eye_shapes
	                          _get_eye_keywords

Changes  view on Meta::CPAN

	  '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'"
	  if you embed the program in a regex. To appease this change
	  in behavior, the Regex attribute now supports three different
	  "true" values:
	   1: add a leading "use re 'eval';" for Perl 5.18+ only
	   2: do not add a leading "use re 'eval';"
	   3: add a leading "use re 'eval';"
	- Updated test suite to work with new Regex attribute
	- Updated sightly.pl to work with new Regex attribute

1.62	Sun Apr 12 17:12:42 2015

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

   return @ret;
}

sub get_eye_shapes     { _get_eye_shapes(get_eye_dir()) }
sub get_eye_string     { _get_eye_string(get_eye_dir(), shift) }
sub get_eye_properties { _get_eye_properties(get_eye_dir(), shift) }
sub get_eye_keywords   { _get_eye_keywords(get_eye_dir()) }
sub find_eye_shapes    { _find_eye_shapes(get_eye_dir(), @_) }

# $eye_dir is the directory containing the .eye file shapes.
# Note: $eye_dir is only eval-hostile line in EyeDrops.pm; do not change it
# for t/19_surrounds.t and "EyeDropping EyeDrops.pm" section of doco relies
# on it. Remove ".pm" from "...Acme/EyeDrops.pm" giving directory name.
my $eye_dir = __FILE__; chop($eye_dir);chop($eye_dir);chop($eye_dir);

sub slurp_yerself { _slurp_tfile($eye_dir . '.pm') }

sub get_eye_dir { $eye_dir }

1;

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

    $/ = undef;
    $x = <0>;
    close 0;
    $x =~ tr/!-~/#/;
    print $x;
    FLAMING_OSTRICHES
    print sightly( { Shape         => 'japh',
                     SourceString  => $src,
                     Regex         => 1 } );

This works. However, if we change:

    $x =~ tr/!-~/#/;

to:

    $x =~ s/\S/#/g;

the generated program malfunctions in strange ways because
it is running inside a regular expression and Perl's regex engine
is not reentrant. In this case, we must resort to:

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

You can produce a program that emits his moving poem like this:

    print sightly( { Shape        => 'yanick3',
                     Regex        => 1,
                     Print        => 1,
                     SourceString => <<'END_DINGO' } );
    #!/usr/bin/perl
    # Dueling Dingos v1.1, by Yanick Champoux (9/4/2002)
    #
    # Inspired by the TPR(0,2) Perl Golf contest.
    # Name haven't been changed, since the involved
    # parties could hardly be labelled as 'innocent',
    # and are way far too gone to protect anyway.
    wait until localtime > @April[0];  # wait until the first of April
    BEGIN{}
    study and seek FOR, $some, $inspiration;
    write $stuff;
    $score = 145; # no good;
    delete $stuff { I_can_do_without }
       and do $more_stuff;
    delete $even{more_stuff};

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

Instead of using the API, as shown above, you may also use
the F<findshapes.pl> command in the F<demo> directory:

    findshapes.pl -h           (for help)
    findshapes.pl -v face person perlhacker

The last example displays the faces and properties of all
perl hackers.

Please note that these shape properties are experimental and
may change in future A::E releases.

=head1 BUGS

A really diabolical shape with lots of single character lines
will defeat the shape-pouring algorithm.

You can eliminate all alphanumerics (via Regex => 1) only if the
program to be converted is careful with its use of regular
expressions and C<$_>.
To convert complex programs, you must use Regex => 0, which

t/09_Gallop.t  view on Meta::CPAN


unlink($tmpf) or die "error: unlink '$tmpf': $!";

# --------------------------------------------------
# Original Perl bug report #23143 follows:
# The following program works under Perl 5.8.0 but fails under
# 5.8.1 with the error: "panic: pad_free curpad".
#
# ''=~m<(?{eval'print 4;$_=9'})>;($_)=9;
#
# If you change it to:
#
# ''=~m<(?{eval'print 4;$_=9'})>;$_=9;
#
# it works fine. Take out the eval:
#
# ''=~m<(?{print 4;$_=9})>;($_)=9;
#
# and it fails with "Modification of a read-only value attempted"
# on all Perl versions that I tested on. However, Perl 5.8.1
# then goes on to further fail with: "panic: pad_free curpad".



( run in 0.707 second using v1.01-cache-2.11-cpan-5dc5da66d9d )