remiah: I studied your module and test script: you've done a very good job - it's working. Thank you for that.

But, what this effectively does (as UNK noted in his answer here: http://stackoverflow.com/questions/13209474/ ), is re-encoding the data before inserting it into the tied array and the tied file; so the array does not contain Unicode data in internal Perl representation, but instead simply contains the imported UTF-8 strings.

Now in my project, I am doing regex comparisons and substitutions against the tied array; so if I go this route, I'll have to re-decode the array element before any processing, and re-encode it again.

I have read Unk's post at stackoevrflow. This is not trivial problem for me having been troubled and struggled with encoding/decoding issue for a long time. It seems Glu monks not noticing this thread...

Unk says

1. Encode manually before handing off to the tied array
2. Figure out what the issue is with Tie::File

No 1 must be like mine, wrapping Tie::File with accessor methods. For No.2, I wish some superior monks pursuit whether it is really seek problem, as Unk says. And there could be No.3 using DB_File module.

(It's practically identical to your latest script). Notice that on purpose, I took away the "chomp" on input to the tied array, and indeed, as you can see from the script print (STDOUT) output, the array members do have "\r\n" terminations.

But, inspecting the saved tied file, it turns out that the records _do_not_ have newlines (or \r\n) terminations!

Why is that, and what should be done? (Maybe something in $db->Filter_Push())? And how?

In addition, can you refer us to a good documentation for DB_File and DBM_Filter modules?

utf8 "\xCE" does not map to Unicode at F:/Win7programs/Dwimperl/perl/l+ib/Tie/File.pm line 917
Tie::File::_read_record('Tie::File=HASH(0x24cb72c)') called at+ F:/Win7programs/Dwimper
l/perl/lib/Tie/File.pm line 175
Tie::File::_fetch('Tie::File=HASH(0x24cb72c)', 0) called at F:+/Win7programs/Dwimperl/p
erl/lib/Tie/File.pm line 210
Tie::File::STORE('Tie::File=HASH(0x24cb72c)', 0, '&#964;&#953;+ &#954;&#940;&#957;&#949;&#964;&#949;;') called at tie file test
.pl line 31