in reply to dimensioning arrays
I saw the @{shift} use in some node around, but I get an error...#/usr/bin/perl $nx=10; $ny=5; $initialisation = 0; foreach $i (0..$nx) { foreach $j (0..$ny) { $a[$i][$j] = $initialisation; } } $a[1][1] = 2; &subro($nx,\@a,$ny); sub subro($nx,\@a,$ny) { my $nx = shift; my @a = @{shift}; #should be wrong... my $ny = shift; print "$a[1][1]\n"; print "$nx\n"; print "$ny\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: dimensioning arrays
by Gloom (Monk) on Feb 16, 2001 at 16:31 UTC | |
by Anonymous Monk on Feb 16, 2001 at 16:54 UTC | |
by andye (Curate) on Feb 17, 2001 at 01:18 UTC |