#!/usr/bin/perl -w use strict; my $Usage = <; my @side = split /\s+/, <>; for my $t ( @top ) { for my $s ( @side ) { print "$t$s\n"; } } #### print join( " ", " ", @top, $/); for my $s ( @side ) { print "$s "; for my $t ( @top ) { print " $t$s"; } print $/; } #### gg hh kk jj 11 22 33 44 #### gg hh kk jj 11 gg11 hh11 kk11 jj11 22 gg22 hh22 kk22 jj22 33 gg33 hh33 kk33 jj33 44 gg44 hh44 kk44 jj44