programming-examples/perl/CGI/Read the data passed to a script on the command line.pl

34 lines
591 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
<HTML>
<HEAD>
<TITLE>CGI How-to, ReadC_pl Test Form</TITLE>
</HEAD>
<BODY>
<A HREF="index.pl?test+query+string">Press here to try the test command line string.</A>
</BODY>
</HTML>
File: index.pl
#!/usr/local/bin/perl
sub readCommandLineData
{
local(*queryString) = @_ if @_;
$queryString = join(" ",@ARGV);
return 1;
}
print "Content-type: text/plain\n\n";
&readCommandLineData(*data);
print "The command line data is:\n\n";
print $data;
print "\n";