use strict; use Data::Dumper; fill(\my @foo); warn Dumper \@foo; sub fill { my $ref = shift; push @$ref, $_ for 0 .. 10; }