$dbh = DBI->connect('dbi:ODBC:Alex') || die "Error opening DB: $DBI::errstr\n"; $sth = $dbh->prepare("SELECT Inumber FROM plana"); $sth->execute() or die "Couldn't execute query: $DBI::errstr\n"; while (my @row1 = $sth ->fetchrow_array){ print "@row1\n"; #All the elements were printed out by this statement. @IDnumber=@row1; } print "@row1\n"; print "@IDnumber\n";