Thread MAC Adresse formatieren
(4 answers)
Opened by puemer at 2011-11-18 17:16
Das geht zum Beispiel so:
Code (perl): (dl
)
my $pretty_mac = join('-', map { sprintf('%02x', hex($_)) } split(/-/, $mac)) Edit: Oder auch so: Code (perl): (dl
)
my $pretty_mac = ($mac =~ s/(^|-)([[:xdigit:]]+)/sprintf("%s%02s", $1, $2)/gre); Last edited: 2011-11-18 17:40:46 +0100 (CET) When C++ is your hammer, every problem looks like your thumb.
|