develooper Front page | perl.beginners | Postings from October 2009

Need explanation about this code.

Thread Next
From:
Raheel Hassan
Date:
October 8, 2009 09:00
Subject:
Need explanation about this code.
Message ID:
fcb728f20910080900x71586172ndc975789aedd8076@mail.gmail.com
Hello,

I have problems in understanding $#{@$ use ?????

1- my $ref = $$temp_sth -> fetchall_arrayref({});
    for(my $i=0; $i <= $#{@$ref}; $i++) {
    push(@$temp_table,$ref->[$i]);}

Can some one explain the under given function.
2- sub buildSensorsHashtable
    {

   my ($dbh) = @_;
   my $error = 0;

         my $query = "SELECT * FROM Sensors";
         my $sth = $dbh->prepare($query);
         if(!$sth || !($sth->execute())) { $error = 1 ;
 }

         my $ref = $sth->fetchall_arrayref({});
         my %s;
         my @s = @$ref;
    foreach (@s)
    {
        if($_->{"StatusID"} eq "1") { $s{$_->{"IP"}} = $_->{"SensorID"}; }
    }

    return (\%s,$error);

3- Which is the best tool for debuging perl programs having CGI support. I
used DDD but that does not support CGI.

Regards,
Raheel


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About