Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 romping around the Monastery: (4)
As of 2024-04-19 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found