Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: can't import using exporter

by Corion (Pope)
on Mar 12, 2012 at 21:20 UTC ( #959181=note: print w/ replies, xml ) Need Help??


in reply to can't import using exporter

Your error is that you try to import a subroutine:

import Debug qw{Filename2Fields};

but Debug only exports $Filename2Fields. And you never import that, and that seems to be what Perl complains about.

You could have put some more work into reducing your test case into a small, self-contained program, which would make it easier for us to reproduce your situation. If indeed 5.14 were broken, it would be rare that you would be the first person to realize that, especially about 1 year after 5.14 was released and shortly before 5.16 gets released.


Comment on Re: can't import using exporter
Select or Download Code
Re^2: can't import using exporter
by perl-diddler (Hermit) on Mar 12, 2012 at 23:08 UTC
    I've tried it with and without the sigils in both places -- it made no difference.

    You will note that I have my exports in EXPORT, not EXPORT_OK -- so shouldn't that mean they are all exported by default?

      ... shouldn't that mean they are all exported by default?

      Yes, it does.

      I've tried it with and without the sigils in both places -- it made no difference.

      Like I wrote, the lack of the BEGIN is tripping you too. Either wrap your imports in BEGIN blocks or extract these packages into separate files and use use.


      Improve your skills with Modern Perl: the free book.

        Okay... I commented out the Module stuff. I put in "BEGIN{import Debug;}"
        Then I get:
        Global symbol "$Filename2Fields" requires explicit package name at /Au +dio/scripts/cnvWav2Flac line 120. Global symbol "$Filename2Fields" requires explicit package name at /Au +dio/scripts/cnvWav2Flac line 128. Global symbol "$Filename2Fields" requires explicit package name at /Au +dio/scripts/cnvWav2Flac line 134. Global symbol "$Filename2Fields" requires explicit package name at /Au +dio/scripts/cnvWav2Flac line 138. Global symbol "$Filename2Fields" requires explicit package name at /Au +dio/scripts/cnvWav2Flac line 142. Global symbol "$Filename2Fields" requires explicit package name at /Au +dio/scripts/cnvWav2Flac line 146. Use of uninitialized value at /Audio/scripts/cnvWav2Flac line 154.
        Then I had a laugh when I thought, just, *maybe*, the @EXPORTS needs to be in BEGIN too...
        Global symbol "$abr" requires explicit package name at /Audio/scripts/ +cnvWav2Flac line 245. Global symbol "$cbr" requires explicit package name at /Audio/scripts/ +cnvWav2Flac line 245. Global symbol "$minbitrate" requires explicit package name at /Audio/s +cripts/cnvWav2Flac line 245. Global symbol "$preset" requires explicit package name at /Audio/scrip +ts/cnvWav2Flac line 245. Global symbol "$resample" requires explicit package name at /Audio/scr +ipts/cnvWav2Flac line 245. Global symbol "$lowpass" requires explicit package name at /Audio/scri +pts/cnvWav2Flac line 245. Global symbol "$downmix" requires explicit package name at /Audio/scri +pts/cnvWav2Flac line 245. Global symbol "$addid3v2" requires explicit package name at /Audio/scr +ipts/cnvWav2Flac line 245. Global symbol "$id3v2_only" requires explicit package name at /Audio/s +cripts/cnvWav2Flac line 245. Global symbol "$id3v2_only" requires explicit package name at /Audio/s +cripts/cnvWav2Flac line 245. Global symbol "%lame_vars_to_fields" requires explicit package name at + /Audio/scripts/cnvWav2Flac line 245. Global symbol "$best" requires explicit package name at /Audio/scripts +/cnvWav2Flac line 245. Global symbol "$catalog" requires explicit package name at /Audio/scri +pts/cnvWav2Flac line 245. Global symbol "$catalog_number" requires explicit package name at /Aud +io/scripts/cnvWav2Flac line 245. Global symbol "$CDDB" requires explicit package name at /Audio/scripts +/cnvWav2Flac line 245. Global symbol "$composer" requires explicit package name at /Audio/scr +ipts/cnvWav2Flac line 245. Global symbol "$discid" requires explicit package name at /Audio/scrip +ts/cnvWav2Flac line 245. Global symbol "$disc_number" requires explicit package name at /Audio/ +scripts/cnvWav2Flac line 245. Global symbol "$max_lpc_order" requires explicit package name at /Audi +o/scripts/cnvWav2Flac line 245. Global symbol "$exhaustive_model_search" requires explicit package nam +e at /Audio/scripts/cnvWav2Flac line 245. Global symbol "$qlp_coeff_precision_search" requires explicit package +name at /Audio/scripts/cnvWav2Flac line 245. Global symbol "$force" requires explicit package name at /Audio/script +s/cnvWav2Flac line 245. Global symbol "$replay_gain" requires explicit package name at /Audio/ +scripts/cnvWav2Flac line 245. Global symbol "$silent" requires explicit package name at /Audio/scrip +ts/cnvWav2Flac line 245. Global symbol "$totally_silent" requires explicit package name at /Aud +io/scripts/cnvWav2Flac line 245. Global symbol "$total_discs" requires explicit package name at /Audio/ +scripts/cnvWav2Flac line 245. Global symbol "$performer" requires explicit package name at /Audio/sc +ripts/cnvWav2Flac line 245. Global symbol "$publisher" requires explicit package name at /Audio/sc +ripts/cnvWav2Flac line 245. Global symbol "$best" requires explicit package name at /Audio/scripts +/cnvWav2Flac line 245. Global symbol "$exhaustive_model_search" requires explicit package nam +e at /Audio/scripts/cnvWav2Flac line 245. Global symbol "$replay_gain" requires explicit package name at /Audio/ +scripts/cnvWav2Flac line 245. Global symbol "$qlp_coeff_precision_search" requires explicit package +name at /Audio/scripts/cnvWav2Flac line 245. Global symbol "$totally_silent" requires explicit package name at /Aud +io/scripts/cnvWav2Flac line 245. Global symbol "$silent" requires explicit package name at /Audio/scrip +ts/cnvWav2Flac line 245. Global symbol "$force" requires explicit package name at /Audio/script +s/cnvWav2Flac line 245. Global symbol "$max_lpc_order" requires explicit package name at /Audi +o/scripts/cnvWav2Flac line 245. Global symbol "%flac_vars_to_fields" requires explicit package name at + /Audio/scripts/cnvWav2Flac line 245. Global symbol "$vp" requires explicit package name at /Audio/scripts/c +nvWav2Flac line 245. Global symbol "$vp" requires explicit package name at /Audio/scripts/c +nvWav2Flac line 245. Global symbol "$vp" requires explicit package name at /Audio/scripts/c +nvWav2Flac line 245. Global symbol "$name" requires explicit package name at /Audio/scripts +/cnvWav2Flac line 245. Global symbol "$op" requires explicit package name at /Audio/scripts/c +nvWav2Flac line 245. Global symbol "$data" requires explicit package name at /Audio/scripts +/cnvWav2Flac line 245. Global symbol "$op" requires explicit package name at /Audio/scripts/c +nvWav2Flac line 245. Global symbol "$vp" requires explicit package name at /Audio/scripts/c +nvWav2Flac line 396. Global symbol "$name" requires explicit package name at /Audio/scripts +/cnvWav2Flac line 396. Global symbol "$data" requires explicit package name at /Audio/scripts +/cnvWav2Flac line 396. Quantifier follows nothing in regex; marked by <-- HERE in m/? <-- HER +E :et/ at /Audio/scripts/cnvWav2Flac line 399.
        I guess NOT!! Just by putting the EXPORTS statement in 'Debug' in BEGIN blocks, I get all that?! How does that happen, and why line 245? Ick!... well if it isn't important we can ignore this mess... but if that's considered normal error output in 5.14.2, no probs here... ;-)

        BTW, the same error message happen if I take off the brackets following the package 'Debug', that enclose all of it's code. I put those around packages just to ensure their scope is local, but technically, the package statement should do that. But if I remove those brackets.. boom, same explosion as putting @EXPORTS in a BEGIN block, which, I don't think *should* be needed, (I *hope* not, or I have alot of errors to figure out! ), but when things you think are right don't work, you try 'other' things...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://959181]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-10-23 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls