note
Anonymous Monk
<p>That is a nice approach.
<p>I was in a hurry, so went for a quick substr approach:
<code>
push @a, [ unpack "CCSS", substr($data, $_ * 6, 6) ]
for 0..(length($data) / 6 - 1);
</code>
<p>Had an off-by-one error at first though. Perl doesn't seem to have a range operator that goes up to n-1, like Ruby does? (<tt>0..5</tt> loops from <tt>0</tt> to <tt>5</tt> but <tt>0...5</tt> loops from <tt>0</tt> to <tt>4</tt> in Ruby)
11141549
11141552
12