#!/usr/bin/perl # test1.pl use strict; use warnings; my $array = ( 1, 2, 3, 4); open my $FH, '| ./test2.pl'; print $FH @{$array}; close $FH; #!/usr/bin/perl # test2.pl use strict; use warnings; while (my $var = <>){ print $var; }