and I have a scalar that I wonna send this function. Is there a short way of doing that without having to define a new array variable as the followings:sub myfunc { my $arrRef = shift; # do my stuff here }
btw, I'v tried the followings and it doesn't work:my @arr = ($var); &myfunc(\@arr);
&myfunc(\($var));
In reply to Reference on calling to a function by hotshot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |