in reply to scramble text simply

It's fairly common to rot-13 text for such purposes: $text =~ tr[a-zA-Z][m-za-nM-ZA-N];

As a bonus, running the same function a second time will return the original text.

Update: The 'M's and 'N's in the above are swapped, as davido points out below. Oh well, that's what I get for posting before I've drunk my coffee...

Replies are listed 'Best First'.
Re: Re: scramble
by davido (Cardinal) on Oct 03, 2003 at 16:20 UTC
    tr[a-zA-Z][m-za-nM-ZA-N];

    That isn't a rot13, it's a mistake.

    Rot13 is tr[a-zA-Z][n-za-mN-ZA-M];

    And here it is as a one liner that Rot13's all files specified on the command line, and saves their original as filename.old:

    perl -pi.old -e "tr/a-zA-Z/n-za-mN-ZA-M/" filename


    Dave


    "If I had my life to do over again, I'd be a plumber." -- Albert Einstein