R
Ronny
Patterned after the solution suggested in the perlmodlib man page, I
wrote the following code:
==================== This is file b.pm
#!/usr/local/bin/perl -w
use strict;
package b;
sub f { print "BBBBBBBB @_\n"; }
eval join('', <main:ATA>) || die $@ unless caller();
1
__END__
package main;
b::f(@ARGV);
=================================
When called this from the command line, say:
b.pm X
it works fine. But when I use it as a module, say
from this context:
===================== This is file p.pl
#!/usr/local/bin/perl -w
use strict;
use b;
b::f('X');
=================================
when executing
p.pl
I get the warning
Name "main:ATA" used only once: possible typo at b.pm line 10.
How can I get rid of this warning? I can't use "use vars" here to
"predeclare"
main:ATA, because it is a file handle.
Ronald
wrote the following code:
==================== This is file b.pm
#!/usr/local/bin/perl -w
use strict;
package b;
sub f { print "BBBBBBBB @_\n"; }
eval join('', <main:ATA>) || die $@ unless caller();
1
__END__
package main;
b::f(@ARGV);
=================================
When called this from the command line, say:
b.pm X
it works fine. But when I use it as a module, say
from this context:
===================== This is file p.pl
#!/usr/local/bin/perl -w
use strict;
use b;
b::f('X');
=================================
when executing
p.pl
I get the warning
Name "main:ATA" used only once: possible typo at b.pm line 10.
How can I get rid of this warning? I can't use "use vars" here to
"predeclare"
main:ATA, because it is a file handle.
Ronald