Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

There once was a gentleman...

by chargrill (Parson)
on Jan 07, 2007 at 21:03 UTC ( #593432=obfuscated: print w/ replies, xml ) Need Help??

It's been a while...

#!/usr/bin/perl -sire package a;sub used{$_[1]}sub was{$_[-1].=~~reverse($^I).',';;print$_[1 +] }package main;sub his::parsing{' tsuJ'}sub when::hammer{~~reverse$_[1] +} sub oft::he{my($ self,$ he)=@_;my$ c=join'',sort qw(t o n);$ he=~s/(.* +) /\1a${c}h$^I /x&&$he}sub DWIM::nevermore{$_[-1].'P'}sub would::perl{$d += $_[-1].$^I.chr 108}sub whose::jim{$J=$ _[1];$J=~s/(r)(e)/\2\1/g;$J }su +b named::gentleman{$e.=$ _ for qw*a c k*;$_[-1].' h'.$e}sub once::there{ +} there once was a gentleman named jim whose perl would nevermore DWIM he oft used a hammer when parsing his grammar and never the wiser was him
Updated

I wrote this quite a long time ago, but never posted it. While I was cleaning up my homedir, I found it and decided to post it. Then I went out for some errands, thinking about *why* I hadn't gotten around to posting it, and I think the answer was "the limerick isn't that good". So on the drive back, I updated it a little, and above are the results, while the original I posted is here:

#!/usr/bin/perl -sire package a;sub used{$_[1]}sub was{$_[-1].=~~reverse($^I).',';;print $_[1]}package main;sub his::parsing{' tsuJ'}sub when::hammer{~~reverse $_[1]}sub oft::he{my($self,$ he)=@_;my$ c=join'',sort qw(t o n);$ he=~ s/(.*)/\1a${c}h$^I /x&&$he}sub dim::incredibly{$_[-1].'P'}sub was::lig +ht{$d=$_ [-1].$ ^I.chr 108}sub whose::jim{$J=$ _[1];$J=~s/(r)(e)/\2\1/g;$J } su +b named::gentleman{$e.=$ _ for qw*a c k*;$_[-1].' h'.$e}sub once::there{ +} there once was a gentleman named jim whose light was incredibly dim he oft used a hammer when parsing his grammar and never the wiser was him


--chargrill
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

Comment on There once was a gentleman...
Select or Download Code
Re: There once was a gentleman...
by muba (Priest) on Jan 08, 2007 at 03:21 UTC
    woaw... Nice!

    But I don't understand a f*** of what you're doing there.. :)
Re: There once was a gentleman...
by arkturuz (Curate) on Jan 08, 2007 at 11:07 UTC
    Yes, the limerick isn't that good: you forgot 'vim' :-) I suggest a slightly different rhyme sequence:
    there once was a gentleman named jim whose light was incredibly dim he oft used a vim; when parsing his grammar he oft used a hammer and never the wiser was him

      Hi arkturuz,

      Please check the wikipedia entry for Limerick, which is slightly excerpted here:

      A limerick is a five-line poem with a strict meter, popularized by Edward Lear and Charlie Murphy. The rhyme scheme is usually "A-A-B-B-A", with a rather rigid meter. The first, second, and fifth lines are three metrical feet; the third and fourth two metrical feet.

      ... and the page is filled with examples that follow the same form. I've never heard it is "metrical feet" - I've usually heard it referred to as "beats", but the meaning is the same.



      --chargrill
      s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://593432]
Approved by Corion
Front-paged by gmax
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2014-10-31 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (221 votes), past polls