develooper Front page | perl.perl5.porters | Postings from April 2014

[perl #121631] Version of do() which compiles only - a feature suggestion

Thread Previous
From:
Tony Cook via RT
Date:
April 28, 2014 06:18
Subject:
[perl #121631] Version of do() which compiles only - a feature suggestion
Message ID:
rt-4.0.18-7175-1398665913-615.121631-15-0@perl.org
On Thu Apr 10 11:32:07 2014, porton@narod.ru wrote:
> Please add a variant of do() function which will only compile the
> referenced
> Perl file (and make its routines available to the calling file),
> without
> executing any imperative code (except of such things as `use` and
> `BEGIN`
> blocks) in the included file (like `perl -c` does).

I don't think this is practical.

'use'd modules can define classes and export functions that change how your code is parsed, meaning code that is otherwise valid would fail to compiler under this option.

Also, in the other direction, C< use strict; > can make code that's valid without it invalid.

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=121631

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About