logo       
Google Custom Search
    AddThis Social Bookmark Button

CAP::AutoRunmode forwarding problem: msg#00061

Subject: CAP::AutoRunmode forwarding problem
An app. I was developing some time ago seems to have stopped working properly. The problem seems to involve methods in a CAP::AR delegate class, which run correctly except when I try to forward to another sub-routine. Let me illustrate:

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 Health
system please visit www.connectingforhealth.nhs.uk/nhsmail **********************************************************************


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx





Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>