http://qs321.pair.com?node_id=40799


in reply to perl

Assuming by 'empty' you mean 'containing only space characters':
open FILE, "file.txt"; my $count; while (<FILE>) { $count++ unless /\S+/; } close FILE; print $count;