Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

And I just verified that 5.8.5 doesn't unset the variables, so it works as it always has.

Ah, indeed. I forgot that I've also tried it with the same result as you. I brought it up on freenode #perl. I considered it a bug and I still do. It's either a documentation bug or a perl bug. I don't think the documentation can be interpreted as you suggest. It clearly says "if the match fails".

I believe this is referring to the fact that if a match has $1..$6 in one successful match, then only $1..$2 in the next match, that $3..$6 are more carefully set to undef now.

That's the behaviour I get for perl version 5.005_03 built for sun4-solaris. I interpret the "more consistently" part as a mismatch unsets all, since that behaviour would be more consistant with how it already works when $3 .. $6 is unset/not matched; failing a match would mean "you didn't match $1 .. $n so it should be unset". Whether or not the behaviour is more consistant I won't argue over, but this is how I interpret the documentation.

I assumed this behaviour change was due to some considering that the values in the regex variables after a failed match are "false data", as the documentation calls it. I assumed it was an attempt to make Perl DWIM, for some definition of I.

ihb

Read argumentation in its context!


In reply to Re^4: You *Can* Catch errors in closing lexical filehandles by ihb
in thread Catching errors in closing lexical filehandles by gaal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-04-24 10:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found