In the future, please don't cross post to different lists.  More to come
below...

>-----Original Message-----
>From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
karthikeyan
>Sent: Sunday, June 23, 2002 10:03 AM

>
>Dear All,
>
>  Hope you are all having a great day.
>
> I have a problem.  I m running a java program through perl like this :
>
>  $cmd = 'java SSLTest';
>
>  It returns output like this :
>
>  Using ClearCommerce SSL Java API Version: release-3-8-3-17 Shipping: 10.0
Tax: 0.0 Time - Sat >Jun 22 07:28:42 2002 Ref# - 12345678 Appr - APPROVED
Code - 123456 AVSCode -  PayServ -  Err  -  >Ord# -
12.45.92.15-1024748922-901932-1575-14
>
>  when you run the program in the command line mode I would get something
like this so that you >don't get confused
>
>Using ClearCommerce SSL Java API Version: release-3-8-3-17
>
>Shipping: 10.0
>Tax: 0.0
>Time - Sat Jun 22 07:28:42 2002
>Ref# - 12345678
>Appr - APPROVED
>Code - 123456
>AVSCode -
>PayServ -
>Err  -
>Ord# - 12.45.92.15-1024748922-901932-1575-14
>
>  Now what I want to do here is get each name and value in a separate
separate variable like :
>
>  $Shipping  will contain 10.0, $Tax will contain 0.0, $Time will contain
Sat Jun 22 07:28:42 2002
>
>  how do I parse those string and store it in a variable.

It looks like the output received in your perl program contains something
other than a "\n" for a record separator.  It could very well be a "\r".
Find this value that seperated each 'record', then do a split on the string.
The write a little loop tossing away the first array line (since you don't
seem to care about storing it), and then use a hash array using 'Shipping',
'Tax', 'Time', etc... as the keys and place the trailing data as the value.

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to