Hi any help appreciated... I am reading a file consisting of lines with upto 2 sets if data seperated by : ie
13:fred 12:nancy lional: each line is split into @a1 and @a2, here is my problem - if line does not have @a2 as in example line 3 above, I want it to take the value from line 2 ie - 12 here is my code that trys to do ===================================================== foreach $D (@FILES) open(MYFILE2, "$TMP/$D") || die "Cannot open $D: $!\n"; chomp (@source=<MYFILE2>); @a1=(); @a2=(); $srclen=@source; for ($a=0;$a<$srclen;$a++) ($a1[$a], $a2[$a])=split(/:/, $source[$a]); if (grep (!/^[0-9]/, $a1[$a])) #### help what needs to go here ????? ##### } } close(MYFILE2); } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]