##
# call some sub that uses the hash
# hash declaration
# sub declarations
####
# declare this as a file-scoped lexical
my %Op;
main();
# subs follow
sub main
{
assign_to_Op();
do_something_else();
}
sub assign_to_Op
{
%Op = ( ... );
}
sub do_something_else
{
my $code = $Op{ ... };
$code->();
}