in reply to Re^3: XML::Twig Support for Parameter Entities (errors)
in thread XML::Twig Support for Parameter Entities
It is pretty darn rare for people to care about the return value from a 'require'
I used that quite often, as in
use Data::Dumper; sub DEVEL() { 1 }; # get sample data my hashref = DEVEL ? require 'sampledata.pl' : do_something_costly(); # later on if ( DEVEL ) { open my $fh, 'sampledata.pl' or die "sampledata.pl: $!"; print Dumper($hashref); }
Also, I use function files for autoloading (function.al) which return an anonymous sub and encapsulate private data in their lexical file scope (see also AutoReloader).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: XML::Twig Support for Parameter Entities (do)
by tye (Sage) on Aug 13, 2015 at 07:16 UTC | |
by shmem (Chancellor) on Aug 13, 2015 at 07:29 UTC | |
by tye (Sage) on Aug 13, 2015 at 07:37 UTC | |
by shmem (Chancellor) on Aug 13, 2015 at 08:23 UTC | |
by tye (Sage) on Aug 13, 2015 at 08:36 UTC | |
|