3 |
# $Id$ |
# $Id$ |
4 |
# |
# |
5 |
# $Log$ |
# $Log$ |
6 |
|
# Revision 1.6 2002/11/17 07:18:59 joko |
7 |
|
# + sub deep_copy |
8 |
|
# |
9 |
# Revision 1.5 2002/10/27 18:34:28 joko |
# Revision 1.5 2002/10/27 18:34:28 joko |
10 |
# + sub now |
# + sub now |
11 |
# |
# |
38 |
array_getDifference |
array_getDifference |
39 |
getDirList |
getDirList |
40 |
now |
now |
41 |
|
deep_copy |
42 |
); |
); |
43 |
|
|
44 |
use strict; |
use strict; |
216 |
return strftime("%Y-%m-%d %H:%M:%S", localtime); |
return strftime("%Y-%m-%d %H:%M:%S", localtime); |
217 |
} |
} |
218 |
|
|
219 |
|
sub deep_copy { |
220 |
|
my $this = shift; |
221 |
|
if (not ref $this) { |
222 |
|
$this; |
223 |
|
} elsif (ref $this eq "ARRAY") { |
224 |
|
[map deep_copy($_), @$this]; |
225 |
|
} elsif (ref $this eq "HASH") { |
226 |
|
+{map { $_ => deep_copy($this->{$_}) } keys %$this}; |
227 |
|
} elsif (ref $this eq "CODE") { |
228 |
|
$this; |
229 |
|
} else { die "what type is $_?" } |
230 |
|
} |
231 |
|
|
232 |
1; |
1; |