Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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++; }


Comment on Re^2: output differs in perl version
Select or Download Code
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-08-23 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (174 votes), past polls