In Configure.pl, one of the things I do is include Data::Dumper if it's
there, and skip the part that needs it otherwise.  Unfortunately,
because of the compile-time nature of use, I can't do it.  Thus, I have
to use the following hack:

        my($DDOK)=eval {
                require Data::Dumper;
                import Data::Dumper;
                1;
        }

Ugly, no?  What I propose to fix it is that, if I do something like
this:

        $DDOK=1;
        try {
                use Data::Dumper;
        }
        catch {
                $DDOK=0;
        }

and Data::Dumper doesn't load, the use statement be transmogrified:

        $DDOK=1;
        try {
                throw "Can't find Data/Dumper.pm in \@INC (\@INC contains: @INC)";
        }
        catch {
                $DDOK=0;
        }

However, the transmogrification only occurs if a use is in a try block;
otherwise we get the same die-at-compile-time behavior.

In other words, I want exceptions thrown at compile-time to be catchable
at run-time by surrounding try blocks.  Are there any barriers to this
working?  If so, what are they?

--Brent Dax
[EMAIL PROTECTED]

They *will* pay for what they've done.

Reply via email to