@fields = split /,/$your_line_here; #### $foo =~ /,\"(.+)\"/; $bar = $1; ...do some stuff.... $foo =~ s/,\".+\"/,\"$bar\"/;