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 |