in reply to Re^2: Reading a file as an multi dimensional array Please help
in thread Reading a file as an multi dimensional array Please help
The
is not correct, you want$num_of_columns=@data;
$num_of_columns= scalar( @data );
Then you can do warn "line $i has only $num_of_columns\n" if $num_of_columns < $wanted_num_of_columns;
But, there is no simple way to find out which column is missing, so you really should try the code wfsp gave you, unpack is your friend here :o)
Try his code, and notice that you can do with a lot less variables than you use. Put the unpack into the loop where you read the file, and then you can test which, if any, of the columns that is empty. It will contain only spaces and therefore will match /^\s+$/
|
|---|