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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.