Replace one space with nothing

hi,

d o g   e v o l 

i want a perl command for the above string which should change to the below

dog evol

replace one space with nothing and two spaces with one space.

Thanks,
Amey

sed -e 's/\([^ ]\) /\1/g' -e 's/  / /g'
$ echo "d o g   e v o l" | ruby -e 'print gets.gsub(/\b \b/,"").gsub(/  +/," ")'
dog evol


hey jilliagre sed command is working ..... can you please explain me the stuff how it works

the ruby is not available in my box

thanks,
Amey