#!/usr/bin/perl $a=5; + # Here we make a new variable called "a" to use as a simple loop co +unter. + # Now, we'll create some arrays, and start them off with some fresh + elements. @group=("swarm","heap","load","gang","squad","bunch","cluster","family +","team"); # This is an array, called group. Arrays are designated wi +th in at-symbol (@) prefix. @adjective=("crack-smoking","supple","furious","sexy","hyperactive","i +nquisitive","hot","old","crazy"); @noun=("midgets","Cuban refugees","clowns","bitches","programmers","ba +bies","dogs","hep-cats","apes"); while($a>0) + # This is a simple while-loop construct. It uses the same syntax as + Java, or C, { + # with one exception...You need to enclose even singular expression +s in braces. $index=rand(9); + # This generates a random integer between 0 and 9, and stores it in + $index print( "\nMr. T says, \"Daaaaammmn!!! A @group[$index]"); + # First part of the line is printed here, in this statement. $index=rand(9); + # A new number is generated, and stored in $index. print( " of @adjective[$index]"); + # The n'th element ($index) of the array is printed here. $index=rand(9); + # A new random number is generated and stored in $index. print( " @noun[$index] just ate my balls!!\""); + # The end of the line is printed. $a--; + # Our loop counter is decremented here, and the loop iterates. } print("\n\n"); + # Toss in a few newlines to keep things pretty, and we're all done!

In reply to "Ate My Balls" Syntax Generator by bpoag

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.