Just to add to what the others have said, you might find this little script useful:
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use Data::Dumper;
my $q = CGI->new();
my %var = $q->Vars();
my $log_file = '/path_to_log';
open(LOG,">>$log_file") || err("Can't open log file: $!");
print LOG "URL: $ENV{REQUEST_URI}\n\n",
Dumper(\%var,\%ENV)."\n\n",
'=' x 60,
"\n\n";
print $q->header('text/plain').
"Everything's OK";
sub err {
print $q->header('text/plain').
"ERROR: $_[0]";
exit(0);
}
exit(0);
Save that as MyScript.pl and set $log_file to point to a file that you can write to.
Then, when the script is called:
- $VAR1 will list the parameters sent - accessible through $q->param('VARNAME').
- $VAR2 will list all environment variables, including the HTTP headers sent, accessible through $ENV{VARNAME}. (%ENV is a "special" Perl variable. You might also want to read up on that too)
So, you can call it with various query string info to see what variables get set, and you can ask your manager to request the URL so that you can see exactly what HTTP header his request is sending.
Hope this is useful to get you started.
cLive ;-)
Update: added err() sub (oops :)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.