Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (14)
As of 2016-07-01 15:45 GMT
Find Nodes?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?

    Results (7 votes). Check out past polls.