RE: Code not working as desired !

2008-08-01 Thread Thomas Bätzler
Rob Dixon <[EMAIL PROTECTED]> wrote: > My apologies. There was a mistake in my code in that I was > using the special variable $a for this loop. I should have > written something like this: > > my %h; > > print "Matrix is as follows :- \n"; > foreach (@arr) { > my @vals = @$_; > p

Re: Code not working as desired !

2008-08-01 Thread Rob Dixon
Rob Dixon wrote: > > my %h; > > print "Matrix is as follows :- \n"; > foreach $a (@arr) { > print "Row = @{$a}\n"; > my @vals = @$a; > my $key = shift @vals; > $h{$key} = [EMAIL PROTECTED]; > } My apologies. There was a mistake in my code in that I was using the special variable $a for t

Re: Code not working as desired !

2008-08-01 Thread John W. Krahn
Amit Saxena wrote: Hi all, Hello, I am trying to make a perl code which would read a matrix (basically an array which contains references to other arrays) and initialize a hash with the first value of each dereferenced array acting as a key and remaining elements as values using references.

Re: Code not working as desired !

2008-08-01 Thread Rob Dixon
Amit Saxena wrote: > Hi all, > > I am trying to make a perl code which would read a matrix (basically an > array which contains references to other arrays) and initialize a hash with > the first value of each dereferenced array acting as a key and remaining > elements as values using references. >