Changeset 139
- Timestamp:
- May 12, 2014, 6:54:01 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/klask
r138 r139 343 343 my $mac_address = shift; 344 344 345 # D07E-28D1-7AB8 or d07e28-d17ab8 346 if ($mac_address =~ m{^ (?: [0-9A-Fa-f]{4} -){2} [0-9A-Fa-f]{4} $}xms 347 or $mac_address =~ m{^ [0-9A-Fa-f]{6} - [0-9A-Fa-f]{6} $}xms) { 348 $mac_address =~ s/-//g; 349 return join q{:}, unpack('(A2)*', uc($mac_address)); 350 } 351 345 352 return join q{:}, map { substr( uc("00$_"), -2) } split m/ [:-] /xms, $mac_address; 346 353 }
Note: See TracChangeset
for help on using the changeset viewer.