replace space with comma in perl

arr_Ent_NameId variable holds 'Prakash pawar' 'sag' '23' '50000' this value

'Prakash pawar' 'sag' '23' '50000'

I want to replace space( ) with comma (,)

There are 4 fields here. I don't want to replace first field with comma.

output should be:

'Prakash,pawar','sag','23','50000'

Thanks
Pritish

---------- Post updated at 07:28 PM ---------- Previous update was at 07:16 PM ----------

Would you pls help me out.

Try this in perl,

qx/printf $arr_Ent_NameId | sed 's/ /,/g'/;

s/\s/,/g;