Peter Timofejew has created a Perl wrapper for MAD and LAME, and it is now part of CPAN:
http://search.cpan.org/search?dist=Audio-MPEG
This is a comprehensive wrapper providing nearly complete access to the libmad API, including high-resolution output samples. The wrapper also integrates LAME for encoding. Peter has done a nice job.
Cheers, -rob