[ABE.pm] recent code

Ricardo SIGNES rjbs-perl-abe at lists.manxome.org
Sun Jul 4 21:55:07 CDT 2004


* Lidie Steve <sol0 at Lehigh.EDU> [2004-07-04T22:44:58]
> I saw good sig recently:
> 
> >There are 10 kinds of people in the world:
> >those who understand binary, and those who don't.

I saw that on a t-shirt once. :)

> Then again, I've always been an octal kind of hacker, but that's still 
> just another kind of binary.

I've never been good at doing octal in my head.  Binary, hex, and
decimal work out, and beyond that I get confused.

> >Nope!  -Mblib will only find blib and put it into your path.  It won't
> >actually use the code in there.  So, this would've worked:
> >
> > perl -Mblib -MAcme::ProgressBar -e'progress {sleep 5}'
> 
> But it always works for *my* modules ;) (and typically others!).  Then 
> again, they're mostly Tk modules.

Well, there's two ways to guess at why that worked!  One is that Tk
automatically requires modules as needed.  (I'm guessing, but it seems
reasonable.)  That is, you say something like
$window->addWidget('Mirror') and it goes and requires
Tk::Widget::Mirror.  Since you've used blib, it knows to look for that
in blib, so it finds it.

As for the other...

> >I never use blib, for no good reason.  I always use -I lib, since it
> >saves me having to 'make' before testing.
> >
> 
> Do not grok, grasshopper.
> 
> For brevity this always works for me:
> 
> perl Makefile.PL
> make test
> perl -Mblib examples/progress1.pl

Aha!  So you're using blib and then running a script... but that script,
surely, has 'use Your::Code' in it, so it knows where to find stuff.
So, it's like saying -Mblib -MYour::Code

-I lib adds "lib" to the @INC path.  -Mblib looks through directories
under .  trying to find one named blib, and when it does, it adds it to
the @INC path.  That's all.  So, the modules you need still need to be
required/used elsewhere.

Code only gets put into blib when you run make.  I usually leave my code
sitting in lib for casual testing, of which I do a lot, since it saves
me a step of 'make'-ing and I can just run the tests I care about with
the 'prove' program from Test-Harness.

-- 
rjbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/abe-pm/attachments/20040704/68d39328/attachment.bin


More information about the ABE-pm mailing list