in reply to Trying to pass Hash to Module

use strict; use warnings; my %active_modules = ( 'clouds' => sub { CloudUpdate::cloud_update() }, 'volcanoes' => sub { VolcanoXML::process_volcano_data() }, ); process_modules(\%active_modules); sub process_modules { my ($active_modules_ref) = @_; # Accept %active_modules as a refe +rence print join "\n", keys %$active_modules_ref; }

prints the hash keys as I would expect. What is different with your code? Maybe you could simplify your code to a similar test script to demonstrate the problem?

Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

Replies are listed 'Best First'.
Re^2: Trying to pass Hash to Module
by mcoblentz (Scribe) on Jan 30, 2025 at 23:32 UTC
    Thank you all for looking this over. I will attempt to make a much simpler version of this and duplicate the problem.