Re: using tr

2004-07-07 Thread Flemming Greve Skovengaard
Ricardo SIGNES wrote: * Cinzia Sala <[EMAIL PROTECTED]> [2004-07-07T09:35:42] I would like to transform a string like : MSDDIDWLHSRRGVCK in a identical string, but with two spaces between each letter: You wouldn't use tr/// for this. There are two simple ways: $string =~ s/(.)(?!\Z)/$1 /g; # re

Re: using tr

2004-07-07 Thread Ricardo SIGNES
* Cinzia Sala <[EMAIL PROTECTED]> [2004-07-07T09:35:42] > I would like to transform a string like : > > MSDDIDWLHSRRGVCK > > in a identical string, but with two spaces between each letter: > You wouldn't use tr/// for this. There are two simple ways: $string =~ s/(.)(?!\Z)/$1 /g; # replace

using tr

2004-07-07 Thread Cinzia Sala
Hi, I am a really new perl beginner and I would like to have some help. I would like to transform a string like : MSDDIDWLHSRRGVCK in a identical string, but with two spaces between each letter: M S D D I D W L H S R R G V C K I have tried with tr $string =~ tr/ABCDEFGHIJKLMNOPQRSTUV