in reply to Modifying text file

Hi torres09,
Welcome to the Monastery.
Though you have been given a head up, I think it worth the note to check this How do I post a question effectively?.
And in addition to what has been given, you could also think of use the module Text::CSV or Text::CSV_XS

Update: Code to illustrate...

use warnings; use strict; use Text::CSV_XS; my $csv = Text::CSV_XS->new( { binary => 1, auto_diag => 1 } ); while (<DATA>) { for ( [split] ) { $csv->print( \*STDOUT, $_ ); print $/; } } __DATA__ Mary had a little lamb whose fleece was white as snow.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me