$str =~ s/(.{16})/$1 /g; [download]
In reply to Re: How to split a string into chunks of length n or less by dreadpiratepeter in thread How to split a string into chunks of length n or less by isync