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 <g...@linuxpro.co.za>

> 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                 |
> +----------------------------+
> | iv...@systems.xxx        |
> | tkek...@stpeters.xxx     |
> | dfou...@howden.xxx       |
> | melan...@mdlulisharp.xxx |
> | er...@mdlulisharp.xxx    |
> | desi...@oas.xxx          |
> | dbalakis...@multivid.xxx |
> | bhar...@webb.xxx         |
> | jcven...@multivid.xxx    |
> | ad...@troika-iw.xxx        |
> +----------------------------+
> 10 rows in set (0.00 sec)
>
> mysql>
>
>
>
> what am I doing wrong ?
>
> Thanks
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> 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 : paumarc.mu...@bioinf.uab.cat

Reply via email to