Alex,
Is there a way to get a hash back of the table values, and have each value initialized to it's default?
This way, in routines that need to manipulate both new and existing data, you can avoid the overhead of constantly checking whether a field exists or is defined?
For example:
# This will set system fields like Validated to their proper values.
foreach my $key (keys %{$CFG->{add_system_fields}}) {
$IN->param(-name => $key, -value => $CFG->{add_system_fields}->{$key});
}
I'm looking for something like this that would set all the values in a %rec to their defaults.
I don't understand, from a modular issue, why the values for the new link are being pushed into %CFG instead of a %$rec where $rec is the reference to a database table record, since in a loop the values of %$rec would change, but %CFG should not.
PUGDOG®
PUGDOG® Enterprises, Inc.
FAQ: http://postcards.com/FAQ
Is there a way to get a hash back of the table values, and have each value initialized to it's default?
This way, in routines that need to manipulate both new and existing data, you can avoid the overhead of constantly checking whether a field exists or is defined?
For example:
# This will set system fields like Validated to their proper values.
foreach my $key (keys %{$CFG->{add_system_fields}}) {
$IN->param(-name => $key, -value => $CFG->{add_system_fields}->{$key});
}
I'm looking for something like this that would set all the values in a %rec to their defaults.
I don't understand, from a modular issue, why the values for the new link are being pushed into %CFG instead of a %$rec where $rec is the reference to a database table record, since in a loop the values of %$rec would change, but %CFG should not.
PUGDOG®
PUGDOG® Enterprises, Inc.
FAQ: http://postcards.com/FAQ