in reply to Re^2: No plan "weakens" my Test scripts?
in thread No plan "weakens" my Test scripts?

Or just:
use Test::More; open my $foo, "<", "somefile.txt" or die; () = <$foo>; plan tests => 10 + $.;
And if your tests aren't going to run on systems that don't have wc:
{no warnings; use Test::More plan => 10 + `wc -l "somefile.txt"`}