I ran a few tests after Anonymous Monk's post with

$\=$/; sub tst { print shift } sub ptst(&) { print shift } sub ff { tst sub {1, 2, 3,} } ff for (1..3); sub ff { print sub {1, 2, 5,} } ff for (1..3); sub ff { ptst {1, 2, 4,} } ff for (1..3);

Which gives in the debugger:

DB<1> $\=$/; DB<2> sub tst { print shift } DB<3> sub ptst(&) { print shift } DB<4> sub ff { tst sub {1, 2, 3,} } ff for (1..3); CODE(0x2d1c1f8) CODE(0x2d1c840) CODE(0x2d1c828) DB<5> sub ff { print sub {1, 2, 5,} } ff for (1..3); CODE(0x2d1c330) CODE(0x2d1c330) CODE(0x2d1c330) DB<6> sub ff { ptst {1, 2, 4,} } ff for (1..3); CODE(0x2d1c8a0) CODE(0x2d1c930) CODE(0x2d1c8e8)

Though there are still things I don't get (like the fact that user function versus core function matters), I interpreted it as proving AM right. Except I ran the following code as a file instead of in the debugger.

$\=$/; sub ptst(&) { print shift } sub ff {ptst {1, 2, 3, 4,} } ff for (1..3); ptst {1, 2, 3, 4,};

With the output:

CODE(0x20f2b8) CODE(0x20f2b8) CODE(0x20f2b8)

Where you'd get different references with a (%) prototype for ptst. I guess perl is just too smart for me.


In reply to Re: References for ano subs fixed at compile time? by Eily
in thread References for ano subs fixed at compile time? by LanX

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.