I know a bunch of ways of calling perl functions, but this doesn't seem to be one of them. And it's kind of hard to power-search for the relevant entities, so far as I can tell.

my $map = match_maprow_by_hash $self( $first ); is the line of code that confuses me. match_maprow_by_hash is a local helper function -- it's in the .pm file of a moose class, but the code seems to expect to be called as a normal subroutine, not a class method (it doesn't treat its first parameter as class name or self reference).

This call does occur in an instance method, and $self is a reference to the instance. It's the $self($first) that confuses me; I don't know what treating the instance as a function means. $first is a lexical variable referencing a DBIx::Class::Core subclass representing a row in the database.

I've spent quite a while looking at general discussions of function calls and OO and Moose programming, and trying to find ways to search such generic terms (and symbols), but to no avail, so it's back to asking somebody who already knows. Is there a definitive discussion of ALL the ways to call subroutines around somewhere?


In reply to Confused on function call syntax by dd-b

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.