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

Re^2: output differs in perl version

by Neighbour (Friar)
on Jul 04, 2011 at 11:33 UTC ( #912630=note: print w/replies, xml ) Need Help??

in reply to Re: output differs in perl version
in thread output differs in perl version

But you always can implement the algorithm in a way that does work in 5.8.8. For example like this:
while ( $str1 =~ /^(\S+\s+)(\S+\s+\S+)(.*)$/ ) { print "$1$2\n"; $str1 = "$2$3"; $n++; }

Alternatively, you could use $' (${^POSTMATCH} doesn't work in 5.8.8):
while ( $str1 =~ /^(\S+\s+)(\S+\s+\S+)/ ) { print "$1$2\n"; $str1 = "$2$'"; $n++; }

Replies are listed 'Best First'.
Re^3: output differs in perl version
by ikegami (Pope) on Jul 05, 2011 at 02:00 UTC

    Doesn't work.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://912630]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2017-07-21 17:18 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (330 votes). Check out past polls.