in reply to Passing a hash byreference to a subroutine

Treat the ref like a normal scalar, no need to deref. Also it's my ($existing_users) = @_; (parens on the left for list context) or my $existing_users = shift;. See also perlreftut and perlref.

use warnings; use strict; use Data::Dumper; my $existing_users = { 'user1' => { 'UserName' => 'user1', 'Ignore' => 'N', 'LastAccessDate' => '0000-00-00' }, 'user2' => { 'UserName' => 'user2', 'Ignore' => 'N', 'LastAccessDate' => '0000-00-00' }, }; send_to_sub($existing_users); sub send_to_sub { my ($existing_users) = @_; print Dumper($existing_users); }

Replies are listed 'Best First'.
Re^2: Passing a hash byreference to a subroutine
by edimusrex (Monk) on Apr 06, 2017 at 20:17 UTC

    Ahh, I knew it would be something simple. Thank you