I do have script with href that calls a cgi script, and I want to pass a value to cgi script from href..first script is link.cgi and it has a line like this:
print "<TD align=center><FONT SIZE='4'><a href='../cgi-bin/call.cgi?param=$path1'>$v_rel</a></FONT>\n";
my $cgi = CGI->new();
my ($param) = $cgi->param('param');
print ".....the value is $param\n";
-T is usually not a good solution. You probably have a potential security issue in your code, and perl with
-T alarmed you about it. By removing
-T, you just masked it but it's still there. The return value of
$cgi->param() is tainted and has to be cleaned up before you pass it to many functions.
use CGI::Carp qw/fatalsToBrowser/; as proposed by @Chris, and if you still get this error have a look at your server error logs that will contain more information about the error.
Sometimes it helps being able to run from the command line and see the errors directly on the command line. Set
QUERY_STRING to your parameter and run your script:
export REQUEST_METHOD=GET export QUERY_STRING=param=WhateverYourPath1Is perl /path/to/call.cgi
NB: you may have to define a few other CGI environment variables depending on your script.