in reply to Removing empty elements from multi-dimensional array

Use grep to extract only the elements you require.

#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my @array = ( ['X1','X2','X3','X4' ], ['','foo','',''], ['bar','','',''] ); my @nofirstempty = grep { length $_->[0] } @array; print Dumper \@nofirstempty;