Global symbol "$index" requires explicit package name at /home/../scripts/creaNexusMatrix.pl line 12. Execution of /home/../scripts/creaNexusMatrix.pl aborted due to compilation errors. #### my $index; #### my @column; my $index; my $curr_column = 0; my $rows = 0; while( @array) { if( $array[0] ne '--' ) { $column[ $curr_column ] ||= []; # a new column push @{ $column[ $curr_column ] }, shift @array; if( $rows < $#{ $column[ $curr_column ] } ) { $rows = $#{ $column[ $curr_column ] }; }; } else { $index++; shift @array; }; }; for my $row (0..$rows) { print join "\t", map { $_->[ $row ] } @column; print "\n"; }; #### -- 0.0175 0.0483 0.0507 -- 0.0471 0.0483 -- 0.0287 --