Gossamer Forum
Home : Products : DBMan : Customization :

Auto-delete mod...can't locate html.pl

Quote Reply
Auto-delete mod...can't locate html.pl
I've been working on trying to install the Auto-Delete mod found on Eliot's site. I reconfigured my config and html.pl file and followed the instructions to a T. When I try to run the mod from my server's console (Linux 6.0 running the latest versions of Apache and perl) I recieve the following error.

Can't locate /homeagain.pl in @INC (@INC contains: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 .) at /home/httpd/cgi-bin/dbmantest/homeagain.cfg line 55.

Dbman is fully functional and works well. If anyone can give me any clues/help on what the problem may be, it would be greatly appreciated

Thanks

Mike
Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
How are you requiring html.pl???

Make sure it is the full ABSOLUTE directory and file name on your server.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
Also...The deletion script I wrote does not require the html.pl file...It requires the default.cfg file.

You need to add or make sure you have the DateAdded Field and Removeby field in your default.cfg file and also in the html.pl file.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
Thanks for your help Eliot

The default.cfg require the html.pl file. To work around that I copied the default.cfg file to delete.cfg, removing the require html.pl line. It seems to work, but when I run the delete.cgi script from the server console all I recieve is the following line

Content-type: text/plain

I know there is one file that should have been deleted, but it wasn't.

Do you have any suggestions

Thanks once Again

Mike
Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
Welp...It doesn't make any sense...Because I have the html.pl required in the default.cfg file and it works beautifully.

Make sure that you have the Removeby Field defined and also that you have a DateAdded field. If you are missing either of these fields, then it won't work.

Also, make sure that if you have added a field to your database configurations in the db_def hash, you need to use my script to add the extra delimiter and default value (which can be blank). Make sure that you have a value of days (1-360) in your Removeby field.

If you don't, then the record will NOT be deleted.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
I declared and assigned the removeby and dateadded fields from the get go. I think that it may not be able to open up the database
Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
If you would like to take a look at my cfg and delete.cgi script it maybe viewed at

http://www.homeagain.org/cgi-bin/dbmantest/delete.txt cfg file
and
http://www.homeagain.org/cgi-bin/dbmantest/deletecgi.txt cgi script

Thanks one again
Mike
Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
corrections to the URLs

cgi script
http://www.homeagain.org/deletecgi.txt

cfg file
http://www.homeagain.org/delete.txt

The delete.cgi script is meant to be a stand-alone script, correct???


[This message has been edited by mbe1908 (edited December 29, 1999).]
Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
The problem must be in two other files:

1) html.pl
2) default.db

Please save these files as text files, upload them to a publicly accessible directory, and then post the URL where we can find them.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------


Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
Thanks once again for ALL of your HELP, I truly appreciate it. )

Here are the URL to the files

html.pl
http://www.homeagain.org/homeagainpl.txt

db file

http://www.homeagain.org/homeagaindb.txt

Thanks

PS I tried to auto delete the first record, but it did not work

[This message has been edited by mbe1908 (edited December 29, 1999).]
Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
Hmm...I looked at your database. The best way to test it is to reset the first record to a recent date like today and then set the Removeby field to 1. Then check the database tomorrow. It should be deleted.

Also, I would recommend using a test database to see if it works. Using a live database is a poor decision and only leads to trouble.

BTW: What appears when you try to execute this script?

Also, I would suggest using a drop-down menu by using the db_select_field option for the RemoveAd field. Putting a range of days is much better than having people type in days.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------




[This message has been edited by Eliot (edited December 29, 1999).]

[This message has been edited by Eliot (edited December 29, 1999).]

[This message has been edited by Eliot (edited December 29, 1999).]
Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
my $dateadded_field = 20;

my $today = &date_to_unix(&get_date);
my (@lines, @values);

print "Content-type: text/plain\n\n";
open (DB, $db_file_name) or (print "Can't open: $db_file_name Reason: $! \n");
if ($db_use_flock) {
flock (DB, 1);
print "DB is open\n";
}
print "I'm before the @lines =<DB> in the first open DB statement \n";
@lines = <DB>;
close DB;

open (DB, ">$db_file_name") or (print "Can't open:$db_file_name. Reason: $!\n");
if ($db_use_flock) {
flock (DB, 2);
print "I'm at the second open DB \n";
}
print "Right before the foreach lines \n";
foreach (@lines) {
print "I'm at the foreach loop \n";
next if /^#/;
next if /^\s*$/;
chomp;
@values = &split_decode ($_);
print "Comparing: '$today' vs '$values[$removeby_field]' ... \n";
if ($today > (&date_to_unix($values[$dateadded_field]) + (86400 * $values[$removeby_field]))) {
print "Record(s) Deleted\n";
next;
}
print DB $_, "\n";
}
close DB;

I placed some troubleshooting lines in your Auto-Delete mod, below is the output I recieved when I try to run the script.

Content-type: text/plain

DB is open
I'm before the =<DB> in the first open DB statement
I'm at the second open DB
Right before the foreach lines

The program is having trouble at the foreach(@lines) loop. Do you have any suggestions why the Mod is having problems with this loop.

Thanks for your help. Also, this is a test DB, I merely copied all the live DB files into a test directory so I can have live data to experiment with.

I'm going to try to play with it some more, but if you have any ideas, please let me know. Thanks

Mike
Quote Reply
Re: Auto-delete mod...can't locate html.pl In reply to
Nope...And I already have "trouble" lines in the codes.

I do NOT know why it is not working for you.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------