At 12:50 PM -0500 3/19/02, Mark-Jason Dominus wrote:
> > I'm not sure what's ultimately going on here but quoting the argument
>> to the eval somehow causes it to come up with a different answer than
>> leaving it unquoted:
>>
> > $ perl -e "open qq/<nofile.dat/; print eval('$!{ENOENT}');"
>> 0
>> $ perl -e "open qq/<nofile.dat/; print eval($!{ENOENT});"
> > 2
>

<very large snip>

>I hope this clarifies the meaning of the comment in the taint.t file:

I think so.  Would it be a fair summary to say that the quotes defer
the entire load->tie->fetch sequence until run time where eval can
catch problems at any step, but without the quotes the eval can only
trap problems at the fetch step?  In that case my guess as to what's
happening is that when you defer the module load until run time --
and since module loading includes library calls that can set errno --
the contents of %! at the time of the eval reflect the success or
failure of module loading and not the success or failure of whatever
previous file operation we are testing for.

Thanks for the explanation.  I'm not sure where to go next with this
but we'll probably just have to mark it TODO.

> > --- t/op/taint.t;-0     Mon Mar 11 13:57:22 2002
>> +++ t/op/taint.t        Tue Mar 19 11:29:12 2002
>> @@ -407,7 +407,7 @@
>>      # Try first new style but allow also old style.
>>      # We do not want the whole taint.t to fail
>>      # just because Errno possibly failing.
>> -    test 73, eval('$!{ENOENT}') ||
>> +    test 73, eval($!{ENOENT}) ||
>
>Best,
>-D.


-- 
________________________________________
Craig A. Berry
mailto:[EMAIL PROTECTED]

"... getting out of a sonnet is much more
 difficult than getting in."
                 Brad Leithauser

Reply via email to