my ($c, $s); sub ignore3006 { my ($err, $msg, $pos, $recno) = @_; if ($err == 3006) { # ignore this error ($c, $s) = (undef, undef); SetDiag (0); } # Any other error return; } # ignore3006 $csv->callbacks (error => \&ignore3006); $csv->bind_columns (\$c, \$s); while ($csv->getline ($fh)) { # Error 3006 will not stop the loop }