Skip to content

Instantly share code, notes, and snippets.

@ashgti
Created October 14, 2010 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashgti/f63694a81d6b3218c432 to your computer and use it in GitHub Desktop.
Save ashgti/f63694a81d6b3218c432 to your computer and use it in GitHub Desktop.
my $template = 'Z4 i Z8 i s s i i s s Z4 i';
my @fields = qw(id totallength wavefmt format
pcm channels frequency bytes_per_second
bytes_by_capture bits_per_sample
data bytes_in_data);
my ($line, %values);
read($file, $line, 44);
@values{@fields} = unpack($template, $line);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment