Skip Menu |

This queue is for tickets about the Data-Faker CPAN distribution.

Report information
The Basics
Id: 84440
Status: new
Priority: 0/
Queue: Data-Faker

People
Owner: WSHELDAHL [...] cpan.org
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



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)."'"; }