use strict; while () { # $_ is implied by default. my @lineinfo = split; print "LEN: ",scalar(@lineinfo),"\n"; }