rand(0x100 - 2) + 2
Why not just use
## sub mac { return sprintf('00:96:14:%02X:%02X:%02X', rand(0x30), rand(0x100), rand(0x100), ); }