#!/usr/bin/perl use strict; use warnings; my @words = qw/aligator banana carrot dog elephant frog great happy iceberg/; my @morewords = qw/jello kangaroo lima million never orange pear quarter/; combine (\@words, \@morewords); for my $i (@words) { print "$i\n"; } # a function that takes two references to arrays and adds the elements from the second array to the first sub combine { my $one = shift; my $two = shift; push @$one, @$two; }