我正进入(状态:
Can't call method "test" without a package or object reference at 4.pl line 6.
我不知道为什么,有什么想法吗?
用户.pm
package Users;
sub new{
print "Created\n";
}
sub test{
print "a";
}
1;
测试.pl
BEGIN {
push @INC,"/home/baddc0re/Desktop/perl_test/";
}
use Users;
$user = new Users();
$user->test();