Dear Michael,

  May be I didn't put my question properly.  When I run the following code.

<snip>

#!d:/karthikeyan/programs/perl/bin/perl -w
print "Content-type:text/html\n\n";
use strict;
my $line = 'Using ClearCommerce SSL API Version:  release-3-8-3-17 Thu Mar
15 10:33:06 CST 2001
Charge Total: 20.00
Time - Sat Jun 29 15:32:19 2002
Ref# - 12345678
Appr - APPROVED
Code - 12345612345678
Err  -
Ord# - 12.45.92.15-1025382739-376645-13757-21';
my @colon = $line =~ /(\S+):\s+(\S+[^:])/g;
my @hyphen = $line =~
/(\S+)\s-\s([^-]+)(?:\s[^-]+){2}|(\S+)\s-\s(\S+)\s*$/g;
for (@hyphen) {
next unless defined;
push @colon, $_;
}
my %hash = @colon;
for (sort keys %hash) {
print "$_ == $hash{$_}\n"
}
exit 0;

</snip>

I am getting the following output

<output>
Code == 12345612345678 Ord# == 12.45.92.15-1025382739-376645-13757-21 Time
== Sat Jun 29 15:32:19 Total == 20.00 Version == release-3-8-3-17
</output>

These are the name along with its value missing

<missing>
Ref# - 12345678
Appr - APPROVED
</missing>

I am not good at Regexp so cant say what I need to include in the search to
make this work.  Otherwise this code is great :).

  Let me know what you think.

  Have a great day.

karthikeyan.


----- Original Message -----
From: Michael D. Schleif <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, June 30, 2002 6:03 AM
Subject: Re: [Perl-unix-users] Perl with Java - ONCE AGAIN


>
>
> karthikeyan wrote:
> >
> > Dear Michael
> >
> >   This code worked for me great.  Just one thing I am not able to get
the
> > value of [ Appr ] why is that??
>
> [ snip ]
>
> Based on your single example -- where `Appr' has *no* value -- I cannot
> say.
>
> Perhaps, when you provide an example that fails, then we can proceed . .
> .
>
> > > > karthikeyan wrote:
> > > >
> > > >   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
>
> [ snip ]
>
> --
>
> Best Regards,
>
> mds
> mds resource
> 888.250.3987
>
> Dare to fix things before they break . . .
>
> Our capacity for understanding is inversely proportional to how much we
> think we know.  The more I know, the more I know I don't know . . .
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>


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

Reply via email to