#!/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);