in reply to Require everything between innermost <code></code> tags to compile.

Thanks for all the responses.

Although many mentioned uses of code that are for snippets, , program output, etc., this could be resolved with a new tag, such as <lit>stuff here</lit>, which would act like code tags in everyway except trying to compile the ontents.

The issues of code that runs in BEGIN blocks is much tougher. This would have to be dealt with or disabled, diminishing the usefulness of this tool.

As far as people posting in other languages, screw 'em, there are no other languages. JUST KIDDING!

An additional problem: if perlmonks is on *NIX, (Netcraft indicates FreeBSD) Win32:: modules have no chance of working.

If this were to be implmented at all, it would have to be an advisory, rather than a requirement.

Thanks again, everyone.

--Bob Niederman, http://bob-n.com
  • Comment on Re: Require everything between innermost <code></code> tags to compile.
  • Download Code

Replies are listed 'Best First'.
Re: Re: Require everything between innermost <code></code> tags to compile.
by diotalevi (Canon) on Aug 02, 2003 at 23:50 UTC

    Keep in mind that if you prevented me from saying BEGIN {...} that I could always say it another way. Similar tricks can be played with overload as well. Anyone know of other modules I can get to execute arbitrary code during BEGIN?

    use lib sub { die 'bad code' }; use foo_bar;
      perl -le 'use if eval("print `echo hello`"), CGI; BEGIN{ print "goodbye"}'
      -sauoq
      "My two cents aren't worth a dime.";