[luau] Perl Frustration!!

Deven Phillips dphillips at gothic-hawaii.com
Tue Aug 19 06:47:01 PDT 2003


Blech!!! Perl DBI is frustrating in and of itself... The C API is much cleaner!!!

Deven


On Sunday 17 August 2003 01:55 pm, Matt Darnell wrote:
> > Aloha,
> >
> > I am writing the following routine:
> >
> > while (my $row_ref6 = $sth6 ->fetchrow_arrayref){
> >      if (@{$row_ref6} == '1') {
> >           print "Status is @{$row_ref6}\n";
> >      }
> > }
> >
> >
> > The database access works fine.  It produces the following output
> >
> > Status is 0
> > Status is 1
> > Status is 0
> >
> > I only want to know when the value is 1.  I have a feeling it evaluates
> > to true simply because it exists.
> >
> > When I try to convert it to a scalar it changes the 0's to a 1.
> >
> > I have subsituted 'eq' for '==' to no avail.
>
> I don't know if it possible to get where I was going from the above code,
> but this code:
>
> while (my @result = $sth6 ->fetchrow_array){
>      if (@result[0] == "1") {
>           print "Status is @result\n";
>      }
> }
>
> Acheives the correct result.  Maybe it was returning the amount of items in
> the hash?
>
> -Matt
>
> _______________________________________________
> LUAU mailing list
> LUAU at videl.ics.hawaii.edu
> http://videl.ics.hawaii.edu/mailman/listinfo/luau




More information about the LUAU mailing list