#!/usr/bin/perl
$|=1; 

# Output pcap global header
open(FILE, "header.pcap");
@data = <FILE>;
print @data;
close(FILE);

while(<>) {
    if(/^.*PCAP (.*)$/) {
	$c = $1;
	$c =~ y/A-Fa-f0-9//dc; 
	$_= pack("H*", $c); 
	print;
    } else {
    print STDERR;
    }
}
