Stored procedures have a number of disadvantages compared to SQL embedded in a perl script. One big one is that you need DBA privileges to manage them. Another is that updating them and backing them up is typically more complex than the basic source control steps used for perl code. The biggest one for me is that things which are not pure SQL -- i.e. procedural stuff in the programming language supported by the database -- is usually done in some crippled language without modern constructs or solid debugging tools like Perl's. There is a performance advantage to them when they involve examining a large number of rows that are not actually needed in the end result, but this is not that common a situation.