in reply to Re^21: can't import using exporter
in thread can't import using exporter
I wondered why I got an extra warning in the cut down version...
but that's what I get for cuttin down.... can't type straight. ;-)
ok so export var and not it's contents...
I get warning, but it appears to work.
Ok... but that's what I have in the larger program. But that's not the error it puts out...
> less testme.pl #!/usr/bin/perl -w use strict; package _Debug;{ our $Filename2Fields = 1; our $HaltOnError = 2; our $DEBUG_OPS = 3; our @EXPORT=qw( Debug $DEBUG_OPS $Filename2Fields $Halt_on_Error); use parent 'Exporter'; sub Debug($$) { my ($what, $str)=@_; if ($what & $DEBUG_OPS) { print STDERR $str; } } } package Transcode_plug;{ import _Debug; sub get_fieldAR_from_filename($) { my $file=$_[0]; Debug($Filename2Fields,"get_fieldAR_from_filename($file)\n"); } } Transcode_plug::get_fieldAR_from_filename('dummy'); # vim: ts=2 sw=2 Ishtar:/Audio/scripts> testme.pl Global symbol "$Filename2Fields" requires explicit package name at ./t +estme.pl line 16. Execution of ./testme.pl aborted due to compilation errors.
But if I turn off strict and turn off warnings, it runs just fine.
*cough*.
How is this not a bug in perl 5.14? Crying wolf is bad, we learned that in grade school.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^23: can't import using exporter
by chromatic (Archbishop) on Mar 25, 2012 at 07:30 UTC | |
by perl-diddler (Chaplain) on Apr 25, 2012 at 21:26 UTC | |
by chromatic (Archbishop) on Apr 26, 2012 at 00:21 UTC | |
Re^23: can't import using exporter
by Anonymous Monk on Mar 25, 2012 at 07:23 UTC | |
by perl-diddler (Chaplain) on Mar 26, 2012 at 16:32 UTC | |
by Anonymous Monk on Mar 27, 2012 at 07:30 UTC |
In Section
Seekers of Perl Wisdom