Form-Tiny
view release on metacpan or search on metacpan
lib/Form/Tiny/Manual/Compatibility.pod view on Meta::CPAN
a dynamic field, since it cannot be resolved in the form metaclass due to
access to form object as its first argument. Due to changes on where the field
definitions are stored, these subroutines are no longer ran once for each form
object, but rather multiple times, possibly even during a single validation
process.
This behavior is more correct, as class fields which you can access might
change between validations, and old field building would not take it into
account. However, it also means that subroutines that build form fields B<must
not> to contain any form of non-determinism (like random number generation) or
(to less degree) something variable in time (like datetime or access to busy
database entries).
I<Minor change in 2.03>
As of I<2.03>, the field definitions are still resolved dynamically, but will
keep their state until you trigger form reset by changing the input (with
C<set_input> method). This allows for some degree of randomness in forms, but
it will still change after you set different input. If you really want
randomness that will last for the entire lifetime of an object, regular class
attribute accessed in a dynamic field is your best bet:
( run in 0.245 second using v1.01-cache-2.11-cpan-87723dcf8b7 )