Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2017-04-26 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (476 votes). Check out past polls.