in reply to How to pass a variable to a subroutine

wanted($spls); ... sub wanted { my $spls = shift @_; print $spls; }

See perlsub.