filehandler.pl sub read_file { @lines = <>; chomp(@lines); print join (',',@lines) . "\n"; } read_file;