To Replace comma with Pipe inside double quotes

Hi,

I have a requirement to replace the comma's inside the double quotes. The comma's inside the double quotes will get changed dynamically.

Input Record:
"Washington, DC,Prabhu,aju",New York

Output Record:
"Washington| DC|Prabhu|aju",New York

I tried with the below command but it is replacing the only the first occurence of comma to pipe.

sed 's/\("[^"][^,]*\),\([^"]*[^,]"\)/\1|\2/g'

Pls. Experts could give me the solution to fix issue i am facing.

Thanks,
Prabhu

With Perl:

perl -pe'
  s{("[^"]+")}{($x=$1)=~tr/,/|/;$x}ge
  '  infile

Many Thanks radoulov!!!!!

my $str='Japan,"Washington, DC,Prabhu,aju",New York,"Beijing, shanghai",Tokyo';
print $str,"\n";
$str=~s/
,
(?=
[^"]*"[^"]*$
|
[^"]*"([^"]*"[^"]*"[^"]*)*$
)
/|/gx;
print $str;
__END__
Japan,"Washington, DC,Prabhu,aju",New York,"Beijing, shanghai",Tokyo
Japan,"Washington| DC|Prabhu|aju",New York,"Beijing| shanghai",Tokyo