- COPYRIGHT AND LICENSE
eval - Eval code
This document describes version 0.001 of eval (from Perl distribution eval), released on 2019-10-19.
Use in one-liner or in PERL5OPT:
% perl -Meval='$Carp::MaxArgLen = 1000' script.pl % DEBUG=1 PERL5OPT='-Meval=$Carp::MaxArgLen=1000' script.pl eval.pm: Eval'ing: $Carp::MaxArgLen=1000
This pragma lets you run some Perl code before running your script. Some other ways to accomplish the same include:
putting your code in a module and load it using
For example, you put your code in lib/Foo.pm and run your script using:
% PERL5OPT="-Ilib -MFoo" script.pl
% perl -e'$Carp::MaxArgLen = 1000; do "script.pl"'
No whitespace in code in PERL5OPT
Space is used to separate perl options in PERL5OPT, so you can't do:
% PERL5OPT='-Meval=$Carp::MaxArgLen = 1000' script.pl
but you can do:
% PERL5OPT='-Meval=$Carp::MaxArgLen=1000' script.pl
To help you see what code is being eval'ed, set
% PERL5OPT='-Meval=$Carp::MaxArgLen=1000' script.pl eval.pm: Eval'ing: $Carp::MaxArgLen=1000
Bool. If set to true, will show what code is being eval'ed.
Please visit the project's homepage at https://metacpan.org/release/eval.
Source repository is at https://github.com/perlancar/perl-eval.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=eval
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
This software is copyright (c) 2019 by firstname.lastname@example.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.