in reply to everyauction script error bidding errors

for (my $i = $#bids; $i > 1; $i = 1) { my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_b +id($bids[$i]); $time = sort ({ int $a <=> int $b } $time);
The above code makes no sense to me. In the first line above, the $i = 1 at the end of the for loop makes the "loop" pointless because it processes at most one element, namely the last item in the array. In the last line above, sorting a scalar is similarly pointless because you are sorting just one item.

I am assuming you are very new to Perl. I suggest you start by reading the book Learning Perl and having a look around learn.perl.org.

Oh, and always start your scripts with:

use strict;

Replies are listed 'Best First'.
Re^2: everyauction script error bidding errors
by simonwilliams (Initiate) on Jun 21, 2005 at 21:57 UTC
    Is this section the problem because what it is im trying to do is;
    my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bid +s[0]);
    This section reads bid number 0 which in my case is the seller in my .dat files so bid 1 would be the first bidder. I need the script to read each individual bid however many there may be i.e 1 to 22 and pick out if the member who is logged in as form{'ALIAS'} has placed a bid which has been outbid. By using this code i can manualy enter the bidders bid in order however this is no good i need somthing to automatically do this;
    my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bid +s[1]); ----- what ever number the bidder is
    which i thought this section did;
    for (my $i = $#bids; $i > 1; $i = 1) { my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_b +id($bids[$i]); $time = sort ({ int $a <=> int $b } $time);

      Try ...

      if (@bids > 1){ for my $bid (1..$#bids){ my ($alias, $email, $bid, $time, $add1, $add2, $add3) = read_bid($ +bids[$bid]); } }

      As noted elsewhere, your sort on a scalar will not do what you are trying to do, since sort() works on a LIST.
      mkmcconn
      edit: fix artifacts in code copied from elsewhere.