in reply to Using split() to divide a string by length

I find unpack more suitable for this task.

print for unpack '(A3)*', "abcdefghi";; abc def ghi

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Using split() to divide a string by length
by ikegami (Patriarch) on Apr 13, 2006 at 20:09 UTC
    Note: Parens requires Perl 5.8.0.

      Yep, I know. I remember it it being added.

      I also remember it from the last time you told me.

      And the time before that.

      So, what is your point?

      • I can't use parens in pack/unpack templates because it's only been available for 4 years*?
      • I shouldn't mention my preference for a solution because it's only been available for the last 8 releases?
      • Everytime I suggest a solution that uses a feature that isn't available in every build of perl, I should add a footnote that ikegami has (unnecessarily) reminded me that this feature has only been available for the last 8 releases and 4 years*?

      I know, I know. You're just "expanding knowledge".

      Perhaps you should also consider adding footnotes to all your posts that use or recommend other features that have not been around forever? Like say, the 3-arg open; or even hashes?

      (*) For the pedantic, 3 years, 8 months, 16 days 4 hours (approx. at the time of posting).


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        I'm not telling you. I'm telling your readers. The ones to which you just suggested to use a feature that may not be available to them. 5.6 still has a very large user base. I'm not suggesting that no post on PM can mention the use of a 5.8.x feature. I just believe a note is in order.