#!/usr/local/bin/perl use Tk; $mw = new MainWindow; $Input = $mw->Entry(); $Conv = $mw->Button(-text=>"conv",-command=>\&conv); $Input->pack; $Conv->pack; MainLoop; sub conv{ local($_) = $Input->get; $Input->delete(0,end); foreach(split(/ +/,$_)){ if(/^0x(.*)/i){ $Input->insert(end,hex($1)." "); }else{ $Input->insert(end,sprintf("0x%x ",$_)); } } }