FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
open(FILE, "< $_[0]") or die "can't open $_[0]: $!";
Line 380 above makes the name.cgi exit in case $_[0] (the first element in @_ array) cannot be opened with a filehandle.
Maybe you can add a print statement just before this line, to check the contents of @_ or $_[0]?
Usually, the @_ array is set from the results of previous code (that are not "caught" explicitly in variables). It's Perl's default
variable for storing everything.
Line 380 above makes the name.cgi exit in case $_[0] (the first element in @_ array) cannot be opened with a filehandle.
Maybe you can add a print statement just before this line, to check the contents of @_ or $_[0]?
Usually, the @_ array is set from the results of previous code (that are not "caught" explicitly in variables). It's Perl's default
variable for storing everything.
OK. Sounds like a plan! But what print statement should be added just before this line?
Remember, I am the guy spitting watermelon seeds, not as proficient on this as I hope to be some day.
I'm also wondering, since it's supposed to be a CGI script - what are the CGI parameters it ingests?
How is it supposed to be called from the web site?
So my guess is that the print will print an empty string ("").
Perhaps it could be useful to add something like
I'm also wondering, since it's supposed to be a CGI script - what are the CGI parameters it ingests?
How is it supposed to be called from the web site?
So my guess is that the print will print an empty string ("").
Perhaps it could be useful to add something like
Code:
print "FILE - " $_[0] " -";
to make it stick out more.
OK. I'll try that in the morning. Thanks for your help.
I'm also wondering, since it's supposed to be a CGI script - what are the CGI parameters it ingests?
How is it supposed to be called from the web site?
So my guess is that the print will print an empty string ("").
Perhaps it could be useful to add something like
Code:
print "FILE - " $_[0] " -";
to make it stick out more.
OK ... tried that and got the following:
Scalar found where operator expected at ./name.cgi line 380, near ""FILE - " $_"
(Missing operator before $_?)
String found where operator expected at ./name.cgi line 380, near "] " -""
(Missing operator before " -"?)
syntax error at ./name.cgi line 380, near ""FILE - " $_"
Execution of ./name.cgi aborted due to compilation errors.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.