in reply to Re: Embedded Syntax Checker?
in thread Embedded Syntax Checker?

Thanks for your response. I didn't think of code being executed in the BEGIN block so that's a good point - an interesting, example, too. In my case, there shouldn't be any intentional maliciousness - in fact, the user will have no more (or less) access than they would under normal circumstances.

I guess wrapping in sub was the key that I overlooked. Thanks a lot! Thanks also to merlyn and everyone else who responded so quickly!


-- Andy

Replies are listed 'Best First'.
Re: Re: Re: Embedded Syntax Checker?
by dragonchild (Archbishop) on Apr 22, 2004 at 15:26 UTC
    Note, there are many ways a BEGIN block can get executed without ever having the word BEGIN in your code. For example:
    # In Test.pm package Test; sub import { print "Boo!\n"; } 1; -------------- # In your script use Test;

    Where's the BEGIN?

    There actually was a question/meditation on here about 2 years ago on this very topic. I don't remember the details, but the OP was remarking that he was running into a forking/threading/caching/whatever issue. It turned out that there was a module about 4 levels back into the uses that was doing something he didn't want. And, it was happening at compile-time, so he couldn't disable it.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose