in reply to output results from sql join

Other already figured out the problem. BUT there is another big one in your script: Your are not checking the return codes from the database calls. You should always check prepare() and execute() worked without error - not doing it will result in you banging your head against the wall sooner or later.

Just saying...

"For me, programming in Perl is like my cooking. The result may not always taste nice, but it's quick, painless and it get's food on the table."

Replies are listed 'Best First'.
Re^2: output results from sql join
by afoken (Chancellor) on Oct 02, 2018 at 19:18 UTC
    BUT there is another big one in your script: Your are not checking the return codes from the database calls.

    And that's usally not needed IF you use RaiseError:

    my $dbh=DBI->connect( $dsn, $user, $pass, { RaiseError => 1, PrintError => 0, AutoCommit => 1, } );

    Any failing DBI method will automatically raise an error (i.e. die), no extra code required. See also DBI.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)