Newline character in TEXT field.

KPenner <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
I am trying to read in a text file and save it to a TEXT field in a MySQL database using perl 5.8. (DBI::MySQL).  The file has CRLFs in it but when it is saved to the database is only has LFs.

I read in the file like this:

      # Open input file of data
    open( FILEIN, "$directory\\$fname" )    || die "can't open $fname $!";
    undef $/;
    $text = <FILEIN>;
    close FILEIN;

My SQL statement is:

my $sth2 = $dbh->prepare( "Insert into reports
                           (type, ext, date, text, name, clientspec)
                           Values ( ?, ?, ?, ?, ?, ? )" );

and my execute statement is:

       $sth3->execute( $type, $ext, $date, $text, $name, $clientspec, $name );

Is there some way to control what the newline character is when doing this?

ps.  My co-worker is doing the same thing in PHP and is getting the full CRLF in the field.

Thanks,

Kevin M. Penner
Programmer
Call_Solutions
701-774-4021

"There are 10 types of people in the world,
 those who know binary and those who don't."



-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
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.