local $_ = ; chomp; my $hexnum = undef; $hexnum = eval "0x$1" if (m/^(?:0[xX])?([[:xdigit:]]+)$/); die "bad input" unless defined $hexnum;