title: Reading packets with Linux::TunTap
body: <p>I've put together a perl script that reads packets into userspace via Linux::TunTap, and it all seems to work fine:</p>
  
  <pre><code>#!/usr/bin/perl
  use warnings;
  use strict;
  use Linux::TunTap;
  
  $tun = new Linux::TunTap(NAME =&gt; 'localtun')
  or die "Couldn't connect to IF\n";
  
  while (my $packet = $tun-&gt;get_raw()) {
          print Dumper($packet);
  }
  </code></pre>
  
  <p>Now the question is: How do I turn the string representing the raw IP packet as read from the tuntap device into a proper datastructure for processing? In particular I'm after the source, destination, and sequence number.</p>
  
  <p>Obviously, the raw IP packet isn't very human readable in its original format. Here's the output after sending a ping through the tuntap interface:</p>
  
  <p><code>{{{�}/��8V�| !"#$%&amp;'()*+,-./0123456ET��@@4</code></p>
  
  <p>How do I proceed from here to be able to process this data programatically?</p>