ernestb wrote on 08/15/04 at 02:04:43:I am trying to get eAuction.pl runninng on a system with the following;
Operating System Linux
Kernel Version 2.6.7-1-grsec
Apache Version 1.3.31 (Unix)
Perl Version 5.8.3
The demo of eAuction is running the same system.
ernestb wrote on 08/15/04 at 02:04:43:With items present in all cats I was getting the following eror;
Error
Item: . Category: yourcat07
is already closed
I added
if ($item ne ".." && $item ne ".") {
to the sub get_random_data
orginal code-------
my (
$item, $title, $image, $start_time,
$close_time, $the_bid, @bids
);
opendir THEDIR, "$config{'basepath'}$cat"
or oops("Category $cat could not be opened.");
readdir THEDIR for 0..1;
while (defined($item = readdir THEDIR) and $cnt <= int($disp_max / 2)) {
$item =~ s/\.dat$//;
(
$title,
undef,
undef,
undef,
$image,
$start_time,
$close_time,
undef,
@bids
) = @{read_item_file($cat, $item)};
new code--------
my (
$item, $title, $image, $start_time,
$close_time, $the_bid, @bids
);
opendir THEDIR, "$config{'basepath'}$cat"
or oops("Category $cat could not be opened.");
readdir THEDIR for 0..1;
while (defined($item = readdir THEDIR) and $cnt <= int($disp_max / 2)) {
$item =~ s/\.dat$//;
if ($item ne ".." && $item ne ".") {
(
$title,
undef,
undef,
undef,
$image,
$start_time,
$close_time,
undef,
@bids
) = @{read_item_file($cat, $item)};
};
This solved my problem of trying to open the up dir link but I now have another.
This line:
Code:readdir THEDIR for 0..1;
reads the first two entrys of a directory; that means:
the dot and the doubledot entrys.
Therefore the dot and the doubledot files are not a part of the following read-data
You can use your if statement
Code:if ($item ne ".." && $item ne ".") {
but in this case you have to delete the above mentioned line.
You better should forget the if statement.
This is doing the same:
Code: opendir THEDIR, "$config{'basepath'}$cat"
or oops("Category $cat could not be opened.");
#readdir THEDIR for 0..1;
while (defined($item = readdir THEDIR) and $cnt <= int($disp_max / 2)) {
next unless $item =~ /\.dat$/;
$item =~ s/\.dat$//;
ernestb wrote on 08/15/04 at 02:04:43:Error
Modification of non-creatable array value attempted, subscript -1 at eAuction.pl line 3706.
Bad file descriptor
line3706 is
$the_bid = (read_bid($bids[-1]))->[2];
Any Ideas?
That means: either the item file is empty or there are no seller/bidder data