From 440229f91b4eee243b7de550fa70e8a3b3f64600 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 12 Oct 2015 16:30:01 -0400 Subject: locale/binary issues --- bkt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/bkt b/bkt index 0d67366..4dda169 100755 --- a/bkt +++ b/bkt @@ -1,10 +1,9 @@ #!/usr/bin/perl use warnings; -no warnings 'surrogate'; ## doesn't work use strict; -use open ":locale"; +use open ":locale", ":std"; use Getopt::Std; # this makes getopts exit after --help: @@ -33,11 +32,10 @@ bar 2 40.0% baz 1 20.0% foo 2 40.0% -The name 'bkt' comes from the concept of collecting like items in buckets -(this is basically how a hashtable works). The original plan was to name -this script 'bucketize', but who wants to type all that? Also, purely -to support lazy typists, $SELF implements subsets of the functionality -of cut(1) and sort(1). +The name 'bkt' comes from the concept of collecting like items in +buckets. The original plan was to name this script 'bucketize', but +who wants to type all that? Also, purely to support lazy typists, $SELF +implements subsets of the functionality of cut(1) and sort(1). General options: --help @@ -254,7 +252,7 @@ for(@ARGV) { }; } - binmode $fh, ":bytes" if $opt{B}; + binmode $fh, ":raw:bytes" if $opt{B}; $readfiles++; while(<$fh>) { -- cgit v1.2.3