Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

by suaveant (Parson)
on Jul 17, 2001 at 19:23 UTC ( #97341=obfuscated: 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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://97341]
Approved by root
[1nickt]: ... choice, the threaded-perl user *probably* wants to use threads, therefore only require threads and leave MCE out, allowing the user to manually install if desired?
[choroba]: just require any of MCE and threads. Not sure if that's possible in the cpanfile, but should be possible early in the Makefile
[1nickt]: The app expects threads as default anyway, right?
[choroba]: that's true
[1nickt]: expects threads *to be* the default
[1nickt]: I think cpanfile can handle the logic. testing now.

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2017-10-18 13:26 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (244 votes). Check out past polls.