Subject: | Allow coderefs to get arguments |
It would be really helpful if code references could take arguments to parameterize them.
Trivial patch attached.
Subject: | Faker.pm.diff |
--- Faker.pm.orig 2013-04-05 05:02:21.000000000 -0400
+++ Faker.pm 2013-04-05 05:01:52.000000000 -0400
@@ -102,7 +102,7 @@
} elsif(ref($data) eq 'ARRAY') {
$result = $data->[rand(@{$data})];
} elsif(ref($data) eq 'CODE') {
- $result = $data->($self);
+ $result = $data->($self, @_);
} else {
croak "Don't know what to do with result of type '".ref($data)."'";
}