OK, this will not enhance your regex-fu, and it may not be the most efficient (in terms of runtime resource allocation) solution, but it's a dead easy one to use, and very efficient in terms of programmer-hours spent on the problem. Following up on jasonk's suggestion, you don't even need it to be the case that the script doing the parsing is calendarview.pl. Simply feed the query string to a CGI.pm object and let it do the parsing for you:
#!/usr/bin/perl
+
use CGI;
use strict;
use warnings;
# note you want everything after the ?
my $querystring='loginid=102138&month=04&year=2003&student_id=&user_ty
+pe=TUTOR&CalendarName=102138Academic&framename=top.index_main&session
+_number=618280744437303';
+
my $q = CGI->new($querystring);
+
foreach my $p ( $q->param() ) {
print "Parameter $p : " . $q->param($p) . "\n";
}
If not P, what? Q maybe? "Sidney Morgenbesser"
-
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.
|