[pm-h] madness, genius or confusion?
G. Wade Johnson
gwadej at anomaly.org
Wed Mar 14 15:04:20 PDT 2012
On Wed, 14 Mar 2012 10:44:13 -0500
Bryan Rivera <brivera001 at gmail.com> wrote:
> Has anyone ever seen something like the code snippet below? I came
> across this and figured I was just missing something. Why would you
> want to 'use lib' inside an eval inside a BEGIN block? I think it's
> all kinds of wrong.
>
> BEGIN {
> eval "{ use lib '/usr/prod/xxx/xxx/perl/lib/'; }";
> }
The only reason I can think of is pretty unrealistic.
This construct would protect against the lib.pm module failing and
still execute at compile time.
I would think that if you expected 'lib' to fail to load, there would
not be much else you could do. So, I can't see a legitimate reason to
do it.
But, someone obviously thought there was a reason...
G. Wade
--
The man who says he is willing to meet you halfway is usually a poor
judge of distance. -- Laurence J. Peter
More information about the Houston
mailing list