I was working on an administrative program that would send out email regarding its status when I thought that adding an interesting .sig would make it more pleasant. Thus, I faced the age-old problem of "what do I do with all of these penguins?"

The answer, of course, is to properly encapsulate them by stuffing them into a subroutine.

use strict; print get_a_penguin(); sub get_a_penguin { # http://www.stud.uni-hannover.de/~freise/ascii/pqr/penguins.txt my @penguins = ( "(o_\n//\\\nV_/_3 Standard Penguin", "(*_\n//\\\nV_/_3 Drunk Penguin", "(O_\n//\\\nV_/_3 Shocked Penguin", "(o<\n//\\\nV_/_3 Noisy Penguin", "(o<)<\n//\\\nV_/_1 Penguin Eating Fish", "_o)\n//\\\nV_/_3 Paranoid Penguin", "10 (o_\n(o_2 (o_2 //\\\n(/)_ (/)_ V_/_4 The Penguin Family", "(o|\n//\\\nV_/_3 Penguin after hitting a wall", "2 _7 _14 _\n_{v}_4 (v)5 ('>4 ( )\n /-\\4 //-\\\\4 /V\\3 // ". "\\\\\n(\\_/)3 (\\_/)3 <(_)3 (\\=/)\n ^ ^5 ^ ^6 2~4 ~ ~2 mis". "cellaneous penguins", "3 <`)4 (v)4 ('>5 ( )\n3 (V)3 //_\\\\3 (V)4 //_\\\\\n ]/__)>2 +". "(U_U)2 <(__\\[2 (\\=/) sitting penguins", "11 _o18 _17 _o_3 o3 o\n6 o4 (^)2 _13 (o)4 >')9 (^) (^) (^)\n +". "3 _ (^) ('>~ _(v)_6 _3 //-\\\\3 /V\\6 ('> ~ 2_.~3 ~\n ('v')~" +. " // \\\\ /-\\6 (.)-=_\\_/)3 (_)>5 (V) ~ ~~ /__ /\\\n//-=-" +. "\\\\ (\\_/) (\\_/)6 V \\ _)>~4 ~~6 <(__\\[5 ](2_=_')\n(\\_=_/ +". ") ^ ^3 ^ ^7 ~ ~~16 4~8 5~\n_^^_^^3 __2 ..-.3 ..3-I3~:_ .__ +". "3.--.._.;-'I4~-.4_2.;-\n |~|5~| ~~| _3 |4 | _| ~~| | | " +. "| |_ |6 | _ | |\n_.-~~_.-~-~._.-~~._.-~-~_.-~~_.-~~_.-~-~._ +". ".-~~._.-~-~_.-~~_.-~-~\n27 .18 . ' .4 .4 .\n17 . '.3 ;4 .9 +". "<(')-/|=-/ . ' : . '\n7 _ . '3 .4 .4 .15 ~~-==~\\ . '\n6 +". "(.)-/|=-\\ . ' : . '\n7 V ~-=-~- . '\n6 ,\n3 <')_>< Pengui +n". " family photo" ); my $penguin = $penguins[ rand() * @penguins ]; $penguin =~ s/(\d+)(.)/$2x$1/ge; return $penguin; }

In reply to Handling excess penguins by Ovid

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.