Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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;

Replies are listed 'Best First'.
Re^2: Performance problems on splitting long strings
by Laurent_R (Abbot) 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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2016-12-03 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (59 votes). Check out past polls.