#!/usr/bin/perl use strict; use DBI; use Data::Dumper; my @result; my @row; my $dsn = 'DBI:Sybase:server=host.db.local'; my $dbh = DBI->connect($dsn, "sa", 'password'); die "unable to connect to server $DBI::errstr" unless $dbh; $dbh->do("use mydatabasename"); my $query = "select c.uniq,c.ticketid,c.tickettitle,c.assignedto1,c.status,c.area,c.a_email1, c.email from csCustIncident c, csIncident_lineitems l where c.uniq = l.incident_uniq and c.compdate > (select DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)) and c.ticketid not in (select ticketid from email_ticket) "; my $sth = $dbh->prepare ($query) or die "prepare failed\n"; $sth->execute( ) or die "unable to execute query $query error $DBI::errstr"; while (@row = $sth->fetchrow_array()) { # This line prints the list @row to screen fine print "@row\n"; # But if I try and push the @row list into the @result list I get strange results push (@result,\@row); }