Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Performance problems on splitting long strings

by Not_a_Number (Prior)
on Jan 30, 2014 at 19:26 UTC ( [id://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 (Canon) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1072718]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-25 15:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found