use List::Util qw[ max maxstr ]; my @data2d = ...; my $max = max( map max( @$_, ), @data2d );