From: b Date: Tue, 26 Mar 2024 19:23:39 +0000 (+0000) Subject: merge settings (imported from BSTA) X-Git-Tag: v1.1.7 X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;p=botm%2Fcommon-perl merge settings (imported from BSTA) --- diff --git a/botm_common.pm b/botm_common.pm index cf9cf9e..5105ed6 100644 --- a/botm_common.pm +++ b/botm_common.pm @@ -27,7 +27,7 @@ use File::Copy; use Exporter; -our $VERSION = '1.1.6'; +our $VERSION = '1.1.7'; our @ISA = qw(Exporter); our @EXPORT = (); our @EXPORT_OK = ( @@ -48,7 +48,8 @@ our @EXPORT_OK = ( 'open_encoded', 'failpage', 'fail_method', 'fail_content_type', 'fail_open_file', 'fail_attachment', 'fail_500', - 'redirect' + 'redirect', + 'merge_settings' ); @@ -1308,6 +1309,21 @@ sub redirect } +#################### +## support tool ## +#################### + +sub merge_settings { + my %final_settings; + + foreach my $settings (@_) { + foreach my $ind (keys %$settings) { + $final_settings{$ind} = $settings->{$ind}; + } + } + return %final_settings; +} + ########### ## URL ## ###########