Because can (in class form) does respect inheritance, while a fully specified function name (like foo::bar) does not respect inheritance. Look at the following reduced code:
package Parent; sub foo { print "foo in parent(@_)\n"; }; sub bar { print "bar in parent(@_)\n"; }; package Child; @ISA = qw(Parent); sub foo { print "foo in child(@_)\n"; }; package main; eval { Child::foo(); }; warn $@ if $@; eval { Child->foo(); }; warn $@ if $@; eval { Child::bar(); }; warn $@ if $@; eval { Child->bar(); }; warn $@ if $@;
In reply to Re^3: This can't happen, can it?
by Corion
in thread This can't happen, can it?
by henrylaxen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |