At 12:45 -0700 2002.07.31, Noah Hoffman wrote:
>I call a function, runTestHarness() that uses the Win only Iprocess mod.
>If I >comment out the few lines in this function that use the words
>imported from
>Iprocess.pm, everything compiles.  But when I include the lines in the
>function >(example below), I get an error like:
>
>       "Bareword 'INHERITED' no allowed while 'strict subs' in use"
>
>Is there a way to conditionally compile the code in the runTestHarness
>function >as well?

I am not sure what the problem is.  A similar example:

        #!perl -wl
        use strict;

        runTestHarness();

        BEGIN {
                if ($^O eq 'MacOS') {
                        # now importing all the constants
                        eval "use MacPerl qw(kMacPerlQuitIfFirstScript)";
                }
        }

        sub runTestHarness {
                print kMacPerlQuitIfFirstScript;
        }

It prints "3", as it should.  Maybe you have something else going on?
However, you could try putting the () after the subroutine, and see if that
helps.  But my guess is that there is something wrong with your
conditional, that it is not getting executed properly ... ?

-- 
Chris Nandor                      [EMAIL PROTECTED]    http://pudge.net/
Open Source Development Network    [EMAIL PROTECTED]     http://osdn.com/

Reply via email to