while(<>){ # <>: used handle is STDIN print if $.==5; # so $. is that handle's line number }