#!/usr/bin/perl -w
# Convert hex to dotted-decimal and integer.  Each arg  produces  one
# line  of  output:  the dotted-decimal value, a tab, and the integer
# value.  Non-hex chars are ignored.

for $h (@ARGV) {
	$sep = '';
	$int = 0;
	while ($h =~ s/([0-9A-F][0-9A-F])//i) {
		$i = hex($1);
		print $sep . $i;
		$sep = '.';
		$int = ($int << 8) + $i;
	}
	print "\t$int\n";
}
