use Socket qw( inet_aton ); while (<>) { my $host = extract_host($_); print(unpack('H8', inet_aton($host)), $_); }