I'm trying to pipe data from this url
http://parazen.bio.indiana.edu/me/monks.html
to this url
http://parazen.bio.indiana.edu/cgi-bin/monks.pl
I'm using GET to transfer the information. However, I can't seem to preserve the carriage returns. How do I do this?
The following is wrapped in |code| tags but it doesn't seem to shrink it. Also sorry about the anonymous post. I don't know why it did that.
getParamaters();
$data = $getParam{'hand_history'};
print "$data <br>";
sub getParamaters{
if ($ENV{'CONTENT_LENGTH'} > 0) {
# read POST data from STDIN
print "READING POST DATA\n";
read STDIN, $temp, $ENV{'CONTENT_LENGTH'};
# add in the GET data:
$temp.="&".$ENV{'QUERY_STRING'} if length <br>$ENV{'QUERY_STRING
+'};
} else {
# read only the GET data
#print "READING GET DATA\n<br>";
$temp=$ENV{'QUERY_STRING'};
}
# separate each keyword
foreach ( split( /&/, $temp ) ) {
# separate the keys and values
( $key, $val ) = split( /=/, $_, 2 );
# translate + to spaces
$key=~s/\+/ /g;
$val=~s/\+/ /g;
# translate %xx codes to characters
$key=~s/%([0-9a-f]{2})/pack("c",hex($1))/gie;
$val=~s/%([0-9a-f]{2})/pack("c",hex($1))/gie;
$getParam{$key} = $val;
}
Edited by Chady -- removed <br> tags from code.
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.