in reply to Re^3: how to use conditional loops when using while loop
in thread how to use conditional loops when using while loop

A node I wrote much earlier show how to convert a MAC address from a hex string into a floating point number, since they have more bits of precision. Just be sure not to use integer operations on the number. If you can figure out how to do a large random, here's a harness:

# IMPORTANT: # $first_mac, $last_mac, $range and $random # are floating point number potentially too # big to fit into an integer. Do not perform # integer operations on them. my $first_mac = mac_hex2num('00:96:14:00:00:00'); my $last_mac = mac_hex2num('00:96:14:2F:FF:FF'); my $range = $last_mac - $first_mac + 1; my $random = ???; my $mac = man_num2hex($first_mac + $random);