But then is the cute little ::xyz(). ... Any ideas for the other packages?

Yes: xyz()

;-)

So, I thought perhaps there is another way in Perl to write xyz() to mean in this package, in order to show to the reader (and perl) that this function's source code is just below or above this line and should not open another window to search for it.

A plain xyz() always means "in this package".

Remember than when importing, for example, Other::Package::foo() into the current package This::Package, you're creating a symbol table entry This::Package::foo that just points to the original foo(). But to the code in This::Package, the symbol exists in the local This::Package symbol table!

Based on your description, I think maybe you want to differentiate between subs that come from other packages and the ones actually defined in the current package? The two typical ways to do this would be to not actually import anything (use Other::Package ();) and then call the functions explicitly (Other::Package::foo()), or an alternative would be to always list all functions imported from other packages in the use (i.e. use Other::Package qw/foo/; instead of use Other::Package;), because that would allow doing a quick search for "foo" and finding it right at the top of the file, telling the reader where it came from.

Your idea of calling subs that are defined in the current package with some kind of prefix, I would probably find kind of confusing when reading the code, because package prefixes are in my experience more commonly used when the sub comes from a different package than the current one.


In reply to Re: Making it clearer to say that a sub is defined within current package by haukex
in thread Making it clearer to say that a sub is defined within current package by bliako

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.