> is it possible to alias to it?

Nope!

DB<128> $CORE::{substr} => *CORE::substr DB<129> $CORE::{print} => undef

It's not really as a "function" in CORE namespace, to rule out overriding.

prototype FUNCTION Returns the prototype of a function as a string (or "un +def" if the function has no prototype). FUNCTION is a referenc +e to, or the name of, the function whose prototype you want to r +etrieve. If FUNCTION is a string starting with "CORE::", the res +t is taken as a name for Perl builtin. If the builtin is no +t overridable (such as "qw//") or if its arguments cannot + be adequately expressed by a prototype (such as "system"), prototype() returns "undef", because the builtin does n +ot really behave like a Perl function. Otherwise, the str +ing describing the equivalent prototype is returned.

DB<131> prototype 'CORE::print' => undef DB<132> prototype 'CORE::substr' => "\$\$;\$\$"

Nevertheless can it be called.

DB<133> CORE::print("bla") bla

> I know print is a very special function...

Thats the point, print is magic about indirect object syntax:

eg print STDERR "Fatal!"

This behavior can't be mimiced with normal prototypes, so no STASH entry.

Cheers Rolf


In reply to Re: Possible to get coderef of CORE::print to alias it? by LanX
in thread Possible to get coderef of CORE::print to alias it? by Yary

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.