Ending a module with __PACKAGE__; instead of the usual 1; could be used to call a method on the result of the require.
$ cat Eg.pm package Eg; sub hello { print "Hello World\n"; } __PACKAGE__; $ perl -e '(require Eg)->hello()' Hello World
In reply to Re: Shorten one liners with Class::Autouse
by bsb
in thread Shorten one liners with Class::Autouse
by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |