The file:
Invoice|Process Date|Tracking Number|Ship Method
00000000002|December 23, 2002|1z1234567890|UPS Ground
00000000003|December 23, 2002|1z1234567870|UPS Ground
10000000003|December 23, 2002|1z1234585870|UPS Ground
10008000003|December 25, 2002|1r1234585870|UPS Ground
I want to search the invoice # (first entery)
Then if a match have the following feilds print up
#!/usr/bin/perl
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer); foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
hex($1))/eg;
$value =~ s/\:\://ig;
if ($INPUT{$name}) {
$INPUT{$name} = $INPUT{$name}.",".$value;
} else { $INPUT{$name} = ($value); }
for ($INPUT{'$name'}) {
s/^\s+//;
s/\s+$//;
}
}
#parse
print "Content-type:text/html\n\n";
open(DATA, "data/dat.dat"$DATA = <DATA>;close DATA;
print "$DATA";
($invoice,$processdate,$trackingnum,$shipmethod) = split(/\|/,$DATA);
if ($INPUT{'search'} eq $invoice) { print "$invoice has been found.
<br>$invoice
<br>$processdate
<br>$trackingnum
<br>$shipmethod
<br>$ups
"; } else { print "No match found"; }
print "$INPUT{'search'} is the search - $invoice is not a correct invoice Please Hit back and retype the invoice Correctly";
What am I doing wrong?
Invoice|Process Date|Tracking Number|Ship Method
00000000002|December 23, 2002|1z1234567890|UPS Ground
00000000003|December 23, 2002|1z1234567870|UPS Ground
10000000003|December 23, 2002|1z1234585870|UPS Ground
10008000003|December 25, 2002|1r1234585870|UPS Ground
I want to search the invoice # (first entery)
Then if a match have the following feilds print up
#!/usr/bin/perl
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer); foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",
hex($1))/eg;
$value =~ s/\:\://ig;
if ($INPUT{$name}) {
$INPUT{$name} = $INPUT{$name}.",".$value;
} else { $INPUT{$name} = ($value); }
for ($INPUT{'$name'}) {
s/^\s+//;
s/\s+$//;
}
}
#parse
print "Content-type:text/html\n\n";
open(DATA, "data/dat.dat"$DATA = <DATA>;close DATA;
print "$DATA";
($invoice,$processdate,$trackingnum,$shipmethod) = split(/\|/,$DATA);
if ($INPUT{'search'} eq $invoice) { print "$invoice has been found.
<br>$invoice
<br>$processdate
<br>$trackingnum
<br>$shipmethod
<br>$ups
"; } else { print "No match found"; }
print "$INPUT{'search'} is the search - $invoice is not a correct invoice Please Hit back and retype the invoice Correctly";
What am I doing wrong?