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")
open(ORD, "< custord2")
open(CUST, "> cust")
my ($line, @ord, $i, $aref, @nostock, $bref, $n, $j);
while ($line = <NOSTOCK>) {
}
while ($line = <ORD>) {
}
ORD: for $i ( 0 .. $#ord ) {
}
close(NOSTOCK);
close(ORD);
close(CUST);
######################
In what other ways (more efficient, faster or just different) can I complete this task?
Here are parts of my input files:
# custord2:
3,1000000005,R496055,348,PENFUZZY,11.99,1,04,25,00
3,1000000005,R496055,348,RDPILOT,7.99,1,04,25,00
3,1000000005,R496055,351,HOUWHERE,4.95,1,04,25,00
3,1000000005,R496055,351,PENDINNER,6.95,1,04,25,00
3,1000000005,R496055,351,RANONEFISH,8.95,1,04,25,00
3,1000000005,R496055,351,SIMCHEERIOS,5.99,1,04,25,00
3,1000000005,R496055,359,RANGREEN,8.95,1,04,25,00
# nostock.csv:
FNWDISPLAY,
HAVCASTLE,
HAVCONSTRUCTION,
HAVEASYFAMILY,
HAVMASTERCKDLX,
MERNEWBAKING,
MORHORSD,
RANGREEN,
RANONEFISH,
STRSMALL,
TLCELMOART,
TLCLITTLEBEAR,
TLCMADELINE,
WARLITTLEMEALS,
Thanks in advance.
Greg