Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

(dkubb) Re: (1) One liner: split fixed-width field into equal length chunks...

by dkubb (Deacon)
on Mar 21, 2003 at 22:51 UTC ( [id://245024]=note: print w/replies, xml ) Need Help??


in reply to One liner: split fixed-width field into equal length chunks...

If you're using perl 5.8 you can use the new sub-template function in unpack:

my @d = unpack "(A$n)*", $string;

Dan Kubb, Perl Programmer

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-18 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found