@ports = qw( portname portID port802 ); @val1 = qw( ON ON OFF ); @val2 = qw( EX EX NEX ); my $joined = combine_rows( "ports", \@ports, \@val1, \@val2 ); print "$_\n" for ( @$joined );