#!/usr/bin/perl -w use strict; # must use binmode on Windows to get actual byte length of file # otherwise line end processing will ruin our count binmode STDIN; local $/ = undef; my $input = <>; print length($input); #### D:\tmp>perl -0777 -pe "42" try.html | perl try.pl 5409 #### perl -pe 'BEGIN{$|=1}' /usr/dict/words | perl -lne 'print ((stat STDIN)[7])'|sort|uniq