Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have this front end javascript that calls my perl like this when I click a link:
cgi-bin/rpt.pl?dataname=ASRHOUR
The problem is, the very first thing I do in the perl is check which parameter for dataname is sent, but it isn't populating! Here is the beginning:
use strict; use File::Glob ':glob'; use DBI; use JSON; use POSIX qw(strftime); use POSIX ":sys_wait_h"; use warnings; use CGI; use CGI::Carp qw/fatalsToBrowser/; use Data::Dumper; my $query = CGI->new; my $reportname = $query->param('dataname'); print $query->header; print Dumper $query;
And nothing is pushed into $reportname. It's blank. If I execute the script directly, and not thru the button click, it reports data fine. The kicker is, I have the newest Firebug in firefox installed, so it's SHOWING me the correct parameter name. If I hard code $reportname, it works great. So basically I execute
http://localhost/cgi-bin/rpt.pl?dataname=ASRHOUR
It's fine I see in firebug this being executed through the GUI:
http://localhost/cgi-bin/rpt.pl?dataname=ASRHOUR
And nothing happens. So I am under the impression I am not catching the parameter correctly. Also, under the params section in the Firebug, it shows the correct parameter name & value. Please help, I been staring at this all day.

In reply to CGI not catching parameters? by hallikpapa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-16 15:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found