in reply to Open file & Strip comma delimiter

You didn't mention whether this program actually does what you want it to do, or does something else instead. Also, while it's clear you want to replace commas with vertical bars, it's not really clear what you're trying to do with the last field on each line of input.

The replacement of commas with vertical bars can be done much more easily:

while (<IN>) { tr/,/|/; print OUT; }
(you can look up the "tr///" operator in the perlop manpage) Note that you are already assuming that all commas in each line are field delimiters (i.e. there are no commas that are included within quoted fields, or that are escaped in some way, and should not be interpreted as delimiters) -- also, you are taking for granted that every line will contain the same number of commas and fields. If you're really confident that your input data are consistent with these assumptions, then there's no problem. But be aware that many applications do not have this luxury.

As for this part of your code:

$string1 = $var7; substr($string1, 24) = "H:\"; $string2 = substr($string1,25,2); $string3 = substr($string1,-13); $finstring = $string1.$string2.$string3;
This makes assumptions about the length of the last field of on each input line. It also appears to always set $string2 to ":\" -- is that your intention? (If so, your code is just obfuscated.)

No way for anyone here to know what $string3 would be, without seeing some of the data. There is almost certainly a better/easier way to accomplish what you're trying to do, but you'll need to post a reply with more info about the data.