Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ferreira (5993)

  (email not shown publicly)

Just another Brazilian Perl hacker.

Journal of ferreira (5993)

Wednesday February 13, 2008
12:13 PM

What's better? -Ilib or -Mblib?

[ #35649 ]

When testing/playing with a distribution, one usually runs:

$ perl Makefile.PL; make
$ perl -Mblib
# or (with tests)
$ prove -b test.t

Sometime the make (or ./Build) gets annoying and a shortcut is nice:

$ perl -Ilib
# or
$ prove -l test.t

However, there are a bunch of reasons not do that. Among them:

  • -Ilib won't work for modules with XS parts (it will use installed XS components or fail to load)
  • the current build settings may establish an environment different from the current lib/ layout (with modules not in the MANIFEST and things like that)

At the end, we conclude that working under -Mblib is safer (and closer to release conditions) than playing with -Ilib.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • For test debugging (which is what I care about the most, since I spend sometimes hours a day in the perl debugger in tests) I used to do both by putting a sensitive BEGIN block inside the test script itself.

    Mostly it just annoys me there is so much typing to do it properly (-Mblib).

    It was getting really annoying to have to have special code in test scripts to avoid lots of typing.

    So in the end I decided I needed to make a better tool instead, and created pler [], which just Does What You Mean for debugging.