sub display { # pull out the aref passed in my $dirs = shift; # could also be `my ($dirs) = @_;` # loop over the aref. Note the syntax # could also be written with the circumfix operator: # @{ $dirs } for my $dir (@$dirs){ print "$dir\n"; } }