my $ref = &subroutine( $fee, $fie, $foo, $fum ); $sth = $dbh->prepare ( "INSERT INTO mytable VALUES(?,?,?,?)" ); $sth->execute ( @$ref[0], @$ref[1], @$ref[2], @$ref[3] ) ; sub subroutine { my @ref = @_; ... return (\@ref); }