[SP-pm] Problemas numa comparação

Daniel de Oliveira Mantovani daniel.oliveira.mantovani at gmail.com
Wed Jul 8 10:03:00 PDT 2009


Olha esse código, vai te ajudar.

my $x = 1;
my $y = undef;
my $z = 0;

if ( defined $x ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( defined $y ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( defined $z ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( $x ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( $y ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( $z ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( defined $x and defined $z ) { print "Verdadeiro\n"; } else { print
"Falso\n"; }

if ( $x and $z ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( $x or $z ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( defined $y or $z ) { print "Verdadeiro\n"; } else { print "Falso\n"; }

if ( $y or $z ) { print "Verdadeiro\n"; } else { print "Falso\n"; }


2009/7/8 <claudio em dpreferencial.com.br>

>
> Pessoall, Boa tarde!
>
> Como sempre, estou precisando de um HELP!!!
>
> Estou passando um sistema de Delphi para Perl
> e não tenho consiguido achar indicação
> para desenvolver este trecho do código.
>
> É uma comparação feita como entre Bytes como Boolean.
> ________________________________________________________________
> ________________________________________________________________
> Segue o trecho do código:
>
> Procedure Ver_Conteudo;
>    const BITS: array[0..7] of Byte = (1,2,4,8,16,32,64,128);
>    Res:   Boolean;
> Begin
>
>   Res := Boolean ( BITS[1] and 6 );    // Este é o trecho que me interessa,
>  este resultado dá true.
>
>   if (Res) Then ShowMessage('True') else ShowMessage('False');
>
> End;
>
>  ________________________________________________________________
> ________________________________________________________________
>
> Qualquer ajuda/ luz, ajuda muito...
>
> desde já agradeço a todos.
>
> Abs
>
> Claudio H.Binaghi
> claudio em dpreferencial.com.br
> 5511 3288.4840
>
> _______________________________________________
> SaoPaulo-pm mailing list
> SaoPaulo-pm em pm.org
> http://mail.pm.org/mailman/listinfo/saopaulo-pm
>



-- 
http://mantovanihouse.blogspot.com/
This is my poney:
-------(\_------------_/)-----------
-------)--(----------)--(-----------
------(----(---------)----)----------
-------)----(-------)----(-----------
-------(----(-------)----)-----------
--------\_-(\\.---.//)-_/------------
----------\)' -8--8- '(/--------------
-----------/------------\---------------
----------(--)--------(--)--------------
------------(_c__c_)----------------
----------------------------------------
perl -MLWP::Simple -le 'grep{ print $1 if /href="(http.+?)"/}split($/,get("
http://www.perl.org.br"))'
-------------- Pr?xima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://mail.pm.org/pipermail/saopaulo-pm/attachments/20090708/da736776/attachment-0001.html>


More information about the SaoPaulo-pm mailing list