ralfthewise has asked for the wisdom of the Perl Monks concerning the following question:
Hey all,
I'm not much of a OO programmer and this (I think pretty simple) function is giving me fits.
So my problem is that I want to send to the function cleararray() the value that has been assigned to $radiovar in a different location, so that cleararray() can work on the data from the same starting point.
I've tried cleararray($radiovar) to get the value to cleararray() and I'm getting the error NOT ENOUGH ARGUMENTS FOR PATTERNS::CLEARARRAY. Patterns is the .pm, and cleararray is a subfxn.
thanks,
john
I'm not much of a OO programmer and this (I think pretty simple) function is giving me fits.
sub cleararray() { my $class = shift; for ($i=0;$i<$radiovar;$i++) #reset array to empty { for ($j=0;$j<$radiovar;$j++) { $array[$i][$j]="0"; } } }
So my problem is that I want to send to the function cleararray() the value that has been assigned to $radiovar in a different location, so that cleararray() can work on the data from the same starting point.
I've tried cleararray($radiovar) to get the value to cleararray() and I'm getting the error NOT ENOUGH ARGUMENTS FOR PATTERNS::CLEARARRAY. Patterns is the .pm, and cleararray is a subfxn.
thanks,
john
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: passing a value to a function
by bikeNomad (Priest) on Jun 25, 2001 at 21:07 UTC | |
Re: passing a value to a function
by Sifmole (Chaplain) on Jun 25, 2001 at 20:52 UTC | |
Re: passing a value to a function
by linux454 (Pilgrim) on Jun 26, 2001 at 02:59 UTC | |
by CharlesClarkson (Curate) on Jun 26, 2001 at 03:38 UTC | |
Re: passing a value to a function
by derek3000 (Beadle) on Jun 26, 2001 at 01:11 UTC | |
Re: passing a value to a function
by ishmael (Novice) on Jun 26, 2001 at 13:09 UTC | |
by busunsl (Vicar) on Jun 26, 2001 at 14:33 UTC | |
Re: passing a value to a function
by ralfthewise (Sexton) on Jun 26, 2001 at 17:57 UTC | |
by PrakashK (Pilgrim) on Jun 26, 2001 at 18:18 UTC |
Back to
Seekers of Perl Wisdom