sub lines_count { open IN, "< $0" || die "Can't open file (black magic?)\n"; while( ) { chomp; printf "%3d: %s\n", $., $_; } close IN; }