in reply to Trying to pass Hash to Module

I don't see where you are getting the error.
Try to make a simple example that we can all run which prints the error.

This is fine:

package Label; use strict; use warnings; use Data::Dumper; use Time::Local; # Load the Time::Local module our $DEBUG =1; our $label_file = "somefile"; our $labelsettings ="some settings"; my $active_modules_ref = {clouds => 1 , quakes => 1}; sub WriteoutLabel { print "Label line 31 - Debug: \$DEBUG is " . ($DEBUG ? "enabled" : + "disabled") . "\n"; my ($active_modules_ref) = @_; # Skip label generation if labelsdisplay is disabled my $labels_display = 1; # Default to 1 (enabled) return unless $labels_display; print "Label line 39 - Debug: Labels display is " . ($labels_displ +ay ? "enabled" : "disabled") . "\n" if $DEBUG; # Debug: Check that active_modules_ref is a hash reference unless (ref $active_modules_ref eq 'HASH') { print "Label::WriteoutLabel - Received invalid active_modules_ +ref: " . (ref $active_modules_ref || 'undefined') . "\n" if $DEBUG; die "Error: active_modules_ref is not a HASH reference."; } } WriteoutLabel($active_modules_ref); __END__ Label line 31 - Debug: $DEBUG is enabled Label line 39 - Debug: Labels display is enabled