Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Ah, well, that's quite a lot to explain, but I shall take your questions one at a time:
What's the meaning of the "post =>" ?
Here the => operator, commonly known as the fat comma is simply "stringifying" (i.e turning the bareword post into a string) its left-hand side argument, which in this case is post. For more information on the fat comma see. perlop. Looking at it from a higher level it is also specifying that the post handler is being provided. For information on Filter::Include's handlers see. the HANDLERS section.
What is the meaning of "sub (" without the subname ?
When sub is used without a name it is creating an anonymous sub and so is acting as an anonymous subroutine constuctor. This means that it will create a subroutine and return a reference to that subroutine. It is anonymous by virtue of the fact that it can be only referred to by its reference and not its name, which is orthogonal to the anonymous array ([]) and anonymous hash ({}) constructors. For more information on anonymous subroutines see. perlsub.
What should be in $_[0] and $_[1] ?
As documented in the HANDLERS. section of Filter::Include the first argument ($_[0]) will contain the name of the file or module being included and the second argument ($_[1]) will be the code that has just been filtered.
What's the meaning of "$Filter::Include::LINE" ?
This was a little more subtle and is not currently documented in Filter::Include, which I apologise for. It holds the current line number as of the last include. This should definitely be documented and perhaps better exposed through the API. Your post definitely gave me pause for thought about how your problem could solved nicely and if it should in fact be part of the module as it certainly looks to be a handy feature. Perhaps, again, it could be implemented as another option to import. Thanks for your input, it is, as always, much appreciated.
HTH

_________
broquaint


In reply to Re^3: Error location in Filter-Include by broquaint
in thread Error location in Filter-Include by mosh

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (17)
    As of 2014-04-18 19:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (471 votes), past polls