Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Lovesong

by giulienk (Curate)
on Dec 11, 2001 at 21:04 UTC ( #130974=poem: print w/ replies, xml ) Need Help??

Lovesong by The Cure
#!/usr/bin/perl @lovesong = qw(L o v e s on g); while (($_= <DATA>) && chomp && $_) {$.<=@lovesong ? ${$lovesong[$.-1]} = $_ : push @love, $_} @song = @lovesong[-3..-1]; $lovesong = length($L.$o.$v.$e.$s.$on.$g) - @love ** 2; print $L."\n"x2; for ((split //, $s)[0..4]) { if (ord(lc) <= $lovesong) { printf ("$o\n$v\n", $love[$j++]) for 0..1; } else { my $i; print ((ord(lc) <= $lovesong? $e : ${$song[$i++]}) . "\n" ) for (reverse split //, (split / /, $s)[0]); } print "\n"; } __DATA__ Lovesong Whenever I'm alone with you You make me feel like I am %s again I will always love you However far away However long I stay Whatever words I say home whole young fun free clean
Update: better split in outer for and fixed too long DATA. Fixed an excessive { thanks to tye

gkinueliileunikg

Comment on Lovesong
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-10-25 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (143 votes), past polls