http://www.perlmonks.org?node_id=1005739


in reply to Re^2: Finding max value from a unique tag from XML
in thread Finding max value from a unique tag from XML

Thank you Jenda!
Could you please point me to the documentation of $_[4] approach?

Replies are listed 'Best First'.
Re^4: Finding max value from a unique tag from XML
by afoken (Chancellor) on Nov 26, 2012 at 19:32 UTC

    $_[4] is the fifth element of @_, the array containing subroutine arguments. $_[4] is used in both subroutines in the @rules array, and it is used as a hash reference. The @rules array is passed to XML::Rules->new(...). I would expect XML::Rules to call one or both of the subroutines while parsing the XML document.

    And, lo and behold, XML::Rules does call the subroutines passed in @rules. The documentation clearly states that the fifths parameter is the parser object (a blessed hash reference), documented with the name $parser. It offers two workspaces, $parser->{'pad'} and $parser->{'parameters'} to "store any data you need".

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      Danke!