Posted: 03/09/2006, 1:46 AM |
|
I use perl and when CCS generate Event code it generates something like this (this is in an includable page)
#inc_register_base_login_info_OnValidate @17-8F5F3365
sub inc_register_base_login_info_OnValidate()
{
$inc_register_base = ${$CurrentNameSpace . "::" . inc_register_base};
$inc_register_base_login_info_OnValidate = 1;
#End inc_register_base_login_info_OnValidate
If for some reason I'll change the page name then all my custome code breaks beacause $inc_register_base is not valid any more.
why not use something like this:
my $page = ${$CurrentNameSpace . "::" . inc_register_base};
When the page name changes the $page will still be valid
And let us continue:
To access the record I use (now)
$inc_register_base->{login_info}
In old versions of CCS I could simply use $self in the event to point to the record now I can't, and again just change the name of the record and the code breaks
_________________
http://www.infoneto.com/ |