sub post2Web { my ($jRef, $iRef) = @_; # Now just use $jRef, and $iRef printf INFO $infoformat, 'jobid', $jRef->{jobid}; printf INFO $infoformat, 'backup_time', $iRef->{backup_time}; } # Call it with references to your hashes as you would expect: post2Web(\%jobs, \%images);