Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: letter mix

by btrott (Parson)
on Jun 16, 2001 at 01:11 UTC ( #88939=note: print w/replies, xml ) Need Help??


in reply to letter mix

Couldn't you just do this?
$data1 =~ s/(\S)(\S)/$2$1/g;
This takes two non-space characters in a row, and swaps them.

Perhaps it has slightly different behavior than yours, though. I only tested it on your example.

Replies are listed 'Best First'.
Re: Re: letter mix
by mexnix (Pilgrim) on Jun 16, 2001 at 01:44 UTC
    I assumed that you had to split every 2 letters, then regex them so that they all swicthed. You know what happens when you assume things...

    __________________________________________________
    %mexnix = (email = > "mexnix@hotmail.com", website => "http://mexnix.perlmonk.org");

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://88939]
help
Chatterbox?
[talexb]: TStanley I'm flying to Vegas in two weeks time. After that flights leaving Vegas and Phoenix are late at night .. I've been hearing that it gets so hot that the air isn't dense enough for planes to take off. Weird. Guess you won't have that problem.
[Corion]: Yay, vacation time now - one week off work (but a Perl workshop in the middle ;)) )
[talexb]: TStanley I just realized that I was in your area for a convention back in April. We were at the high school for the weekend, the one with the long driveway. Nice spot.
[TStanley]: I am heading to Arlington, Virginia next week, then I get to spend an entire week at home. Looking forward to that as I will have spent 7 weeks on the road by the end of next week

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2017-06-23 14:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (548 votes). Check out past polls.