[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: The translate operator (was Re: [MacPerl] regex help)



In article <199911282150.NAA08782@pacific.telebyte.com>, Brian McNett <webmaster@mycoinfo.com> writes:

> Paul Schinder, <schinder@pobox.com> wrote:
>> As a Calvin and Hobbes fan, I'd lean towards "transmorgrify" myself.

> vt [origin unknown] to change or alter greatly and often with grotesque 
> or humorous effect.

> Can someone show a use of tr// to humorous or grotesque effect? ;-)

This is too easy :-)

sub fudd {
   my($x) = $_[0];
   $x =~ tr/r/w/;
   $x;
}

print fudd("Be very, very quiet! I'm hunting rabbit\!n"); 

Matthias

-- 
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
    "Let's make that big, evil *canadian* rabbits... on crack!" -- _Suck_

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org