in reply to help with the diamond operator

You are close. The <$foo>reads a line from the file, by default into $_. You can print by simply saying print; or explicitly print $_;.