I don’t really understand how scoping works in Perl modules. This doesn’t print anything. I would like it if running a.pl printed 1
b.pm
$f=1;
a.pl
use b;
print $f
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
OK, you have a lot of misconceptions that we can best address by fixing your immediate problem and pointing you to good resources.
b.pm should be:
a.pl should be
run the whole thing with
perl -I. a.plNow go read
perldocperlmodvery carefully.Also read
perldocstrict.