Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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
Replies are listed 'Best First'.
Re^2: Performance problems on splitting long strings
by Laurent_R (Monsignor) 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 rifling through the Monastery: (5)
As of 2015-07-29 01:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (260 votes), past polls