in reply to Re: can't seem to import properly when using require
in thread can't seem to import properly when using require

Perfect! Thanks!

  • Comment on Re^2: can't seem to import properly when using require

Replies are listed 'Best First'.
Re^3: can't seem to import properly when using require (test more)
by tye (Sage) on Feb 27, 2012 at 02:05 UTC

    I see you have yet to test in an environment where Term::ANSIColor isn't installed.

    You also didn't actually show any of the code where the errors actually happen.

    You can't conditionally use compile-time magic unless you also only conditionally compile the magic-using code.

    So, I usually drop the BEGIN block and fix my code so it does not depend on compile-time magic from the optional module. But, looking at the docs for Term::ANSIColor, it looks like it flings compile-time magic all over the place. So you might find it easier to conditionally compile any code that makes use of said magic.

    Not that I will help with that since you didn't include any of said magic-using code (that was failing).

    - tye