##
# /etc/myscript.cfg
$somehash = {
'Somestuff'=> {
#...
},
'Someotherstuff'=> {
#....
'Actions'=> [
"print \"hello world\";",
]
},
}
####
package Scriptname;
require "/etc/scriptname.cfg"
####
package Scriptname;
$somehash=> {
'Something'=> {
#.. stuff ..
'Sub' => sub {
print "Hello world, ";
print "here is my local var: $var\n";
};
}
};
####
my $sub=$somehash->{'Something'}->{'Sub'};
&$sub() if defined($sub);