Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: why such an error happened?

by pobocks (Chaplain)
on Oct 20, 2008 at 05:37 UTC ( [id://718139]=note: print w/replies, xml ) Need Help??


in reply to why such an error happened?

I'm not actually sure what you're trying to do here, but I do know what's causing the error.

What it says right now is Match EITHER (this | that) OR (\w+) -> Any wordlike object including 'this' and 'that' and replace it with the first capture followed by the second capture. Do this globally (i.e. over and over until the whole string is changed).

The problem is, there's only ever one match. EITHER (this|that) matches, or (\w+) matches. Thus, $2 stays empty, thus uninitialized value.

while(<DATA>){for(split(' ',$_)){$_=reverse;print "$_ ";}};print "\b.\ +n"; __DATA__ tsuJ rehtonA lreP rekcaH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://718139]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-25 16:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found