[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] knas med perl



klavs Klavsen <sslug@sslug> writes:

> .. div. kode
> while(%orow = %{ $osth->fetchrow_hashref()})
>     {
>     print $orow{class};
>        if ($orow{class} =~ /ot_tax/)
>        {$tax = $orow{value}; }
>        if ($orow{class} =~ /ot_total/)
>        {$total = $orow{value};}
>        if ($orow{class} =~ /ot_fixed_payment_chg/)
>        {$bgebyr = $orow{value};}
>        if ($orow{class} =~ /ot_shipping/)
>        {$shipping = $orow{value};}
>        if ($orow{class} =~ /ot_handlingfee/)
>        {$handling = $orow{value};}
>     }

Jeg ved godt at det er en forkert linje, men det eneste stykke kode
jeg kan se skulle give den fejl er i while-betingelsen.

Prøv noget ala:

my $orow;
while($orow = $osth->fetchrow_hashref()) {
    $_        = $orow->{class}; # Pure lazyness
    $tax      = $orow->{value} if /ot_tax/;
    $total    = $orow->{value} if /ot_total/;
    $bgebyr   = $orow->{value} if /ot_fixed_payment_chg/;
    $shipping = $orow->{value} if /ot_shipping/;
    $handling = $orow->{value} if /ot_handlingfee/;
}


-- 
 Peter Makholm     |               Vi smider blade allesammen - hele tiden
 sslug@sslug |                      som et konstant spirende efterår
 http://hacking.dk |                 Og hele tiden vokser nye frugter frem
                   |                  og vi finder nogen til at plukke dem
                   |                            -- Tilt, Perkussive popler


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *