eAuction
  Not just another Perl script
Google
Welcome, Guest. Please Login or Register


If you use eAuction a lot and like it or if you make money from eAuction or from eAuction-related activities ...
then the project asks you for a donation in favor of the further development.



The forums are protected by
AccessControl
(written by Dieter Werner)
Click here if you want to check your IP against the most important RBLs of the net.
Click here in order to visite the AccessControl forums.


<< Visit the international e Auction Marketplace >>
Buy and sell PC and Consumer Electronic components






  HomeHelpSearchLoginRegister
 



Pages: 1
already closed (Read 726 times)
ernestb
eAuction User
**
Offline

I love Perl -
Sometimes

Posts: 5
USA
already closed
08/15/04 at 02:04:43
 
As I said before This is a great improvement over the old code, but I just can't seem to get it to run.

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

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.

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?
Back to top
 
 


Advertising
View Profile   IP Logged
Dieter Werner
Administrator
*****
Offline

Dipl. Paranoiac ®

Posts: 1162
Germany
Gender: male
Re: already closed
Reply #1 - 08/15/04 at 11:55:04
 
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
Back to top
 
 

Multimedia file viewing and clickable links are available for registered members only!!  You need to Login or Register!!


Greetings from Germany
Dieter Werner




Advertising
View Profile | WWW   IP Logged
ernestb
eAuction User
**
Offline

I love Perl -
Sometimes

Posts: 5
USA
Re: already closed
Reply #2 - 08/15/04 at 14:38:52
 
FANTASTIC!!! Wink

Adding the lilne

 next unless $item =~ /\.dat$/;

solved the problem.

Thanks a lot!
Back to top
 
 


Advertising
View Profile   IP Logged
Pages: 1


If you like eAuction, please Rate it.
If you don't like eAuction, please Rate it too.


1 is being poor and 10 is being excellent


EveryScript

ip-location


AccessControl - Members Only