#while(){ # Do something with the data here #} #__DATA__ # The actual data #Or you could use the $_ explicitly #while($_=){ # Do something with the data here #} #__DATA__ # The actual data #Or use another variable instead of $_ as follows: #while($inputline=){ # Do something with the data here #} #__DATA__ # The actual data while(){ print if /A/; # Print the line if it matches A } __DATA__ A B I N J K