[PBP-pm] what's the correct way to do eval

Randal L. Schwartz merlyn at stonehenge.com
Mon Dec 24 19:59:22 PST 2007


>>>>> "Fayland" == Fayland Lam <fayland at gmail.com> writes:

Fayland> have to replace this:
Fayland> my $has_proc_pid_file = eval "use Proc::PID::File; 1;";

Fayland> it complaints Expression form of "eval" at line 7, column 25. See page 
Fayland> 161 of PBP.

There *is* no replacement for that, which is why PBP is a guide, not a gospel.

What you did is perfectly fine for that task.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


More information about the PBP-pm mailing list