>ok. I'm sorry. I posted my code incorrectly. I'm using $rec[0]->[4] to try and access the data. ( I was just trying anything to get it to do something, and I didn't change my code back before I posted )
It's a standard multidimensional array. ( yes ? ) I've written many before. I have an exact copy of this code that returns a hashref. instead of an arrayref, the hash version works flawlessly. but darned if i can fig out why I can't get it to work here. Some one suggested it was a scoping issue, but I doubt that sense "my" will scope rec and recs to the while loop block and back. I've already scraped this code from a function to just placing rec in my main code. ( because I have to get this running today ) but when I go back and clean things up latter I'm still gonna have this prob. PS: This is the first Multidimensional array I've built sense upgrading to Perl 5.6.1 Anything change that I don't know about ? >At 05:11 PM 3/6/02 +0100, you wrote: >>Derrick Wippler wrote: >> > >> > Can anyone tell me why " print $rec->[4] " prints >> > but print "$recs[0]->[4] does not print a thing ? >> > >> > I've confimed the data, the first row in the fourth column is an "F" >> > $rec->[4] prints it, but $recs[0]->[4] does not !!!!!!! ARG >> !!!!@#@!#!!!@@!!@!! >> > PS: I'm using DBI, my DBI object is $db >> > >> > my @recs; >> > my $sql = shift; >> > my $st = $db->prepare($sql); >> > my $rc = $st->execute(@_); >> > my $rec; >> > >> > while ($rec = $st->fetchrow_arrayref) >> > { >> > print @$rec,"\n"; >> > print "|$rec->[4]|\n"; >> > push @recs, $rec; >> > } >> > >> > $st->finish; >> > print " Ref: $recs->[0][4]\n"; >> >>have you tried $recs[0]->[4] ? >>/jon >> >> > >> > -- >> > To unsubscribe, e-mail: [EMAIL PROTECTED] >> > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]