Have you tried to print @row?
#!/usr/bin/perl
use Mysql;
$dbh = Mysql->connect("localhost","
>
> mailscanner","root","c0nc3pt") or
> die ("Error " . Mysql->errno . " - " . Mysql->errstr);
> $sql = "SELECT to_address FROM maillog LIMIT 10;";
> $sth = $dbh->query($sql) or die ("Error " . Mysql->errno . " - " .
> Mysql->errstr);
> while (@row = $sth->fetchrow){
> print "@row /n";
> }
$dbh->disconnect();
2009/10/6 Gregory Machin <[email protected]>
> Hi
> Please can you advise ?
>
> #!/usr/bin/perl
>
> use Mysql;
>
> $dbh = Mysql->connect("localhost","mailscanner","root","c0nc3pt") or
> die ("Error " . Mysql->errno . " - " . Mysql->errstr);
> $sql = "SELECT to_address FROM maillog LIMIT 10;";
> $sth = $dbh->query($sql) or die ("Error " . Mysql->errno . " - " .
> Mysql->errstr);
> while (@row = $sth->fetchrow){
> print "$row /n";
> }
>
> which gives this
>
> [r...@mail10 ~]# perl addressrep2.pl
> /n /n /n /n /n /n /n /n /n /n[r...@mail10 ~]#
>
> when it should give the same output as
>
> Database changed
> mysql> SELECT to_address FROM maillog LIMIT 10
> -> ;
> +----------------------------+
> | to_address |
> +----------------------------+
> | [email protected] |
> | [email protected] |
> | [email protected] |
> | [email protected] |
> | [email protected] |
> | [email protected] |
> | [email protected] |
> | [email protected] |
> | [email protected] |
> | [email protected] |
> +----------------------------+
> 10 rows in set (0.00 sec)
>
> mysql>
>
>
>
> what am I doing wrong ?
>
> Thanks
>
> --
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> http://learn.perl.org/
>
>
>
--
Pau Marc Muñoz Torres
Laboratori de Biologia Computacional
Institut de Biotecnologia i Biomedicina Vicent Villar
Universitat Autonoma de Barcelona
E-08193 Bellaterra (Barcelona)
telèfon: 93 5812807
Email : [email protected]