The best open source pointer I can give you is : http://64studio.com. A distribution dedicated solely to music production (and it works great).
On a perl related note: I am still hoping that someone will take up the challenge of producing something like MidiStroke (http://www.charlie-roberts.com/midiStroke/). It gives an easy to use interface to map midi notes to any keystroke, combination of keystrokes or even keystroke sequences.
This would be a great adition to what is already happening on the opensource music production front.