On 04/26/00, "Greg Wardawy <[EMAIL PROTECTED]>" wrote:
> I need to print just the lines where the fourth element is not a member of
> the second list so I wrote the following code:
> ####################
> #!perl -w
> open(NOSTOCK, "< nostock.csv") || die "can't open
> nostock.csv for reading: $_!";
> open(ORD, "< custord2") || die "can't open
> custord2 for reading: $_!";
Try to post plain text to the list, not HTML, MIME and
other garbage.
You should be using hashes. Read nostock into a hash:
my %nostock;
while (<NOSTOCK>) {
s/,.*//;
$nostock{$_}=1;
}
Then you can check if the order is in nostock:
while (<ORD>) {
my ($item) = (split(/,/))[3];
print "nostock\n" if $nostock{$item};
}
HTH,
Douglas Wilson
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]