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

comment on

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

Ah. So it seems on rereading very carefully, I've tripped up on some slight ambiguities in this line:

Setting $/ to a reference to an integer, scalar containing an integer, or scalar that's convertible to an integer will attempt to read records instead of lines, with the maximum record size being the referenced integer.
That should be read as reference to (integer|scalar containing integer|scalar convertible to an integer) and not as (reference to integer|scalar containing an integer|scalar convertible to an integer). It's not talking about scalar values. It's talking about Perl's idea of Scalar variables, a definitional ambiguity for which I should have been prepared as it's peppered through the Perl documentation that way. The "reference to" part covers all three cases in the list, a structural ambiguity that I should have tested out.

So in trying to golf out three characters and testing edge cases insufficiently (IIRC I tested with all alpha text) I ended up with a bug on my arm. Again, if clear but still shortened was the goal I'd have just gone with undef$/, but $/=\-1; is pretty nice. It still comes down to trying to be overly clever. It's a minimal code change to fix it and the code still makes its intended point with or without the bug.

Just please forgive me if I don't patch the hardcopy right away...


In reply to Re^4: archival storage ($/=\) by mr_mischief
in thread archival storage by mr_mischief

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 cooling their heels in the Monastery: (6)
As of 2024-04-18 12:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found