Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
In a quick response, and some clarification:

Yes, I agree that using undefined behaviour is bad style. That's an extremely valid point. I try at all costs to avoid such practices nowadays. But on the flipside, in Perl many things are undefined. Abigail-II has pointed out in the past that even $i = $i++; has undefined outcome, although all would agree that $i should not increment. The full debate started innocently here shows that there are many undefined parts to the very simplist of code. Yet most wouldn't complain such code's use.

And I definitely agree that this should be cleared up. The point I was (poorly) trying to get at that this should not be fixed now. We're going to break pretty much the entire of Perl5 when Perl6 is released. We could sort out substr's odd behaviour then, and no harm will come of it.

If this glitch was brought to attention a few years ago then I would have fully advocated a bug fix. But with it so late in the day now for Perl5, I geniunely believe the advantages of fixing this problem will be greatly outweighed by the problems it will cause. Perl5 is considered warty - and Perl6 is a fixup of those warts (with a few new groovy features added, naturally). I think it would make much more sense to just define this as it for Perl5 is in perldoc -f substr, and clean it in Perl6.

tlhf
Update: Slight typo; final $i was originally $i++;


In reply to Re: Re: A Bug in the Documentation or in Perl? by tlhf
in thread [substr] anomaly or mine? by BrowserUk

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 wandering the Monastery: (7)
As of 2024-04-19 11:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found