This is an archived low-energy page for bots and other anonmyous visitors.
Please sign up if you are a human and want to interact.
in reply to Re^2: everyauction script error bidding errors in thread everyauction script error bidding errors
simonwilliams,
- if ($#bids){...}
does what you mean, but it doesn't really say what you mean. For that, you should say
if (@bids > 1){ ... };
i.e., if @bids contains more bids than one, then ...
- for (my $i=1; $i<scalar(@bids); $i++) { ... }
could be written ...
for (my $i=1; $i < @bids; $i++) { ... }
... without any change in meaning. @bids is being evaluated in a scalar context. No need to say scalar() explicitly.
- Let me oversimplify your problem, and you can build on that. You want to choose the highest bid, excluding your own from consideration (always the first bid), and print only the highest bid.
my $highest;
if (@bids > 1){
for (my $i = 1; $i < @bids; $i++) {
my ($alias,
$email,
$bid,
$time,
$add1,
$add2,
$add3,
$oqty,
$soldqty) = read_bid($bids[$i]);
$highest = $bid > $highest ? $bid : $highest;
}
print "Highest bid: $highest\n";
}
mkmcconn
|