sub xxx { # error, must be my ($firstParam) = @_; if you don't want # to get the number of parameters but the first param my $firstParam = @_; ...