roopra has asked for the wisdom of the Perl Monks concerning the following question:
Hi, Am trying to fix a bug in the Perl CGI code.
Below is the message
Status: 500 Content-type: text/html <h1>Software error:</h1> <pre>fileparse(): need a valid pathname at login.cgi line 34. </pre> <p> For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error. </p> [Fri Jul 6 21:02:17 2018] login.cgi: fileparse(): need a valid pathna +me at login.cgi line 34.
please help
The error is coming from line " my $dir=dirname($ENV{'SCRIPT_FILENAME'});" Please help Thanks in advance#!/usr/bin/perl -w #use strict; use DBI; use Carp; use File::Path; use File::stat; use File::Basename; use Cwd; use CGI; use CGI::Carp qw(carpout fatalsToBrowser); use Digest::MD5 qw(md5_hex); #use lib "$ENV{'DOCUMENT_ROOT'}/home/honeyisl/public_html/cgi-bin/sche +dule"; use lib "/home/honeyisl/public_html/cgi-bin/schedule"; use SUBS; use DBDAT; no warnings 'uninitialized'; #use lib "$ENV{'DOCUMENT_ROOT'}/home/honeyisl/public_html/cgi-bin"; use lib "/home/honeyisl/public_html/cgi-bin"; use Date::Manip; use Apache::DBI (); use Mail::Mailer; use Exporter; # P A R A M S A N D V A R I A B L E S my $q = CGI->new; my $action=$q->param("submit") || 'Annonymous'; my $user=$q->param('user'); my $msg=$q->param('msg'); #-------------------------------------------------------------------- my $md5 = Digest::MD5->new; my $digest; my $dir=dirname($ENV{'SCRIPT_FILENAME'}); #my $dir=cwd(dirname($ENV{"SCRIPT_FILENAME"}));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fileparse(): need a valid pathname
by haj (Vicar) on Jul 06, 2018 at 18:46 UTC | |
|
Re: fileparse(): need a valid pathname
by hippo (Archbishop) on Jul 06, 2018 at 20:04 UTC | |
|
Re: fileparse(): need a valid pathname
by eyepopslikeamosquito (Archbishop) on Jul 08, 2018 at 11:18 UTC | |
|
Re: fileparse(): need a valid pathname
by Anonymous Monk on Jul 06, 2018 at 19:32 UTC | |
|
Re: fileparse(): need a valid pathname
by ikegami (Patriarch) on Jul 09, 2018 at 03:10 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |