Assuming you're passing filenames on the command line, try
while ( <> ) { next if ! /:/; ... } [download]
In reply to Re: Pulling out pairs by dws in thread Pulling out pairs by andyw