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 reply to Re: Passing $2 to a sub
by baku
in thread Passing $2 to a sub
by SparkeyG
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |