if the minus sign always there, then use s/// seems faster than split, like
while(<DATA>){ s/(\d)-/$1\t-/; print "$_"; } On 11/9/07, Paul Lalli <[EMAIL PROTECTED]> wrote: > > On Nov 9, 2:09 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > > > Why have you decided that the OP's solution doesn't provide what he > wants, > > snipped it, and offered some code that does something very different? > > > and he asked for a more elegant way of doing the same thing. I would > have > > thought it was a good idea to assume he knew what he wanted. > > You're right. I didn't read his sample program, because I assumed > that his subject also contained a description of what he wanted to do > - split two numbers that were joined by a minus sign. How foolish of > me to make such an assumption. > > The OP's subject does not match the OP's goal. Oh well. > > Paul Lalli > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.org/ > > >