#!/usr/bin/perl -l use strict; use warnings; open(IN,"$file") or die "sd"; while(){ my $hex = join ' ', map { unpack 'h*', $_ } do { local $/; split //, $_ }; print $hex; } close(IN);