我越來越:創建類對象
Can't call method "test" without a package or object reference at 4.pl line 6.
而且我不知道爲什麼,任何想法?
Users.pm
package Users;
sub new{
print "Created\n";
}
sub test{
print "a";
}
1;
Test.pl
BEGIN {
push @INC,"/home/baddc0re/Desktop/perl_test/";
}
use Users;
$user = new Users();
$user->test();
很好的解釋 – badc0re