in reply to Compare wav files

The package Audio::Analyze work for your requirement, using Audio::Analyze get the SampleRate/Frequency of file which need to be compared and do whatever you want,

And also consider using Audio::Wav::Read

If you want to write your own script to get sample rate , read about wav file header information ie available first 44 bytes of generic pcm wav file, https://ccrma.stanford.edu/courses/422/projects/WaveFormat/