VMX::Common::hashmrg()

databind
vitalif 2009-04-10 22:27:34 +00:00 committed by Vitaliy Filippov
parent 803614913e
commit 8f9131d60a
1 changed files with 23 additions and 1 deletions

View File

@ -26,7 +26,7 @@ our @EXPORT_OK = qw(
HASHARRAY quotequote min max trim htmlspecialchars strip_tags strip_unsafe_tags
file_get_contents dbi_hacks ar1el filemd5 mysql_quote updaterow_hashref
insertall_hashref deleteall_hashref dumper_no_lf str2time callif urandom
normalize_url utf8on rfrom_to mysql2time mysqllocaltime resub
normalize_url utf8on rfrom_to mysql2time mysqllocaltime resub hashmrg
);
our %EXPORT_TAGS = (all => [ @EXPORT_OK ]);
@ -609,5 +609,27 @@ sub resub
return $value;
}
# недеструктивное объединение хешрефов
sub hashmrg
{
return undef unless @_;
my $h;
for (@_)
{
if ($_ && %$_)
{
if ($h)
{
$h = { %$h, %$_ };
}
else
{
$h = $_;
}
}
}
return $h;
}
1;
__END__