Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Problem With Split

by wufnik (Friar)
on Jun 16, 2004 at 13:33 UTC ( [id://367234]=note: print w/replies, xml ) Need Help??


in reply to Problem With Split

you could try unpack for this, given you seem to be looking for fixed length string processing. after all, why use vulgar regexen when the refined unpack is ready to help?

in the following i also use sprintf to deal with leading zeros.

print join ":", map {sprintf("%d",$_)} unpack("A4A4",shift);
...wufnik

-- in the world of the mules there are no rules --

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-29 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found