http://qs321.pair.com?node_id=1035580


in reply to Add space in long string

$bin=~s/(\d{4})/$1 /g

Don't ask what happens if the length of your bin string isn't divisible by 4 ;-)