my %p = ( outputdir => undef, rptfmt => 'html', rptname => undef, rptfile => '', title => undef, headers => [], data => [], stdout => 0, ); .... cut ..... my $rpt = Report->new($p{title}, $p{headers}, $p{data}); #### sub new { my ($class,$title,$head,$data,$info) = @_; my $self = {}; bless ($self, ref ($class) || $class); $title ||= ""; $head = [] if !$head || ref $head ne 'ARRAY'; $data = [] if !$data || ref $data ne "ARRAY"; #$rows = $#{@$data} if $data || ref $data eq "ARRAY" || ref $$data[0] ne "ARRAY"; my ($cols,$rows,@justify) = ($#{@$head},$#{@$data});