Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: IO::Compress::Gzip and unicode

by salva (Canon)
on Mar 02, 2018 at 08:49 UTC ( [id://1210222]=note: print w/replies, xml ) Need Help??


in reply to IO::Compress::Gzip and unicode

You can use PerlIO layers to do that.

PerlIO::via::gzip provides on the fly data compression (and it uses IO::Compress::Gzip under the hood).

# untested! sub writefile { my($opts) = @_; open my $fh, '>', $opts->{filename} or die $!; binmode($fh, ':via(gzip)') if $opts->{'gzip'}; binmode($fh, ':utf8'); print $fh $opts->{'data'}; $fh->close; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1210222]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-23 11:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found