Subject: | Problem with unicode |
In example below, there is a error:
error during cache set for namespace='Default', key='aa', size=1,
expires='1d', cache='File': Wide character in syswrite at
/usr/lib/perl5/site_perl/5.10.0/CHI/Driver/File.pm line 105.
perl -v: perl, v5.10.0 built for x86_64-linux-thread-multi
Cache::Cache with such data works good.
use 5.010;
use CHI;
my $cont = chr(400);
my $cache = CHI->new( driver => 'File',root_dir=>'/tmp',on_set_error =>
'die');
$cache->clear;
my $key = 'aa';
say "cache of $key = ",$cache->get($key) // 'undefined';
$cache->set($key,$cont,'1 day');
say "cache of $key = ",$cache->get($key);