On Thu, 2004-10-28 at 10:19, Khairul Azmi wrote:
> I've been trying to solve this problem using many techniques I found
> on the websites but still unsuccessfully
Hi.
I don't have much time, so I probably won't be able to explain this
right now, but here's a working version of your code, give it a look:
#!/usr/bin/perl -w
use strict;
sub func {
my @local_array = @_;
for my $i ( 0 .. @local_array - 1 ) {
for my $j ( 0 .. @{$local_array[$i]} - 1 ) {
print "$local_array[$i][$j] ";
}
print "\n";
}
}
my @myarray = ( [1, 2, 3, 4, 5], [6, 7, 8, 9, 10] );
func(@myarray);
Regards, and HTH,
jac
> sub func {
> my (@local_array) = @_;
>
> for (my $i=0;$i<@local_array;$i++) {
> for (my $j=0;$j<@local_array[$i];$j++) {
> print "$local_array[$i[[$j] ";
> }
> print "\n";
> }
>
> $myarray[0]=(1,2,3,4,5);
> $myarray[1]=(6,7,8,9,10);
>
> func (@myarray);
>
> Thanks in advance
>
> Azmi
--
Jos� Alves de Castro <[EMAIL PROTECTED]>
http://natura.di.uminho.pt/~jac
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>