in reply to Send hash of hash arguments to sub

Can't be done, you can only send references

Basic debugging checklist item 4 ( Dumper )

my( %hashgetsthemall, $two, $eleven ) = 1 .. 11; dd \%hashgetsthemall, $two, $eleven ; __END__ ( { 1 => 2, 3 => 4, 5 => 6, 7 => 8, 9 => 10, 11 => undef }, undef, undef, )
  • Comment on Re: Send hash of hash arguments to sub (Dumper reference my %hash = @_ )
  • Download Code

Replies are listed 'Best First'.
Re^2: Send hash of hash arguments to sub (Dumper reference my %hash = @_ )
by Happy-the-monk (Canon) on Aug 14, 2013 at 08:27 UTC

    my( %hashgetsthemall, $two, $eleven ) = 1 .. 11;

    my( $one, $two, %hashgetstherest ) = 1 .. 12;

    is one way to do it if you wanted copies of the values anyway.
    The list variable must come last though, and there can be only one.

      update:

      In the OP's example that is:

      my ($source, $target, %hash) = @_;

      Cheers, Sören

    Créateur des bugs mobiles - let loose once, run everywhere.
    (hooked on the Perl Programming language)

Re^2: Send hash of hash arguments to sub (my( @array, $empty, %others, @greedy, $assignment , $sink ) = @_; )
by Anonymous Monk on Aug 14, 2013 at 07:35 UTC