package MyApp::Runmodes;
use strict;
sub runmode_1 {
my $self = shift;
$self->check_rm( 'mysub_1', $params )
|| return $self->dfv_error_page();
# do more stuff, then goto mysub_1() in same package:
$self->mysub_1; # causes fatal error - see below
}
Fatal error:
Error executing run mode 'runmode_1': Can't locate object method
"mysub_1'" via package "MyApp" at /path/to/myapp.pm line 169.
$self->forward('mysub_1') gives this:
Error executing run mode 'runmode_1': CAP::Forward: target method
mysub_1 of run mode mysub_1 does not exist at /path/to/MyApp/Runmodes.pm
line 169.
__PACKAGE__->mysub_1 finds mysub_1() OK, but gives:Error executing run mode 'runmode_1': Can't locate object method "param" via package "MyApp::Runmodes" at /path/to/MyApp/Runmodes.pm line 219.
Strangely, __PACKAGE__->mysub_1($self) doesn't work but mysub_1($self) does, but it does not feel correct to write it like that.
There is an entry in the CAP::AutoRunmodes documentation under security about making sure that "when using a delegate object, that it (and its superclasses) only contain run modes (and no other subroutines)". Does this explain why I am seeing this apparently strange behaviour (if so why?), or am I missing something more obvious?
-- ra(dot)jones(at)dpw(dot)clara(dot)co(dot)uk ********************************************************************** Information in this message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies; please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Healthsystem please visit www.connectingforhealth.nhs.uk/nhsmail **********************************************************************
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.