in reply to Passing arguments in a subroutine
This isn't how you pass parameters in Perl. Parameters that are passed into subroutines are accessed within the subroutine through the @_ special array:
sub foo { my( $bar, $baz ) = @_; print "\$bar contains <<$bar>>\n"; print "\$baz contains <<$baz>>\n"; } foo( "Hello,", "world!" );
Please refer to perlintro#Writing-subroutines for more insight. And for almost everything you ever wanted to know about passing parameters into subroutines, there's perlsub.
There are also a few syntax and misspelled variable errors:
In the future, please post actual code, copied and pasted, and make sure your code is compliant with use strict;, since strict will help you catch errors yourself without the intervention of the Monastery.
Dave
|
|---|