On Tue, Jan 28, 2003 at 04:35:46PM -0800, Damian Conway wrote: > Paul Johnson wrote: > > > If you insist: > > > >echo 123456 | perl -lne 'print join "-", /../g' > > Are you *mad*?! Do you think keystrokes grow on *trees*??!! > There's about to be a war on, you know! Start conserving those > characters now, citizen! > > echo 123456 | perl -ple's/..(?=.)/$&-/g'
Hmm, time to whip out the mind-twisting metacharacters, echo 123456 | perl -ple's/..\B/$&-/g' Patriotically yours, Paul -- Paul Makepeace ....................................... http://paulm.com/ "What is the swirly thing in my coffee trying to tell me? If higher, then fewer." -- http://paulm.com/toys/surrealism/