in reply to Re^2: Writing a Perl Module... problems
in thread Writing a Perl Module... problems
It's callled class method calling. With Name::Name::subroutine(), you call subroutine() with fully qualified package name without any argument.package Name::Name; sub subroutine { my $class = shift; # shifting @_ print $class, "\n"; } package main; use Name::Name; Name::Name->subroutine(); # output: # Name::Name
I'm not sure what's missing, but if the subroutine in question is new() then you can't call it Name::Name::new() as it expects the class name as its first argument. Similiar way to the class method calling above is Name::Name::new('Name::Name').
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
|
|---|