- or download this
my @bytes = $address =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/;
my $hex_addr = sprintf "%02x.%02x.%02x.%02x", @bytes;
- or download this
my $hex_addr = sprintf "%02x.%02x.%02x.%02x", $address =~ /(\d+)\.(\d+
+)\.(\d+)\.(\d+)/;
- or download this
my $hex_addr = sprintf "%02x.%02x.%02x.%02x", split /\./, $address;
- or download this
use Socket;
my $address = '127.1';
my $hex_addr = sprintf "%02x.%02x.%02x.%02x", unpack 'C*', inet_aton($
+address);