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

Re^3: How to increment a MAC Address?

by imperl (Novice)
on May 23, 2005 at 10:30 UTC ( #459499=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How to increment a MAC Address?
in thread How to increment a MAC Address?

yes, i know 99 is not valid, just that im simulating something out here, where i require the value as 99 and not in hex.


Comment on Re^3: How to increment a MAC Address?
Replies are listed 'Best First'.
Re^4: How to increment a MAC Address?
by dcd (Scribe) on May 23, 2005 at 20:35 UTC
    if $_ holds your string, then this should increment it
    $_ = join ":",unpack "A2"x6, substr( ('0' x 12 . (1 + join '',split /:/,$_))), -12)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2015-09-03 17:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (122 votes), past polls