On Fri, Dec 14, 2001 at 05:57:06PM -0500, Michael G Schwern wrote:
> > #how about use's?
> > is(
> >     `perl "-Mlib=stuff -MYup" -e "print 'ok'"`,
> >     'ok',
> >     'affects use'
> > );
> 
> A simple way to trick 'use' is to clear the entry from %INC and then
> eval "use Yup".

I just thought of a better way.  Since all we're testing is that
lib.pm does the right things to @INC, we can presume that if one of
require(), do() or use() works, the rest will work.

So for most everything, set Yup.pm to return some unique value and
then just use do() for most everything.  That way it'll work multiple
times in the same program without eval or `` trickery.

    print YUP <<END;
    package Yup.pm;
    return 42;
    END

    is( do "Yup.pm", 42 );


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
I was *meant* to mount your donuts.

Reply via email to