This does all twelve stanzas of London Bridge. Also, it passes the defaults for

perlcritic -harsh
. Enjoy. (Update: removed a line that toolic noticed was never used.)

#!/usr/bin/perl use strict; use warnings; my @armed_guard = ("watch all night", "fall asleep", +"smoke all night"); my @royal_decree = ("Set a man to", "Suppose the man should", "Gi +ve him a pipe to"); my @building_outcome = ("falling down", "wash away", "will not stay" +, "bend and bow", "stolen away"); my @building_material = ("London Bridge", "wood and clay","bricks and +mortar", "iron and steel","silver and gold"); my @phrase_glue = ("is", "will", "", + "will", "will be"); my $fair_lady = "My fair Lady.\n\n"; # First stanza print join(" ",$building_material[0],$phrase_glue[0],$building_outcome +[0]). ",\n"; print $building_outcome[0] . ", " . $building_outcome[0] . ",\n"; print join(" ",$building_material[0],$phrase_glue[0],$building_outcome +[0]). ",\n"; print $fair_lady; # middle 8 stanzas for my $i (1..$#building_outcome) { print "Build it up with ".$building_material[$i].",\n"; print $building_material[$i] . ", " . $building_material[$i] . + ",\n"; print "Build it up with ".$building_material[$i].",\n"; print $fair_lady; print join(" ",ucfirst($building_material[$i]),$phrase_glue[$i +],$building_outcome[$i]).",\n"; print $building_outcome[$i] . ", " . $building_outcome[$i] . " +,\n"; print join(" ",ucfirst($building_material[$i]),$phrase_glue[$i +],$building_outcome[$i]).",\n"; print $fair_lady; } # final 3 stanzas for my $i (0..2) { print join(" ", $royal_decree[$i], $armed_guard[$i]).",\n"; print $armed_guard[$i].", ".$armed_guard[$i].",\n"; print join(" ", $royal_decree[$i], $armed_guard[$i]).",\n"; print $fair_lady; } exit 0;
--
I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.

In reply to London Bridge (build it up with lots of arrays, lots of array, lots of arrays) by KurtSchwind

Title:
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, details, 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, summary, 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.