use strict; use warnings; use DBIx::Custom; use Encode 'decode'; my ($book_id) = $ARGV[0] =~ /(\d+)/; my @lines; while (my $line = <>) { push @lines, decode('UTF-8', $line); } my $content = join '', @lines; my $dbi = DBIx::Custom->connect( dsn => "dbi:SQLite:dbname=../db/bible.db", option => {sqlite_unicode => 1} ); $dbi->update({content => $content}, table => 'book', where => {id => $book_id});