Skip to content

Commit

Permalink
Tie::File docpatch warning unicode writes are unsafe.
Browse files Browse the repository at this point in the history
  • Loading branch information
brainbuz authored and khwilliamson committed Feb 11, 2024
1 parent 4210e23 commit a01c235
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dist/Tie-File/lib/Tie/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use Fcntl 'O_CREAT', 'O_RDWR', 'LOCK_EX', 'LOCK_SH', 'O_WRONLY', 'O_RDONLY';
sub O_ACCMODE () { O_RDONLY | O_RDWR | O_WRONLY }


our $VERSION = "1.07";
our $VERSION = "1.08";
my $DEFAULT_MEMORY_SIZE = 1<<21; # 2 megabytes
my $DEFAULT_AUTODEFER_THRESHHOLD = 3; # 3 records
my $DEFAULT_AUTODEFER_FILELEN_THRESHHOLD = 65536; # 16 disk blocksful
Expand Down Expand Up @@ -2051,6 +2051,13 @@ Changes to the array are reflected in the file immediately.
Lazy people and beginners may now stop reading the manual.
=head2 C<unicode>
You can read a unicode (UTF-8) file by providing a file handle opened with
the desired encoding. It is not safe to write to one because
the length in bytes and in characters is often different, Tie::File
will miscalculate the length of writes, overwriting parts of other records.
=head2 C<recsep>
What is a 'record'? By default, the meaning is the same as for the
Expand Down

0 comments on commit a01c235

Please sign in to comment.