I don't know in perl, but you can call the external program "file" and grab the output.
Here is an example of the output
Code:
$ file Roland-GR-1-Pick-Bass-2-C4.wav
Roland-GR-1-Pick-Bass-2-C4.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz