use strict; use warnings; my @octets = (10, 34, 2, 252); printf "%02x\n", $_ for @octets; #### 0a 22 02 fc