Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Performance problems on splitting long strings

by Not_a_Number (Parson)
on Jan 30, 2014 at 19:26 UTC ( #1072718=note: print w/ replies, xml ) Need Help??


in reply to Performance problems on splitting long strings

Is there any way of saying something like: "A4" repeated as many times as possible (until the end of the string?

Yes:

my @array = unpack '(A4)*', $string;


Comment on Re: Performance problems on splitting long strings
Download Code
Re^2: Performance problems on splitting long strings
by Laurent_R (Vicar) on Jan 30, 2014 at 19:41 UTC
    Thank you very much, I had overseen this option of unpack. Yous answer is really useful for me.

      Just FYI: You refer in several places to wanting groups of five characters, but  'A4' or  '(A4)*' will give you a group or groups of four characters, trailing-space padded if necessary.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1072718]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (15)
As of 2014-07-23 15:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (145 votes), past polls