#!/usr/bin/perl -w use strict; my $wordsound = 'balks.wav'; my $lettersound = 'a.wav'; my $letter; open (WORDSOUND, $wordsound) or die "can't open $wordsound: $!"; binmode (WORDSOUND); open (LETTERSOUND, $lettersound) or die "can't open $lettersound: $!"; binmode (LETTERSOUND); #actual data starts on byte 4097 seek (LETTERSOUND, 4097,0); #100 bytes ought to be OK for identifying the clip my $error = read (LETTERSOUND, $letter, 100); my $word = ; #escape all potentially nasty characters with \'s #I'm not sure if I'm escaping everything I need to (?) $letter =~ s/(\\|\||\(|\)|\[|\{|\^|\$|\*|\+|\?|\.)/\\$&/gsm; $word =~ /$letter/gms; print pos($word);