# Read File from $INPUT local $/ = undef; my $file = <$INPUT>; # Replace for ", in the file as converting to , " delimiters would cause ", to potentially cause parsing problems in the output files $file =~ s/\",/,/g; # Replace tab with "," hard coded for now $file =~ s/\t/\",\"/g; # Inserting " at beginning and end of everyline $file =~ s/\n/\"\n\"/g; # Remove dangling " at eof if $INPUT ends with \n $file =~ s/\"\z//; # Prepend " for first line $file = '"'.$file;