Loading ...
Sorry, an error occurred while loading the content.

Re: Working TicketAuth example?

Expand Messages
  • Todd Ekenstam
    Thanks again Duncan/Paul. Just another follow-up. If you want the TicketAuth example all in one file, the other thing that needs to go into the BEGIN block
    Message 1 of 4 , Nov 13, 2002
    • 0 Attachment
      Thanks again Duncan/Paul.

      Just another follow-up. If you want the TicketAuth example all in
      one file, the other thing that needs to go into the BEGIN block are
      the "private" functions:

      BEGIN {
      @TicketAuth::ISA = qw(SOAP::Server::Parameters);

      $TicketAuth::calculateAuthInfo = sub {
      return md5(join '', 'mysecretstring', @_);
      };
      # etc...
      }

      Otherwise you have a similar (but more obvious) inheritance problem
      trying to call $calculateAuthInfo->().


      Todd



      --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
      > Hi Todd,
      >
      > > Not sure why that's a problem. The other examples (hibye, etc.)
      > > seemed to work with everything in the same file.
      > I guess your problem was around this code:
      >
      > package main;
      >
      > ....
      >
      > package foo;
      > @foo:ISA = 'bar';
      >
      > The problem is that inheritance (@foo:ISA) doesn't work unless you
      > wrap your package code into BEGIN block (or use a separate file,
      > which effectively does the same):
      >
      > BEGIN {
      > package foo;
      > @foo:ISA = 'bar';
      > }
      >
      > That's the way Perl works and I've posted the explanation few times
      > already. Other simple examples work because they don't use
      > inheritance. Let me know if it's something else.
      >
      > Best wishes, Paul.
    Your message has been successfully submitted and would be delivered to recipients shortly.