hotshot has asked for the wisdom of the Perl Monks concerning the following question:
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));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: Reference on calling to a function
by jeffa (Bishop) on Dec 02, 2001 at 21:51 UTC | |
by ar0n (Priest) on Dec 02, 2001 at 23:10 UTC | |
|
(podmaster) Re: Reference on calling to a function
by PodMaster (Abbot) on Dec 03, 2001 at 05:08 UTC |