in reply to Perl substitution not working

How does your input look like? Why slurp your whole file into an array, only to iterate later, in order to inter- change or ( do substitution ) on the array indexes. Am sure there are better ways of achieving your aim using a while loop with the open function.
You can try y/,,,/,/s like so:

my $value='Wed,Jun,13,10:23:35,2012,,,rdy,769,busy,31,rd,0,wr,22,ka, +6 '; $value=~y/,,,/,/s; print $value; ## Wed,Jun,13,10:23:35,2012,rdy,769,busy,31,rd,0,wr, +22,ka,6

If I may suggest the following, use open function three argument, check if the open function fails and always close open file handler as soon as possible like so:

open my $filehandler,'<',$file or die "can't open file: $!"; # .... others codes close $filehandler or die "can't close file:$!";