in reply to length of a file

If it's a Perl string, the unhelpfully named length function (see perlfunc:length) would do the job. If it's a text file, use the -s filetest, as in

my $size = -s $filename;

Philosophy can be made out of anything. Or less -- Jerry A. Fodor