When I run sox directly from the command line as ;
sox -r 8000 -c 1 <wavfilename> <mp3filename>
I get the following error message:
sox: Unknown output file format for '747a.mp3': File type 'mp3' is not known
My machine is running the CentOS operating system.
You'll need to install an appropriate MP3 encoder, e.g. LAME, or recompile Sox with liblame support.
This is independent of your Perl programming :)