You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If Pod::EOD is not installed, compilation of this code will fail, even if --doc is not used on the command line. On one hand, S26 implies that code inside of DOC INIT, DOC CHECK, and DOC BEGIN blocks is not executed if --doc is not used; on the other, use Module; statements are normally executed as soon as they're parsed.
Without `--doc`, code inside a DOC block is not executed, but by necessity it still needs to be parsed.
And `use` performs its magic at parse time, not at execution time.
You could special-case DOC blocks so that any `use` statements (and other any compile-time things like phasers) that appear inside them, are ignored when `--doc` was not specified.
But that comes with complications:
1) In case of a module, the precompilation system would have to store and manage two separate precompiled versions of the same file: One for `--doc`, and one without. Alternatively, `--doc` would have to bypass precompilation.
2) A Pod::* module wouldn't be able to export any symbols other than subroutines. If it exports any type names or operators, and the POD block code goes on to use those symbols, it would be a syntax error when run without `--doc` as the symbols wouldn't known to the parser in that case.
Migrated from rt.perl.org#127293 (status was 'open')
Searchable as RT127293$
The text was updated successfully, but these errors were encountered: