# MODIFIED Second example; nothing gets assigned to @array1 or @array2 the first time, but DOES the second time # But no compiletime errors are generated either: my $condition = int rand 2; sub testthis { my $i=0; # Note: assignment is element-by-element foreach $word( qw/This that and the other/){ $_[$i] = $word; $i++; } } my ( @array1, @array2 ); testthis( $condition ? @array1 : @array2 ); print "With Empty arrays setting $condition: @array1,\n @array2;\n"; @array1 = qw/no longer empty one/; @array2 = qw/no longer empty two/; testthis( $condition ? @array1 : @array2 ); print "With NON-Empty arrays setting $condition: @array1,\n @array2;\n"; #################################### ## Output ### With Empty arrays setting 0: , ; With NON-Empty arrays setting 0: no longer empty one, This that and the;