package SQL_functions; sub select_picture_from_userID{ my $userID = shift; "SELECT pict FROM users WHERE ID = $userID;" } sub select_some_nifty_case_with_contstraints{ ... #hehe, perl6 only } #and in the "main" code: use SQL_functions qw/:all/; my $sth = $dbh->prepare( select_picture_from_userID( 666 ) ) or die...