# slurp will return every line from the file in list context sub slurp{ local *ARGV;@ARGV=@_; <> }; print grep m/$host/, slurp $csv_filename;