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

Re: Splitting every 3 digits?

by broquaint (Abbot)
on Oct 01, 2001 at 17:54 UTC ( [id://115867]=note: print w/replies, xml ) Need Help??


in reply to Splitting every 3 digits?

Why split, when you can match
my @nums = ("123456789" =~ /(\d{3})/g); print "$_\n" for @nums; output - 123 456 789
I've found this to be yet another handy feature of regexp matching, and great for the likes of map and foreach.
HTH

broquaint

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found