in reply to 2 dimensional array

Very hard to offer meaningful help without the code that is failing but I'll try anyway. You need to check the data that you read in before assigning it to the array. The read could return a null record. Especially the last read in the file can return an undef. This is generally not a problem when you use the  while(<FH>) construct because that is shorthand for  while(defined($_=<FH>)) but if you use other read methods you have to call defined() yourself.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Replies are listed 'Best First'.
Re^2: 2 dimensional array
by ysth (Canon) on Jun 23, 2008 at 07:51 UTC
    He's doing a list-context read, which will read all the records in the file and then stop. There is no concern that there be an undef included in the returned lines.