Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: create filename from IP#

by Roger (Parson)
on Nov 27, 2003 at 00:36 UTC ( [id://310433]=note: print w/replies, xml ) Need Help??


in reply to create filename from IP#

Just extend your existing regular expression a bit will do the trick -
use strict; while (<DATA>) { s/(\d+|\.)/ $1 eq '.' ? '' : sprintf "%03d", $1 /eg; print; } __DATA__ 127.0.0.1 256.123.12.1 256.12.31.21
And the output -
127000000001 256123012001 256012031021

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://310433]
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-03-29 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found