in reply to Dumper Won't print @_ ?

sub dbAction is prototyped to take a reference to an array; but you call it with an array (not a reference). Update: See the reply by AnomalousMonk below; also Prototypes.

Without the prototype:

#! perl use strict; use warnings; use Data::Dumper; my @params = qw(homer marge bart lisa maggie); dbAction(@params); sub dbAction { print Dumper( @_), "\n"; print Dumper(\@_); }

Outputs:

$VAR1 = 'homer'; $VAR2 = 'marge'; $VAR3 = 'bart'; $VAR4 = 'lisa'; $VAR5 = 'maggie'; $VAR1 = [ 'homer', 'marge', 'bart', 'lisa', 'maggie' ];

At least one of these is what you wanted?

HTH,

Athanasius <°(((><contra mundum

Replies are listed 'Best First'.
Re^2: Dumper Won't print @_ ?
by AnomalousMonk (Archbishop) on Jul 30, 2012 at 14:03 UTC
    sub dbAction is prototyped to take a reference to an array; but you call it with an array (not a reference).

    Actually,  dbAction() is prototyped to take a single explicit array (i.e., something with a  @ sigil) as an argument and pass a reference to the array to the function. It will refuse to take an array reference, which is a scalar – won't even compile.

    >perl -wMstrict -le "use Data::Dump; ;; sub S (\@) { my ($array_ref) = @_; dd $array_ref; } ;; my @ra = (qw(foo bar baz), [ 1, 2, 3 ]); S(@ra); " ["foo", "bar", "baz", [1, 2, 3]]