M
mailbox
Given the program below:
#!/usr/bin/perl
use ATrial;
$D = ATrial::SomeSubr();
print "|$D|\n";
I find that if I remove the "ATrial::" from
the assignment statement, I get a runtime
error "Undefined subroutine &main::SomeSubr called..."
According to the "Perl Cookbook," page 446, I should
be able to dispense with that prefix if I have
the "use" statement. What's going on?
The module ATrial.pm is in the same directory,
and is as follows:
package ATrial;
sub SomeSubr () {
return "HELLO";
}
1;
The really odd thing is that I've been cruising along for
several hundred lines one directory level up from where
I am now in a project in which I've created a couple of
modules and referenced stuff in them from a dozen scripts.
I don't see any obvious difference in the usage there.
Using -I with pathnames in the command line to make things
more explicit has had no effect.
#!/usr/bin/perl
use ATrial;
$D = ATrial::SomeSubr();
print "|$D|\n";
I find that if I remove the "ATrial::" from
the assignment statement, I get a runtime
error "Undefined subroutine &main::SomeSubr called..."
According to the "Perl Cookbook," page 446, I should
be able to dispense with that prefix if I have
the "use" statement. What's going on?
The module ATrial.pm is in the same directory,
and is as follows:
package ATrial;
sub SomeSubr () {
return "HELLO";
}
1;
The really odd thing is that I've been cruising along for
several hundred lines one directory level up from where
I am now in a project in which I've created a couple of
modules and referenced stuff in them from a dozen scripts.
I don't see any obvious difference in the usage there.
Using -I with pathnames in the command line to make things
more explicit has had no effect.