As i told you, i am passing values from Standalone java application to this perl program abc.pl. These are the variables which are set in the beginingof the program. This are with respect to the server. The program previously was the server. Now i want to make them with respect to my machine(LOCAL).
$ErrloglogFile = "/export/data/secure03.principal.com/htdocs /logs/pension/ pnactval.log"; $AcclogFile = "/export/data/secure03.principal.com/htdocs/ logs/pension/pnactval.acclog"; $ArchiveDir = "/export/home/pension/logs/rsc"; $zone = `/usr/bin/date \+\%Z`; $gzip = "/usr/local/bin/gzip -d -c"; $grep = "/usr/bin/grep"; $cgi = "/cgi-bin/pension/utilities/rscdetail"; $cat = "/usr/bin/cat"; $tempDir = "/tmp"; $randnum = int( rand(99999999) ); $tempFile = "$today$randnum.pnactval";
# ReadParse # Reads in GET or POST data, converts it to unescaped text, #and puts one key=value in each member of the list "@in" # Also creates key/value pairs in %in, using '\0' to #separate multiple selections # If a variable-glob parameter (e.g., *cgi_input) is passed #to ReadParse, information is stored there, rather than in #$in, @in, and #%in.
sub ReadParse { local (*in) = @_ if @_; local ($i, $loc, $key, $val); # Read in text if ($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); } @in = split(/&/,$in); foreach $i (0 .. $#in) { # Convert plus's to spaces $in[$i] =~ s/\+/ /g; # Split into key and value. ($key, $val) = split(/=/,$in[$i],2); # splits on the first =. # Convert %XX from hex numbers to alphanumeric $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; # Associate key and value $in{$key} .= "\0" if (defined($in{$key})); # \0 is the multiple se +parator $in{$key} .= $val; } return 1; # just for fun }
As you can see it checks in the beginning portion whether $ ENV{'REQUEST_METHOD'}eq "GET" or "POST". now do i have to make any changes over here? PS: This is not the entire code(just the part of it).

In reply to Re: passing parameters?? by Anonymous Monk
in thread passing parameters?? by Anonymous Monk

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



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.