string cut at 78 characters?

Razvan Cosma <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
 Hello,
I have a script that should receive an e-mail in stdin, put the first lines
of its body in a string and insert it in an nvarchar(max) field. There are
no errors displayed, and the expected text does show up in the database, but
only the first 78 characters of it. Here's the code:

while (<STDIN>) {$orig .= $_; $count++; last if ($count>100 || /\w{70,}/);
chomp($orig);$orig=~s/\r//g;$orig=~s/\n/\t/g; #print STDERR $orig;
$db1 = DBI->connect("dbi:Sybase:server=$dbserver;database=$dbase;", $user,
$passwd, { syb_err_handler => \&err_handler }) || exit 1;
$st1 = $db1->prepare("insert into bounces (recipientid, documentid,
bouncecode, bouncesubject, bounceheaders) values (?,?,?,?,?)") || exit 1;
$st1->execute($recid, $docid, $msg, $subj, $orig) || exit 1;

The string, with newlines replaces by tabs, is there and the query looks
quite basic, but in the db I only get the first 78 chars for field
"bounceheaders":

>From MAILER-DAEMON  Mon Jun 14 08:54:23 2010 Return-Path: <> X-Original-To:
a2@e
>From MAILER-DAEMON  Mon Jun 14 08:54:24 2010 Return-Path: <> X-Original-To:
a3@e

Any hints on what goes wrong?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.