#!/usr/bin/perl # program.pl use warnings; use strict; my @array1 =( 1..3 ); my @array2 = ( 4..6 ); my $ref_array1 = \@array1; my $ref_array2 = \@array2; system("./print.pl",$ref_array1,$ref_array2); #### #!/usr/bin/perl use strict; use warnings; my ( $ref_string1 ,$ref_string2 ) = @ARGV; print "$ref_string1, $ref_string2\n"; #### #!/usr/bin/perl use warnings; use strict; use Storable; my @array1 = ( 1..3 ); my @array2 = ( 4..6 ); my $store_file = './data.store'; # encapsulte the two arrays into a single array ref # for storage. We'll extract in print.pl store( [ \@array1, \@array2 ], $store_file ); # instead of passing the data as the parameters, pass the file name instead system( "./print.pl", $store_file ); #### #!/usr/bin/perl use strict; use warnings; use Storable; my $store_file = $ARGV[0]; # we have to extract the two original arrays from the # single array that we encapsulated them in my $aoa = retrieve( $store_file ); my ( $aref1 ,$aref2 ) = @{ $aoa }; print "@{ $aref1 }, @{ $aref2 }\n";