2012/11/29 <thiagogla...@ticursos.net> > Seu primeiro erro é o operador and. No documento perlop: $ perldoc perlop > você vai descobrir o seguinte: > > " Logical And > Binary "and" returns the logical conjunction of the two > surrounding expressions. It's equivalent to && except for > the very low precedence. This means that it short-circuits: > i.e., the right expression is evaluated only if the left > expression is true. > [...] > C-style Logical And > Binary "&&" performs a short-circuit logical AND operation. > That is, if the left operand is false, the right operand is > not even evaluated. Scalar or list context propagates down > to the right operand if it is evaluated." > > Logo, seu código > > > if($keys >= $min and $keys <= $max){ > > deveria ser if($keys >= $min && $keys <= $max){ >
Eu devo ser muito estúpido... mas alguém que está falando isso (ja é o 3o), poderia fazer o favor de me explicar porque ele deve usar && no lugar do 'and' e qual diferença isso faz no caso deste if específico? E em quais situações deve-se usar o 'and' no lugar de &&? [ ]'s -- Bruno C. Buss http://www.brunobuss.net
_______________________________________________ Rio-pm mailing list Rio-pm@pm.org http://mail.pm.org/mailman/listinfo/rio-pm