Gossamer Forum
Home : General : Perl Programming :

Re: [Andy] test for file exist not working

Quote Reply
Re: [Andy] test for file exist not working In reply to
ok, it's working for some files but not others, even those in the same directory! it seems chomp helped.
Code:
if (/\$db_file_name/) {
$_=~s/\$db_file_name//g;
chomp $_;
$_=~s/[=';]//g;
$_=~s/\#.*$//g;
$_ =~ s/\$db_data_path/$db_data_path/g;
$_ =~ s/\$db_script_path/$db_script_path/g;
$_ =~ s/"//g;
$_ =~ s/ . //g;
$_ =~ s/ //g;
$_ =~ s/\.\///;
$db_file = $_;
}
it's printing:
Code:
/var/home/delicia/delicia.com/cgi-bin/public/data/common/logins.db not found
/var/home/delicia/delicia.com/cgi-bin/public/data/common/menu.db found
logins.db and menu.db are in the same directory; both exist and are not empty.
here's excerpt of menu.cfg:
Code:
# Full Path and File name of the database file.
$db_file_name = $db_data_path . "/common/menu.db";
# Full path and file name of the counter file.
and logins.cfg:
Code:
# Full Path and File name of the database file.
$db_file_name = $db_data_path . "/common/logins.db";
# Full path and file name of the counter file.
i can't see any difference and can't understand why one works and the other doesn't
Subject Author Views Date
Thread test for file exist not working delicia 11633 May 25, 2018, 11:17 AM
Post Re: [delicia] test for file exist not working
delicia 11384 May 25, 2018, 11:20 AM
Thread Re: [delicia] test for file exist not working
Andy 11380 May 26, 2018, 12:59 AM
Thread Re: [Andy] test for file exist not working
delicia 11374 May 26, 2018, 6:12 AM
Thread Re: [delicia] test for file exist not working
delicia 11375 May 26, 2018, 6:29 AM
Thread Re: [delicia] test for file exist not working
delicia 11370 May 26, 2018, 6:53 AM
Thread Re: [delicia] test for file exist not working
Andy 11363 May 27, 2018, 1:16 AM
Thread Re: [Andy] test for file exist not working
delicia 11341 May 28, 2018, 8:36 AM
Post Re: [delicia] test for file exist not working
Andy 11324 May 28, 2018, 11:06 PM