in reply to Passing $2 to a sub
You can't use $_ in stead of @_ like that. You want to change the subroutine to one of:
sub createTable { my $value = shift; print $value; } # or sub createTable { print $_[0]; # subscript means array }
The $x syntax only works for @x variables when followed by a subscript in []'s. See perlvars for LOTS of details :-)
|
---|
In Section
Seekers of Perl Wisdom