Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: "Can't happen" bugs

by ikegami (Patriarch)
on Jul 04, 2008 at 18:01 UTC ( [id://695610]=note: print w/replies, xml ) Need Help??


in reply to "Can't happen" bugs

the error message I was getting (" is only avaliable") can be explained by a failed match or an empty capture.

A failed match doesn't clear $1

>perl -le"'a'=~/(.)/; 'b'=~/c/; print $1" a

$1 is cleared by a successful match with no captures, or capturing a zero-length string.

>perl -le"'a'=~/(.)/; 'b'=~/./; print $1" >perl -le"'a'=~/(.)/; 'b'=~/(.*?)/; print $1"

Apart from the typo in "available"

It's a feature to make the error message easily findable in the source. *wink*

Log In?
Username:
Password:

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

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

    No recent polls found