Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Enter Camel

by Amoe (Friar)
on Apr 11, 2002 at 21:51 UTC ( #158433=poem: print w/ replies, xml ) Need Help??

I'm aware that translating Metallica to Perl is a tried and tested subject here at the monastery. But with all its Perly bits, I couldn't resist translating perhaps their best-known song, Enter Sandman, into Perl.

say(y/our $prayers/$little[1]/); do { not 'for(get(my $son), 2, q#include "everyone"#)' }; $i->tuck($you, 'in', 'warm within') until ($the{sandman}->comes); sleep('with'), 1 x open(EYE); gripping(y/our $pillow/tight/); exit $LIGHT; enter($NIGHT); take (my $hand); $we = 'off to never never land'; $something = 'wrong', shut($the{$LIGHT}); Heavy::Thoughts->tonight and $they = not $of{snow_white}; $dreams{war}, $dreams{liars}, $dreams{@dragons[$fire]} and $of{things_that_will_bite}; sleep('with'), 1 x open(EYE); gripping(y/our $pillow/tight/); exit $LIGHT; enter($NIGHT); take (my $hand); $we = 'off to never never land'; now("$i lay $me down", 2, sleep); $i->pray($the{lord}, my $soul, \&keep); if ($i, die, "before $i wake") { $i->pray($the{lord}, my $soul, \&take); } hush($little[$baby]), do { not say(/a \w/) } and 'never mind that noise you heard'; $it = 'just' . $the{beast} . 'under' . y/our $bed// . 'in' . y/our $closet// . 'in' . y/our $head//; exit $LIGHT; enter($NIGHT); grain($of{sand}); exit $LIGHT; enter($NIGHT); take (my $hand); $we = 'off to never never land';

It compiles, too, but soon dies with an undefined subroutine error. Shame really, I was hoping it would send my Windows box into eternal sleep. ;) Interestingly, reading Damian's Exegesis 4 reveals that but will be a keyword in perl6. This could make for an interesting rewrite of Sad But True... /me hides from Metallica's lawyers getting this node reaped

And as this is my 100th post to the Monastery, I'd like to take this oppurtunity to thank all the monks who have helped me in my never-ending search for Perl wisdom. You're all camels in the desert of my ignorance, on the search for the oasis of knowledge. Um, actually that choice of words may be ill-advised...

--
amoe

Comment on Enter Camel
Select or Download Code
Re: Enter Camel
by FoxtrotUniform (Prior) on Apr 11, 2002 at 21:56 UTC
      $we = 'off to never never land';

    Wouldn't this be better written as goto undef;? Granted, branching off into never-never land is better done in assembly, but still.

    --
    Good luck, tilly
    :wq

Re: Enter Camel
by Dog and Pony (Priest) on Apr 12, 2002 at 08:24 UTC
    Nice work! :)

    In the camel book, the authors refer to $_ as "it", would that mean that "It is sad but true" could be written as (in perl 6):

    $_ = ':(' but true;
    or even
    $_ is ':(' but true;
    ??

    Anyhow, looking forward to reading your next one... and I would definetely buy "The Black Album - done in Perl" when it comes out. *Grin*


    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.
Re: Enter Camel
by Anonymous Monk on Apr 17, 2002 at 19:35 UTC
    Heavy::Thoughts->tonight and $they = not $of{snow_white};

    I would've done $they != $snow_white. It's just one guy's opinion, though.
Re: Enter Camel
by Mr. Muskrat (Abbot) on Apr 25, 2002 at 19:05 UTC
    Nicely done!
    I was pondering where to begin writing perl poetry and now I know. I'll do up a Metallica song that hasn't been done in perl yet.
    Now that I have said that, isn't this redundant? do { not say(/a \w/) }
    How about simply: do { not say(/\w/) }
    Cheers! :)

    Matthew Musgrove
    Who says that programmers can't work in the Marketing Department?
    Or is that who says that Marketing people can't program?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-09-21 20:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (175 votes), past polls