Marcel Juffermans schrieb:
> 
> In OpenSSL.pm there is a code snippet:
> 
> if( not(defined($outfile)) || $outfile eq "" ) {
>   <snip/>
> } else {
>   <snip/>
> }
> 
> This doesn't seem to work as expected - if $outfile is undefined, then the
> else clause is taken.
> 
> It works as expected if the condition is changed to use 'or' instead of
> '||':
> 
> if( not(defined($outfile)) or $outfile eq "" )
> 
> or even just:
> 
> if( !$outfile )
> 
> I'm not a Perl expert, but this seems weird behaviour to me. We're using
> Perl version 5.005_03 on Linux and Solaris, but I've also reproduced this
> behaviour on 5.001. I first thought it might be operator precedence, but eq
> has higher precedence than ||, so that can't be it.

This is a mistake related to the very high precedence of ||. || and "or"
are doing the same but the precedence of || is much higher than the one
of "or" - see "man perlop". I think that I have to check a lot of code.

thanks Michael  
-- 
-------------------------------------------------------------------
Michael Bell                   Email (private): [EMAIL PROTECTED]
Rechenzentrum - Datacenter     Email:  [EMAIL PROTECTED]
Humboldt-University of Berlin  Tel.: +49 (0)30-2093 2482
Unter den Linden 6             Fax:  +49 (0)30-2093 2959
10099 Berlin
Germany                                       http://www.openca.org

_______________________________________________
OpenCA-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openca-devel

Reply via email to