Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Perl Poetry

( [id://1590]=superdoc: print w/replies, xml ) Need Help??
"Poetry" is in the eye of the beholder; it could be any of:
  • Poetry written in Perl
  • Using perl to generate poetry
  • Poetry about Perl/PerlMonks
New Poems
12 days of Perl?
4 direct replies — Read more / Contribute
by johnaj
on Apr 29, 2021 at 22:03

    I've been working on an exercise to generate the English "Twelve days of Christmas song". So far, I've come up with the following:

    for(<DATA>){s/%/ing/;$_=($i++?$i-1+print" ":a)." $_";print"On the $i",(st,nd,rd)[$i-1]||th," day of Christmas, my true love gave to me: ",$t=$_.$t}__DATA__ partridge in a pear tree. turtle doves and French hens, call% birds, golden rings, geese a-lay%, swans a-swimm%, maids a-milk%, ladies danc%, lords a-leap%, pipers pip%, drummers drumm%,

    That generates the following text:

    My script is 343 bytes, which is better than zip and tar+gzip but worse than gzip:

    -rw-r--r-- 1 john john 294 May 1 13:29 12days.gz -rw-r--r-- 1 john john 343 Apr 30 04:00 -rw-r--r-- 1 john john 370 May 1 13:30 12days.tar.gz -rw-r--r-- 1 john john 2169 May 1 13:29 12days.txt -rw-r--r-- 1 john john 439 May 1 13:30

    Does anybody have a shorter solution? For simplicity's sake, I've limited the challenge to digits rather than written numbers.

Binary Comedy -- 01 - 000001
No replies — Read more | Post response
by Discipulus
on Apr 07, 2021 at 12:32
                                                                               to my father, sure of his pardon :)


    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
@ISA happy memory
1 direct reply — Read more / Contribute
by silent11
on Feb 10, 2021 at 19:18
    I don't post logged in,
    socials link to my handle.
    I return every few years,
    get filled with nostalgia.
    Now back to work,
    to do whatever.
    But not with my Perl,
    not today, and likely not ever.
Perl Saroyan
1 direct reply — Read more / Contribute
by Anonymous Monk
on Sep 11, 2020 at 20:56
    perl -e 'use Time::HiRes qw(usleep); foreach $i (1..145) { print join("", (" " x 72)) . "crickets\n"; usleep 550000 }'
the road ahead
1 direct reply — Read more / Contribute
by Anonymous Monk
on Oct 14, 2019 at 04:25
    perl -le'$_=`perldoc -T perlfaq4`,s/^.*N;(.*?)E.*$/$1/s,print'
obfupoetry II
1 direct reply — Read more / Contribute
by Discipulus
on Mar 21, 2019 at 04:46
    In occasion of first day of Spring* i give you the second issue of perl obfupoetry:

    How:to:forget:when:I:was:young: join ' had ', (glob'spr{a,e,i,o,u}ng')[2,4]; Now:I:get:in:the:middle:of: join ' and ', (glob'Y{i,a}n{,g}')[0,-1]; and:I:remember:it:was:a:bang: seek DATA,0,0;while(<DATA>){last if/DATA/; chomp&&print/:/?(join$",split':',$_):eval,$/} __DATA__


    (*)please do not reply with positivist comments about the exact first day of Spring: seasons always start in day 21: the notion is in my mind since..

    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
The wise coder
2 direct replies — Read more / Contribute
by hippo
on Jan 22, 2019 at 14:14
    The wise coder will never pipe grep into awk
    For unneeded processes cause neighbours to talk.
    The wise coder will never type cat file | foo
    Unless they want a UUoCA too.
    The wise coder will never discard output from backticks
    As that displays ignorance of better tactics.
    The wise coder won't shell out to grep, awk or sed
    Since no JAPH would be seen doing that, dead.
Perl is Magic
No replies — Read more | Post response
by usemodperl
on Jun 29, 2018 at 20:27
    Looking for ways to get perl to make Magic? Any odd way to print that word: like a JAPH! This shell one liner runs 3 perl one liners that run perl 4 times to make Magic:
    perl -e'$_="Larry";while(++$_){print"\rPerl is $_";goto(MAGIC)if/Magic +/}MAGIC:print"\n"';perl -v|perl -pe's\Perl\Magic\magic';perl -e'print +"[Perl$^V] ";<STDIN>'

Sex !
1 direct reply — Read more / Contribute
by usemodperl
on Jun 21, 2018 at 13:06
    perl -v|perl -pe's\(?<=r)[l]\x\g;s\(?<=pe)r\\gi;s\p(e)\S$1\gi'
    perl -MO=Deparse -e 'E S I X G S O O D'
a prime bug
1 direct reply — Read more / Contribute
by ownlifeful
on Jun 10, 2017 at 21:24
    chomp and print join ',', grep $_, (map length, split /[a,]/), "\n" while <DATA>; __END__ a bug trapped inside a paper lantern, arid aflutter, ablaze

Add your poem
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    Domain Nodelet?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others examining the Monastery: (3)
    As of 2024-07-24 16:30 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found

      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.