Re: Perl Issues

From: Jared Still <jkstill_at_gmail.com>
Date: Fri, 22 Feb 2008 10:02:37 -0800
Message-ID: <bf46380802221002i3d76d72cg1a140fe0c1535f95@mail.gmail.com>


On Thu, Feb 21, 2008 at 1:26 PM, <JApplewhite_at_austinisd.org> wrote:

> My two questions:
> 1. Can Exception Handling be easily done in Perl? If so, any good
> examples I can point them to?

As others have already stated, Perl is very robust in the exception handling department.

>
> 2. They say that Perl can't handle Boolean values. Is that true? Any
> guidance here?
>

There's no direct boolean type, but that really should not matter. The 'if' statement detects 0 as false and non-zero as true.

Here's a trivial example;

my $sql=q{select rownum from all_users order by rownum}; my $sth = $dbh->prepare($sql,{ora_check_sql => 0}); $sth->execute;

while( my $ary = $sth->fetchrow_arrayref ) {

   my $rownum = $ary->[0];
   my $bool = $rownum % 2; # % is modulus operator    if ($bool) {

      print "this is true - $rownum : $bool\n";    } else {

      print "this is false - $rownum : $bool\n"    }
}

-- 
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Feb 22 2008 - 12:02:37 CST

Original text of this message