use strict; use Data::Dumper; my @a = (1, 2, 3); my @b = (4, 5, 6); my @c = @a or @b; my @d = (@a or @b); print Dumper(\@c); print Dumper(\@d);