Please tell us more about your requirement. As you know, DBI already handles the “mechanics” of interfacing with Postgres (or any other ...) database, so the question before the house appears to be, “what’s a good way to let the user specify which query he wants to run?” A command-line parameter value is a fine way to do it. I would suggest that the main-program chooses among 12 different subroutines to call (thus keeping the main small and simple), and that each of these 12, insofar as possible, calls one or more common subroutines to do whatever turns out to be common among all of them.
This is also a fine time to learn about packages and classes, because these are an excellent way to provide for “common functionality.” (Maybe, instead of calling a subroutine, the main routine instantiates an instance of one of 12 classes, each of which inherits from a common ancestor, and tells that instance to, say, run(). The specific subclass encompasses what is unique about a particular request, while the parent class from which they all derive encompasses what is common between them all.