sub links { my $url = shift; # This removes the first element of @_ map { "$url/$_" } @_; # You don't need return :) }