Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
This is my piggy... ok ok, I cheated a bit, and I used some ideas from Camel Code, so shoot me :) This is my first honest attempt. I could not get it to work under warnings without spending even more time I don't have :(

But anyway, pass my piggie a file, or some text on STDIN, and watch it go... whee! :)

#!/usr/bin/perl use strict; my$a='my@out;while(<>){s/ (\A|\n|[^\w-])([aeiou])?([\w\-]*(\\ \'\w +)?)/$1.&convert($2,$3)/ggies;push@out,$_}prin t("PigTalk\nV1.0\n\n",join"",@out);sub';my$b='co nvert{my($a,$b)=@_;if($a){return"$a$b-ay";}unless($b ){return}if(length$b==1){return$b}my$uc=0;if($b=~s/^( [A- Z])/lc($1)/e){$uc=1};$b=~s/^([^aeiou][^aeiouy]?)//; $a= $1;$b=ucfirst($b)if$uc;return"$b-${a}ay";}print;';$ a=~ s/\s+//g;$b=~s/\s+//g;;;eval"$a $b"; __DATA__ my$a= ' my@out;while(<>){s/(\A|\n|[^\w-])([aeiou])?([\w\-]*( \\\'\w+)?)/$1.&convert($2,$3)/ggies;push@out,$_}print(" PigTalk\nV1.0\n\n",join"",@out);sub';my$b='convert{my( $a,$b)=@_;if($a){return"$a$b-ay";}unless($b){return}i f(length$b==1){return$b}my$uc=0;if($b=~s/^([A-Z])/lc ($1)/e){$uc=1};$b=~s/^([^aeiou][^aeiouy]?)// ;$a=$1;$b=ucfirst($b)if$uc;return"$b-${a} ay";}pri nt;'; $a=~s /\s+// g;$b =~s/ \s+// g;;;e val" $a $b "; _ _DAT A__ my$ a='my @out

                - Ant

In reply to by suaveant

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
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (9)
    As of 2019-11-21 09:00 GMT
    Find Nodes?
      Voting Booth?
      Strict and warnings: which comes first?

      Results (104 votes). Check out past polls.