my $result=internal_days("20080911","20021011");
So far, we've used the method arrow syntax:
Class->method(@args);
or the equivalent:
my $beast = 'Class';
$beast->method(@args);
which constructs an argument list of:
('Class', @args)
and attempts to invoke:
Class::method('Class', @args);
my $tv_horst = Horse->new;
my $noise = $tv_horse->sound;
Now for the fun part: Perl takes the class in which the instance was blessed, in this case, Horse, and uses it to locate and invoke the method, as if we had said Horse->sound instead of $tv_horse->sound. The purpose of the original blessing is to associate a class with that reference to allow Perl to find the proper method.
In this case, Perl finds Horse::sound directly (without using inheritance), yielding the final subroutine invocation:
Horse::sound($tv_horse)
Note that the first parameter here is still the instance, not the name of the class as before. neigh is the return value, which ends up as the earlier $noise variable.