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);
}
####
print Dumper(@$ref[0], @$ref[1], @$ref[2], @$ref[3]);
$VAR1='aaaaaaa';
$VAR2='bbbbbbb';
$VAR3='ccccccc';
$VAR4='ddddddd';
####
my @ref = qw( aaaaaaa bbbbbbb cccccccc ddddddd );
$sth->execute ( $ref[0], $ref[1], $ref[2], $ref[3] );
####
my @array = ( @$ref[0], @$ref[1], @$ref[2], @$ref[3] );
$sth->execute ($array[0], $array[1], $array[2], $array[3]);