So, how do the variables that you want to pass enter the message?
For example, if there is a space between each variable and an equals sign between each value (ie. var1=var1 var2=var2 var3=var3), and they are just entered in on ine line, you'd probably want something like this:
chomp $body; # To get rid of the Carriage Return from the STDIN
foreach my $temp (split(/ /,$body)) { # This will generate a loop for
+each variable/value pair by splitting on spaces
my @variable = split (/=/,$temp); # This splits by the equals sign
+ that is delimiting our values and variable names
$vars{$variable[0]} = $variable[1]; # So generate a hash of the va
+riable name and the variable value
}
This will allow you to generate the proper hash that you need to pass. As far as the web stuff goes, I'd better leave that to somebody else as I really haven't got a huge amount of experience with it, but it looks OK to me.
-
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.
|