The method new Parse::RecDescenthas this prototype:
sub new ($$$)
{
}
and if I create an object like this:
my $parser = Parse::RecDescent->new($grammar);
he will create a parser and the method will get 2 parameters "Parse :: RecDescent" and $ grammar, right? If I try to create an object like:
Parse::RecDescent::new("Parse::RecDescent",$grammar)
this will not let you say "Not enough arguments for Parse :: RecDescent :: new" and I understand this message. I pass only 2 parameters. However, I do not understand why the arrow version works.
Can you explain?
source
share