in reply to passing parameters??

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).

Replies are listed 'Best First'.
Use your brain before trying to use mine!
by dragonchild (Archbishop) on Aug 21, 2001 at 19:50 UTC
    As I said earlier ... Have you even tried this out?? Monks like to help people who try stuff and get stumped. We don't do homework or assignments or tell you exactly how to do your job.

    You have a brain - use it. If you don't have the knowledge, ask about specific situations you have run into. Give us error messages. Give us things you've tried. Don't say "I have to do this and I'm stupid. Tell me what to do."

    ------
    /me wants to be the brightest bulb in the chandelier!

    Vote paco for President!

      Thanx a lot for ur advice!! I am directing the output to a file. So this is what it generates when i try to run it:
      contract_number =397011 member_id =000000003 start_date =10/01/2000 end_date =10/01/2000 Content-type: text/html Error Summary Report: No Errors in period </TABLE> <TABLE WIDTH=605 BORDER=0 CELLSPACING=0 CELLPADDING=0> <TR><TD COLSPAN="3">&nbsp;</TD></TR> <TR><TD COLSPAN="3" ALIGN=center><FORM NAME="Contract Query" METHOD="p +ost" ACTION="D:/rsc/rscdetail2"><INPUT TYPE=HIDDEN NAME="prev_contrac +t" VALUE=""> <INPUT TYPE=HIDDEN NAME="prev_start" VALUE="08/21/2001"> <INPUT TYPE=HIDDEN NAME="prev_end" VALUE="08/21/2001"> <INPUT TYPE=SUBMIT VALUE=Back></FORM></TD></TR> runtime=0 second(s)
      First 4 lines are just prints. I tried to test whether the inputs are getting passed from Java to Perl.
        I suppose the next obvious question is "Did you get what you were expecting?" If you did, then there's no issue here. If you didn't, then I suppose you should try to isolate where in your code it's breaking (either through more prints or using the debugger) and then figure out why it's happening. If you cannot figure out the why, then post specific situations and ask for specific help. :)

        ------
        /me wants to be the brightest bulb in the chandelier!

        Vote paco for President!