perlmeditation
cog
So yesterday I gave a talk on Acme modules.
<p>20 minutes.
<p>60 modules.
<p><a target="_blank" href="http://jose-castro.org/talks/yapcna2006/acme_modules/start.html">Here are my slides</a> (new window), and here is the content of that talk:
<readmore>
<hr />
<p>1 - [cpan://Acme::ProgressBar], by Ricardo Signes
<p>A simple progress bar for the patient
<p><code> use Acme::ProgressBar;
progress { sleep 5; }</code>
<hr />
<p>2 - [cpan://Acme::Apache::Werewolf], by Rich Bowen
<p>Keeps werewolves out of a directory during the full moon
<p><code> <Directory /fullmoon>
PerlAccessHandler Acme::Apache::Werewolf
PerlSetVar MoonLength 4
</Directory></code>
<hr />
<p>3 - [cpan://Acme::Current], by Jesse Vincent
<p>Determine current year, month, day (GMT)
<p><code> use Acme::Current;
printf "It's now %04d/%02d/%02d.\n",
$Acme::Current::YEAR,
$Acme::Current::MONTH,
$Acme::Current::DAY;</code>
<p>"as long as all you want is the current date (GMT-based), and you keep the module up to date."
<hr />
<p>4 - [cpan://Acme::Time::Baby], by Abigail
<p>Tell time little children can understand
<p><code> use Acme::Time::Baby;
print babytime;</code>
<p>Prints "The big hand is on the five and the little hand is on the four"
<hr />
<p>5 - [cpan://Acme::No], by Geoffrey Young
<p>Makes no() work the way I want it to
<p><code> use 5.6; # I use our(), so 5.6 is required
no 6.0; # but this was coded for perl 5, not perl 6
# and the perl 6 compat layer isn't really 5.6
# so my code breaks under 6.0
use mod_perl 1.27; # we need at least version 1.27
no mod_perl 2.0; # but mod_perl 2.0 is entirely different than 1.0
# so keep my cpan email to a minimum</code>
<p>FEATURES/BUGS: "probably lots"
<hr />
<p>6 - [cpan://Acme::MetaSyntactic], by Philippe "Book" Bruhat
<p>Themed metasyntactic variables names
<p><code> use Acme::MetaSyntactic; # loads the default theme
print metaname();</code>
<p>THEMES!
<p>batman: zowie, klonk, zlonk
<p>buffy: Buffy, Cordelia, Darla
<p>TONS OF THEMES: alphabet amber antlers any apollo barbapapa barbarella batman booze browser buffy chess colors colours constellations contrade counting_rhyme crypto currency dancers debian dilbert discworld donmartin dwarves elements facecards flintstones foo garbage garfield gems groo haddock hhgg jamesbond jerkcity loremipsum lotr magic8ball magicroundabout monty_spam norse_mythology octothorpe opcodes oulipo pantagruel pasta peanuts pgpfone phonetic planets pm_groups pokemon pooh pop2 pop3 pornstars pumpkings punctuation pynchon python quantum robin roman scooby_doo services shadok simpsons smtp sql stars teletubbies tld tmnt toto trigan unicode us_presidents userfriendly viclones weekdays yapc
<hr />
<p>7 - [cpan://Acme::NumericMethod], by gugod
<p>"I know numeric methods"
<p><code> use Acme::NumericMethod;
print one(); # 1</code>
<hr />
<p>8 - [cpan://Acme::CreatingCPANModules], by COG
<p>Created during a talk in London
<p>Read the documentation and the code
<hr />
<p>9 - [cpan://Acme::Comment], by Jos Boumans
<p>Several different commenting styles
<p><code> use Acme::Comment type => 'C++', own_line => 1;
/*
if (ref $mod) {
$bar->{do}->blat(msg => 'blarg');
eval {
i'm sooo sick of this time for some coffee
*/
// I prefer beer. --sqrn</code>
<hr />
<p>10 - [cpan://Acme::PM::Chicago], by Andy Lester
<p>Functions useful for the Chicago.pm group
<p><code> random_name</code>
<hr />
<p>11 - [cpan://Acme::AutoColor], by Robert Rothenberg
<p>Automatic color names
<p><code> use Acme::AutoColor;
$red = RED(); # 'ff0000'
@green = GREEN(); # (0, 255, 0)</code>
<hr />
<p>12 - [cpan://ACME::Error::SHOUT], by Casey West
<p>ACME::Error Backend to Scream Errors
<p><code> use ACME::Error SHOUT;</code>
<hr />
<p>13 - [cpan://Acme::PerlTidy], by XERN
<p>Clean code every time
<p><code> use Acme::PerlTidy;
# your code here.</code>
<hr />
<p>14 - [cpan://Acme::Landmine], by David Nicol
<p>Variables that explode
<p><code> use Acme::landmine; # crucial, this line
tie $scalar, "Acme::landmine" => "first use of \$scalar";</code>
<p>"useful for locating the first use of a variable after a checkpoint, while debugging."
<hr />
<p>15 - [cpan://Acme::Colour], by Leon Brocard
<p>Additive and subtractive human-readable colours
<p><code> $c = Acme::Colour->new("black");
$colour = $c->colour; # black
$c->add("red");
$c->add("green");
$colour = $c->colour; # yellow</code>
<hr />
<p>16 - [cpan://Acme::Octarine], by Nicholas Clark
<p>Provides Octarine support for Acme::Colour
<p><code> use Acme::Octarine;
$c = Acme::Colour->new("octarine");</code>
<p>WARNING: may leak magic
<hr />
<p>17 - [cpan://Acme::Orange], by Nicholas Clark
<p>Like Acme::Colour but only for important colours
<p><code> $c = Acme::Orange->new();
$colour = $c->colour; # orange
$c->add("orange"); # $c->colour still orange
$c->add("blue"); # $c->colour still orange
$c = Acme::Orange->new("pink");
$colour = $c->colour; # orange.</code>
<hr />
<p>18 - [cpan://Acme::Spider], by Marty Pauley
<p>Frighten some other modules
<p><code> use Acme::Spider;</code>
<p>"Damian Conway is afraid of spiders, and all his code is afraid of this spider."
<p>"As the spider evolves, it will become better at recognising Damian's modules."
<hr />
<p>19 - [cpan://Acme::LAUTER::DEUTSCHER], by Ian Langworth
<p>Make your program's output indistinguishable from someone yelling German
<p><code> use Acme::LAUTER::DEUTSCHER;
print "Timmy pet the cute puppy.\n";</code>
<p>Produces the following output:
<p><code> DIETER HAUSTIER DER NETTE WELPE!</code>
<hr />
<p>20 - [cpan://Acme::Bleach], by Damian Conway
<p>For really clean programs
<p><code> use Acme::Bleach;
print "Hello world";</code>
<p>"the module removes all the unsightly printable characters from your source file."
<p><code> use Acme::Bleach;</code>
<hr />
<p>21 - [cpan://Acme::Morse], by Damian Conway
<p>Perl programming in morse code
<p><code> use Acme::Morse;
print "S-O-S\n";</code>
<p>Code turns into:
<p><code> use Acme::Morse;
.--.-..--..---.-.--..--.-..--..---.-.--.
.-.-........---..-..---.-..-.--..---.--.
..-.---......-...-...-..--..-.-.-.--.-..
----..-.-.--.-..--..-.-...---.-..---.--.
.-...-..--.---...-.-....</code>
<hr />
<p>22 - [cpan://Acme::Buffy], by Leon Brocard
<p>An encoding scheme for Buffy the Vampire Slayer fans
<p><code> use Acme::Buffy;
print "Hello world";</code>
<p>Code turns into:
<p><code> use Acme::Buffy;
BUffY bUFFY BUffY bUFFY bUfFy buffy BUFfy buFFY BufFy BufFY bUFfy BuFFY buffy bufFy bUffy bUffY BuFfy BuffY bUFfy BUfFY BUFFy Buffy bUffY
BuFFY BUFFy BufFy BUFfy BUfFY buFfy BuffY BuFfy BUfFY bUffy buFFy BUffy bUffy </code>
<hr />
<p>23 - [cpan://Acme::Pony], by David Cantrell
<p>An encoding scheme for Silly People
<p><code> use Acme::Pony;
print "Hello world";</code>
<p>Code turns into:
<p><code> use Acme::Pony;
b U
fFybuf
fybuFFYbuF
fyBUFfYbuFf
YBufFYBuFFybu
FfYBUffybufFyb
uFfybUffybUffyBu
FfyBuFFybuFfyB
UffYBUfFYbUFF yb
UffybUfFYBuffyb uFfy
buFfYBUffybUfFYbUffYbUF fyBUFfY
BuFFyBuFFybuffyBufFybufFYbuFFYbUFfYbuF
FYBu FFYBuFFybUFFyBUfFyBufFYbuffybUffYBUf
FYBu FFYBuFFyBuFfYBUffyBUfFYbufFybUFfybu
ffYb ufFybUFFyBuFfYBUffYBUfFYbuffybUff
yb UfFYBuffyBuFFyBufFyBUfFYbuFFYb
uFFYb UffyBUFfYbufFYBuF
fybU ffyBufFYbUFFybu
FfYb uffyBu FfybuF
FYBU fFyBUFF YbUfF
yBu ffY buF FYbuF
fyb Uff yBu FFY
BUf FyB
UFF YbU
fXXX XX </code>
<hr />
<p>24 - [cpan://Acme::EyeDrops], by Andrew J. Savige
<p>Visual Programming in Perl
<p><code> use Acme::EyeDrops qw(sightly);
print sightly( { Shape => 'camel',
SourceFile => 'eyesore.pl' } );</code>
<p>And the result is something like:
<p><code> .('`'^'/').('['^
')').('`'|'!').('`'|'.'
).('`'|"'").('`'|'%').('{'^'['
).''. ('['
^'(' ).(
'`'| '+'
).+( ( '['
)^(( ( '"'
)))) .( ( '{'
)^(( ( ( '['
))) )) .( '['
^(( (( ( '('
))) ))). ( '['
^(( '.') ) ).(
'[' ^')' ) .+(
'[' ^(')')).( ( '`'
)|+ (( ( ((
'/' )) ) ))
).( ( ( ((
'[' ) )))^+
'.' ) .(
'`' | '.').('`'|'$').('['^'(').('!'^('+')).(
'!' ^'+').("\`"^ "\,").( ( ( "\`"))| (
'!' ) ) .+( '`' |+ ( ( (( '-' ))) )
).( ( ( '`'))|'"').( ( ( '`'))|'$').( (
'`' ) | ( ( (
(( '!' ) ) ) )) )
.( ( '{')^ ( ( (( (
(( ( ( ( ( ( (
(( ( '[' ))))))))))))))) ) ).('`'|'(').
+( ( ( ( (
( ( ( ( (
( ( ( '[' ) )
) ))) )) )
) ) )^'.').('`'|"'").('[' ^
( ( '('))).('{'^'[').(('`')| (
( ( '#')))).('`'|'!').('`'|'-' )
. ( "\`"| '%').('`'|',') .''. (
( ( '!') ) ^ '+' )
.( '{' ^'+').('['^')'). (((
( (
( (
( (
( ( (
( ( (
( ( (
( ( (
( ( ( (
( ( ( (
( '`' )) )
) ))))))))))) )</code>
<hr />
<p>25 - [cpan://Acme::PerlML], by Adam Kennedy
<p>Replaces your ugly Perl code with powerful XML
<p><code> use Acme::PerlML;
print "Hello World!\n";</code>
<hr />
<p>26 - [cpan://Acme::Palindrome], by Casey West
<p>Programs are the same backward and forward
<p><code> use Acme::Palindrome;
print "Hello world";</code>
<p>Code turns into:
<p><code> use Acme::Palindrome;
;"dlrow olleH" tnirp</code>
<hr />
<p>27 - [cpan://Acme::Python], by Cal Henderson
<p>For real python programs
<p><code> use Acme::Python;
print "Hello world\n";</code>
<p>Code turns into:
<p><code> use Acme::Python;
Hisssssssssssssssss
hiss Hiss hiss Hiss hisssssssss Hissss hisss
Hiss hisss Hissss hiss Hiss hisss Hiss hiss
Hisss hisss Hissss hiss Hisss hissss Hiss
hiss Hissss hisssssss Hiss hissss Hiss hissss
Hiss hissssss Hiss hisss Hiss hiss Hiss hiss
Hiss hisss Hisss hissss Hisss hiss Hisss
hissss Hisss hiss Hisss hiss Hisssss hiss
Hisss hisssssss Hiss hisss Hissss hiss Hiss
hiss Hiss hiss Hisssss hiss Hisss hisss Hiss
hisss Hissss hissss Hisss hiss Hisss hissss
Hiss hisss Hisss hissss Hissss hiss Hiss
hisss Hissss hiss Hisss hisss Hiss hissss
Hiss hisss Hisss hiss Hissss hisss</code>
<hr />
<p>28 - [cpan://Acme::Bleach::Numerically], by Dan Kogai
<p>Fit the whole world between 0 and 1
<p><code> use Acme::Bleach::Numerically;
print "Hello, world!\n";</code>
<p>Code turns into:
<p>
<code>
0.040778303852178956119551602125129291960167762814318190165254157403572768476855468306741486362866306881765123855877461571539938322699699451080656345651468548168013171301649578148215912162725962627775499299071062393206627364983211475897421395553354983576355152763426303863525390625
</code>
<hr />
<p>29 - [cpan://Acme::DoubleHelix], by XERN
<p>Double-helix programming
<p><code> use Acme::DoubleHelix;
print "Hello";</code>
<p>Code turns into:
<p><code> CG
T--A
A---T
A----T
C----G
T----A
A---T
G--C
AT
CG
C--G
G---C
G----C
C----G
A----T
C---G
G--C
TA
CG
C--G
A---T
A----T
A----T
A----T
T---A
G--C
CG
AT
T--A
G---C
G----C
C----G
C----G
G---C
C--G
TA
CG
G--C
A---T
G----C
T----A
G----C
A---T
A--T
CG
AT
C--G
A---T
C----G
A----T
G----C
A---T
A--T
GC
CG
A--T
T---A
G----C
G----C
G----C
C---G
G--C
AT
AT
C--G
A---T
G----C
C----G
T----A
G---C
T--A
TA
CG
G--C
G---C
G----C
T----A
G----C
A---T
A--T
CG
AT
A--T
G---C
T----A
G----C
C----G
A---T
T--A
GC
GC
C--G
T---A
G----C
G----C
C----G
C---G
G--C
CG
TA
C--G
G---C
T----A
G----C
C----G
G---C
A--T
AT
CG
A--T
A---T
G----C
T----A
G----C
T---A
T--A
CG
GC
A--T
A---T
C----G
A----T
C----G
A---T
C--G
GC
CG
A--T
T---A
G----C
G----C
G----C
C---G
G--C
GC
AT
C--G
G---C
T----A
C----G
C----G
G---C
A--T
AT
CG
A--T
G---C
A----T
C----G
G----C
A---T
T--A
CG
GC
A--T
T---A
C----G
G----C
A----T
A---T
C--G
AT
AT
G--C
T---A
G----C
A----T
C----G
C---G
G--C
GC
CG
C--G
G---C
T----A
A----T
T----A
G---C
T--A
TA
TA
A--T
C---G
A----T
C----G
A----T
T---A
C--G
TA
AT
C--G
C---G
A----T
A----T</code>
<hr />
<p>30 - [cpan://Acme::Smirch], by Jasvir Nagra
<p>For really dirty programs
<p><code> use Smirch;
Smirch::smear("tooClean.pl");</code>
<p>Result is something like:
<p><code> $==$';
$;||$.| $|;$_
='*$ ( ^@(%_+&~~;# ~~/.~~
;_);;.);;#) ;~~~~;_,.~~,.* +,./|~
~;_);@-, .;.); ~ ~,./@@-__);@-);~~,.*+,.
/|);;;~~@-~~~~;;(),. ;.,./@,./@,.;_~~@-););,.
;_);~~,./@,.;;;./@,./ |~~~~;#-(@-__@-__&$#%^';$__
='`'&'&';$___="````" |"$[`$["|'`%",';$~=("$___$__-$[``$__"|
"$___"| ("$___$__-$[.%")).("'`"|"'$["|"'#").
'/.*?&([^&]*)&.*/$'.++$=.("/``"|"/$[`"|"/#'").(";`/[\\`\\`$__]//`;"
|";$[/[\\$[\\`$__]//`;"|";#/[\\\$\\.$__]//'").'@:=("@-","/.",
"~~",";#",";;",";.",",.",");","()","*+","__","-(","/@",".%","/|",
";_");@:{@:}=$%..$#:;'.('`'|"$["|'#')."/(..)(..)/".("```"|"``$["|
'#("').'(($:{$'.$=.'}<<'.(++$=+$=).')|($:{$'.$=.'}))/'.("```;"|
"``$[;"|"%'#;").("````'$__"|"%$[``"|"%&!,").${$[};`$~$__>&$=`;$_=
'*$(^@(%_+&@-__~~;#~~@-;.;;,.(),./.,./|,.-();;#~~@-);;;,.;_~~@-,./.,
./@,./@~~@-);;;,.(),.;.~~@-,.,.,.;_,./@,.-();;#~~@-,.;_,./|~~@-,.
,.);););@-@-__~~;#~~@-,.,.,.;_);~~~~@-);;;,.(),.*+);;# ~~@-,
./|,.*+,.,.);;;);*+~~@-,.*+,.;;,.;.,./.~~@-,.,.,.;_) ;~~~
~@-,.;;,.;.,./@,./.);*+,.;.,.;;@-__~~;#~~@-,.;;,.* +);;
#);@-,./@,./.);*+~~@-~~.%~~.%~~@-;;__,. /.);;#@- __@-
__ ~~;;);/@;#.%;#/.;#-(@-__~~;;;.;_ ;#.%~~~~ ;;()
,.;.,./@,. /@,.;_~~@- ););,.;_ );~~,./ @,.
;;;./@,./| ~~~~;#-(@- __,.,.,. ;_);~~~ ~@
-~~());; #);@-,./@, .*+);;; ~~@-~~
);~~);~~ *+~~@-);-( ~~@-@-_ _~~@-
~~@-);; #,./@,.;., .;.);@ -~~@-;
#/.;#-( ~~@-@-__ ~~@-~~ @-);@
-);~~, .*+,./ |);;;~ ~@-~~
;;;.; _~~@-@ -__);. %;#-(
@-__@ -__~~;# ~~@-;; ;#,.
;_,.. %);@-,./@, .*+,
..%, .;.,./|) ;;;)
;;#~ ~@-,.*+,. ,.~~
@-); *+,.;_);;.~ ~););
~~,.; .~~@-);~~,.;., ./.,.;
;,.*+ ,./|,.); ~~@- );;;,.(
),.*+); ;#~~/|@-
__~~;#~~ $';$;;</code>
<hr />
<p>31 - [cpan://Acme::BadExample], by Adam Kennedy
<p>Perl document, yes. Perl code, no damn way!
<hr />
<p>32 - [cpan://Acme::Everything], by Adam Kennedy
<p>Effectively loads every class in CPAN
<p><code> use Acme::Everything;
Any::Module->any_method;</code>
<hr />
<p>33 - [cpan://Acme::AsciiArt2HtmlTable], by COG
<hr />
<p>34 - [cpan://Acme::Lingua::NIGERIAN], by Jörg Walter
<p>WRITE PERL CODE IN NIGERIAN SPAM
<p><code> #!/usr/bin/perl
use Acme::Lingua::NIGERIAN;
DEAR SIR,
I AM THE SON OF LATE PRESIDENT ONE-OR-THE-OTHER OF NIGERIA.
TRANSFER_DISCREETLY SWISS_BANK_ACCOUNT "H!!!ELLO N!!!IGERIA\N";
TRANSFER_DISCREETLY SWISS_BANK_ACCOUNT US$17 MILLION, "\N";
TRANSFER_DISCREETLY SWISS_BANK_ACCOUNT US$17 MILLION + 25, "\N";</code>
<p>Copyright and License
<p><code> THIS MODULE MAY BE MASS-EMAILED UNDER THE SAME TERMS AS PERL ITSELF.</code>
<hr />
<p>35 - [cpan://Acme::Scurvy::Whoreson::BilgeRat], by David Cantrell
<p>Multi-lingual insult generator
<p><code> use Acme::Scurvy::Whoreson::BilgeRat;
my $insultgenerator = Acme::Scurvy::Whoreson::BilgeRat->new(
language => 'pirate'
);
print $insultgenerator; # prints a piratical insult</code>
<hr />
<p>36 - [cpan://Acme::Scripticide], by Daniel Muey
<p>allow your script to kill itself
<p><code> use Acme::Scripticide qw(good_bye_cruel_world);
if(i_take_medication_and_therapy()) {
print "Take that Tom Cruise, you wacky weirdo, tell Jackson howdy.";
}
else {
good_bye_cruel_world();
}</code>
<hr />
<p>37 - [cpan://Acme::Scriptophrenic], by Daniel Muey
<p>Create scripts that randomly change personality
<p><code> use Acme::ScriptoPhrenic;
path/to/script.pl
path/to/another_script.pl
path/to/you/guessed/it/another/script.pl</code>
<hr />
<p>38 - [cpan://Acme::JAPH], by Casey West
<p>Turn anything into a JAPH
<p><code> use Acme::JAPH
a;ltiucqpoc3iqp04tu1 -394t8[ieufea[=09E U 0ET 9u [4tu]]]</code>
<hr />
<p>39 - [cpan://Acme::MJD], by D.H.
<p>Mark Jason Dominus does perl
<p><code> use Acme::MJD;
print "Hello world";</code>
<p>Code turns into:
<p><code> use Acme::MJD;
Read. Learn. Evolve.
-- Mark Jason Dominus</code>
<hr />
<p>40 - [cpan://Acme::DeepThoughts], by D.H.
<p>Jack Handey does perl
<p><code> use Acme::DeepThoughts;
print "Hello world";</code>
<p>Code turns into:
<p><code> use Acme::DeepThoughts
To us, it might look like just a rag. But to the brave, embattled men
of the fort, it was more than that. It was a flag of surrender. And
after that, it was torn up and used for shoe-shine rags, so the men
would look nice for the surrender.
-- Jack Handey</code>
<hr />
<p>41 - [cpan://Acme::Bushisms], by Michael Accardo
<p>Dubya Does Perl
<p><code> use Acme::Bushisms;
print "Hello world";</code>
<p>Code turns into:
<p><code> use Acme::Bushisms;
"Families is where our nation finds hope, where wings take dream."
--George W Bush, LaCrosse, Wis., Oct. 18, 2000</code>
<hr />
<p>42 - [cpan://Acme::PreReq::A], by Michael Schilli
<p>Module for testing CPAN module prerequisites
<p><code> use Acme::Prereq::A;</code>
<hr />
<p>43 - [cpan://Acme::PreReq::B], by Michael Schilli
<p>Module for testing CPAN module prerequisites
<p><code> use Acme::Prereq::B;</code>
<hr />
<p>44 - [cpan://Acme::MorningMusume], by Kentaro Kuribayashi
<p>All about the Japanese pop star "Morning Musume"
<p><code> use Acme::MorningMusume;
my $musume = Acme::MorningMusume->new;
# retrieve the members on their activities
my @members = $musume->members; # retrieve all
my @active_members = $musume->members('active');
my @graduate_members = $musume->members('graduate');
my @at_some_time_members = $musume->members(Date::Simple->new('2001-01-01'));</code>
<hr />
<p>45 - [cpan://Acme::Playmate], by Olle de Zwart
<p>Consult the playboy playmate directory for playmate information.
<p><code> use Acme::Playmate;
my $playmate = new Acme::Playmate("2003", "04");
print "Details for playmate " . $playmate->{ "Name" } . "\n";
print "Birthdate" . $playmate->{ "BirthDate" } . "\n";
print "Birthplace" . $playmate->{ "BirthPlace" } . "\n";
print "Bust" . $playmate->{ "Bust" } . "\n";
print "Waist" . $playmate->{ "Waist" } . "\n";
print "Hips" . $playmate->{ "Hips" } . "\n";
print "Height" . $playmate->{ "Height" } . "\n";
print "Weight" . $playmate->{ "Weight" } . "\n";</code>
<hr />
<p>46 - [cpan://Acme::Your], by Richard Clamp
<p>Not our variables, your variables
<p><code> use Data::Dumper;
use Acme::Your "Data::Dumper";
your $Varname; # This is really $Data::Dumper::Varname
print "The default variable name for DD is $Varname";</code>
<hr />
<p>47 - [cpan://Acme::ButFirst], by Paul Jamieson Fenwick
<p>Do something, but first do something else.
<p><code> use Acme::ButFirst;
# Print a greeting, but first find caffiene.
{
print "Good morning!\n";
} but first {
print "I need a coffee\n";
}</code>
<hr />
<p>48 - [cpan://Acme::Don't], by Damian Conway
<p>The opposite of do
<p><code> use Acme::Don't;
don't { print "This won't be printed\n" };</code>
<hr />
<p>49 - [cpan://Acme::Dot], by Curtis "Ovid" POE
<p>Call methods with the dot operator
<p><code> package Foo;
use Acme::Dot;
sub new { bless {}, shift }
sub hello { print "Hi there! (@_)\n" }
package main;
my $x = new Foo;
$x.hello(1,2,3); # Calls the method</code>
<hr />
<p>50 - [cpan://Acme::Damn], by Ian Brayshaw
<p>'Unbless' Perl objects.
<p><code> use Acme::Damn;
my $ref = ... some reference ...
my $obj = bless $ref , 'Some::Class';
... do something with your object ...
$ref = damn $obj; # recover the original reference (unblessed)
... neither $ref nor $obj are Some::Class objects ...</code>
<hr />
<p>51 - [cpan://Acme::Holy], by Ian Brayshaw
<p>Test whether references are blessed.
<p><code> use Acme::Holy;
my $ref = ... some reference ...
my $obj = bless $ref , 'Some::Class';
print holy( $obj ); # prints 'Some::Class'
print ( holy [] ? 'object' : 'not object' ); # prints 'not object'</code>
<hr />
<p>52 - [cpan://Acme::Currency], by Steffen Müller
<p>There are other currencies beside $$$
<p><code> use Acme::Currency '¥';
¥money = '¥1.12';
@time = ( ¥money, ¥and_I_mean_it );</code>
<hr />
<p>53 - [cpan://Acme::ComeFrom], by Audrey
<p>Parallel goto-in-reverse
<p><code> use Acme::ComeFrom;
sub func { print "@_" }; func("start\n");
print "won't happen\n";
comefrom &func; print "branch 1\n"; exit;
comefrom &func; print "branch 2\n";
label: print "won't happen either\n";
comefrom label; print "branch 2.1\n"; exit;
comefrom label; print "branch 2.2\n";
expr0: print "to be\n"; exit;
comefrom "expr".int(rand(2)); print "not to be\n";</code>
<hr />
<p>54 - [cpan://Acme::DWIM], by Damian Conway
<p>Perl's confusing operators made easy
<p><code> use Acme::DWIM;
my ($x) = +("Hullo " x 3 . "world" & "~" x 30) =~ /(.*)/;
$x =~ tr/tnv/uow/;
print $x;</code>
<p>Code turns into:
<p><code> use Acme::DWIM;
my ($x) ... ...("Hullo " ... 3 ... "world" ... "~" ... 30) ... /(...)/;
$x ... tr/tnv/uow/;
print $x;</code>
<hr />
<p>55 - [cpan://Acme::Pythonic], by Xavier Noria
<p>Python whitespace conventions for Perl
<p><code> use Acme::Pythonic; # this semicolon yet needed
sub delete_edges:
my $G = shift
while my ($u, $v) = splice(@_, 0, 2):
if defined $v:
$G->delete_edge($u, $v)
else:
my @e = $G->edges($u)
while ($u, $v) = splice(@e, 0, 2):
$G->delete_edge($u, $v)</code>
<hr />
<p>56 - [cpan://Acme::MethodCaseInsensitive], by Malte Ubl
<p>Case insensitive method invocation
<p><code> use Acme::Method::CaseInsensitive;
package Class;
sub foo_bar {
print "it works"
}
Class->FoO_bAR;</code>
<hr />
<p>57 - [cpan://Acme::Goto::Line], by Arthur Bergman
<p>Goto with line number
<p><code> use Acme::Goto::Line;
print "This is a loop\n";
goto(2);</code>
<hr />
<p>58 - [cpan://Acme::VerySign], by Mark Fowler
<p>make unused subroutines useful
<p><code> use Acme::VerySign;
sub hello { "Hello World" }
print helo();
print "Did you mean: $_ ?" foreach @{ helo() }
helo()->buy();
print helo();</code>
<hr />
<p>59 - [cpan://Acme::Code::Police], by Curtis "Ovid" POE
<p>Enforce rigorous coding standards
<p><code> #!/usr/bin/perl
use Acme::Code::Police;</code>
<p>Provide this module to programmers who fail to use strict and most of their coding errors will be instantly eliminated.
<hr />
<p>60 - [cpan://Acme::Code::FreedomFighter], by Greg McCarroll
<p>Defends our right to code in any style waiting for the right moment to strike back at the evil oppressors.
<p><code> #!/usr/bin/perl
use Acme::Code::FreedomFighter;
use Acme::Code::Police;</code>
</readmore><p><small>20060703 Janitored by [id://5348]: Added newline into CODE tag to enable wrapping</small></p>