in reply to Re^3: Breaking up a string?
in thread Breaking up a string?

[0] Perl> print $string;; 2648117951505438300028047571976236505346 @sets_of_six = ( $string =~ m{ (.{6}) }xmsg );; print for @sets_of_six;; 264811 795150 543830 002804 757197 623650

Note the missing last four characters. Can be fixed (and the parens are extraneous):

@sets_of_six = $string =~ m{ (.{0,6}) }xmsg;; print for @sets_of_six;; 264811 795150 543830 002804 757197 623650 5346

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^5: Breaking up a string?
by kyle (Abbot) on Feb 19, 2008 at 16:21 UTC

    According to Re^4: Breaking up a string?, "length is a multiple of 6". If it's not a multiple of six, the OP hasn't specified what the correct behavior is anyway (though maybe you could test against the algorithm described in Re^2: Breaking up a string?).

    Thanks for pointing out the extraneous parentheses.