Re: Dereferencing problem

2011-02-24 Thread Dr.Ruud
On 2011-02-23 13:53, HACKER Nora wrote: my $sql = "select secondname || ' ' || firstname from supp_verantw_v"; my $sth = $dbh->prepare($sql); my $personen = $dbh->selectall_arrayref($sql) or die "geht net: $!\n"; You are not usubng the $sth that you set up, why? my $sth = $dbh->prepare( <<'

Re: Dereferencing problem

2011-02-23 Thread Rob Dixon
Hi Nora On 23/02/2011 12:53, HACKER Nora wrote: > Hi, > > I want to work with data from my database. The following select and > dereferencing for display is fine: > > my $sql = "select secondname || ' ' || firstname from supp_verantw_v"; > my $sth = $dbh->prepare($sql); > my $personen = $dbh->se

Re: Dereferencing problem

2011-02-23 Thread Brian Fraser
In a fairly modern Perl, you could use each[0]: while (my ($index, $value) = each @array) { ... } However, fixing your original problem is simple enough: #my @personen = @$personen; #Commenting this one out because I don't like having two variables with the same name. for ( my $i = 0; $i <= $

Re: Dereferencing problem

2011-02-23 Thread Shawn H Corey
On 11-02-23 07:53 AM, HACKER Nora wrote: my @personen = @$personen; foreach my $person ( @personen ) { print "Dereferencing: @$person\n\n"; } Use Data::Dumper to inspect your data structures: use Data::Dumper; for my $person ( @$personen ){ print "Debug: $person = ", Dumper $person; }