Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

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

To put it as short as possible, this popped out in clpmisc while trying to help someone to override -e (which appears not to be possible) and I'm pasting hereafter the relevavant part of what I wrote there:


Actually, now that I think of it, I don't know if -X functions are overridable, and you made me discover something interesting: people generally check the prototype of CORE:: functions because if they are not ovverridable then it returns undef - but then please note that the inverse implication does not hold. (E.g. require returns undef() but I have seen it duly overridden.) Now, I tried to see what happens with -e() and it turns out that it gives a run-time error I had never seen:

whisky:~ [09:58:08]$ perl -E 'say prototype "CORE::$_" // "undef" > for qw/rand require -e/' ;$ undef Can't find an opnumber for "-e" at -e line 2.

Now, I don't even know if this is a proper SoPW since I understand that, to put it simply, "something strange happens with these strangely named functions, even if the docs say that they apart that detail they're not different from any other unary operator..." But I would like to know more about this error, anyway: was it to be expected, or can I check the prototype of those functions in some other way?

--
If you can't understand the incipit, then please check the IPB Campaign.

In reply to Previously unseen error in connection with -X functions by blazar

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 goofing around in the Monastery: (4)
As of 2024-04-18 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found