in reply to How to pass a variable to a subroutine
wanted($spls); ... sub wanted { my $spls = shift @_; print $spls; } [download]
See perlsub.