VMX::Common::hashmrg()
parent
803614913e
commit
8f9131d60a
|
@ -26,7 +26,7 @@ our @EXPORT_OK = qw(
|
||||||
HASHARRAY quotequote min max trim htmlspecialchars strip_tags strip_unsafe_tags
|
HASHARRAY quotequote min max trim htmlspecialchars strip_tags strip_unsafe_tags
|
||||||
file_get_contents dbi_hacks ar1el filemd5 mysql_quote updaterow_hashref
|
file_get_contents dbi_hacks ar1el filemd5 mysql_quote updaterow_hashref
|
||||||
insertall_hashref deleteall_hashref dumper_no_lf str2time callif urandom
|
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 ]);
|
our %EXPORT_TAGS = (all => [ @EXPORT_OK ]);
|
||||||
|
|
||||||
|
@ -609,5 +609,27 @@ sub resub
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# недеструктивное объединение хешрефов
|
||||||
|
sub hashmrg
|
||||||
|
{
|
||||||
|
return undef unless @_;
|
||||||
|
my $h;
|
||||||
|
for (@_)
|
||||||
|
{
|
||||||
|
if ($_ && %$_)
|
||||||
|
{
|
||||||
|
if ($h)
|
||||||
|
{
|
||||||
|
$h = { %$h, %$_ };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$h = $_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $h;
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
__END__
|
__END__
|
||||||
|
|
Loading…
Reference in New Issue