in reply to Adding formatting to a string

Greetings all,
Here is my suggested solution:
#!/usr/bin/perl -w use strict; my $string = "ABCDEFGH"; print $string."<= before\n\n"; my $regexp = '\w{'.int(length($string)/2).'}'; $string =~ s/($regexp)/$1-/; print $string."<= after\n\n"; exit;

It outputs:
ABCDEFGH<= before ABCD-EFGH<= after

However this assumes you wanted to split the string in half.
Just a thought

-injunjoel
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo