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

RE: [soaplite] Re: variable host names and port numbers

Expand Messages
  • Sean.Meisner@VerizonWireless.com
    What version of Perl are you using, on what OS? I m not seeing that behaviour in the autodispatching client I run on Linux and Solaris, using 5.6.1 and 5.6.0
    Message 1 of 15 , Jan 30, 2003
      What version of Perl are you using, on what OS?

      I'm not seeing that behaviour in the autodispatching client I
      run on Linux and Solaris, using 5.6.1 and 5.6.0 respectively.

      Cheers,

      Sean


      > -----Original Message-----
      > From: fulkohew <fulkohew@...> [mailto:fulkohew@...]
      > Sent: Thursday, January 30, 2003 9:51 AM
      > To: soaplite@yahoogroups.com
      > Subject: [soaplite] Re: variable host names and port numbers
      >
      >
      > > A better way to do it would be:
      > >
      > > our ($host, $port);
      > > BEGIN {
      > > $host = 'localhost';
      > > $port = 2000;
      > > }
      >
      > Thanks! That indeed works. I had tried everything under the sun, but
      > I had forgotten about the scopping issue with the braces, so I tried
      > making them main package scopped using $::host, then I my'ed them, but
      > the real answer is to use 'our'.
      >
      > So then I thought I'd have them out in a file I'd 'require' in so I
      > could have the same definition file for both client and server apps
      >
      > But you'd have to put the require into a BEGIN block and that
      > effectively puts the 'our' into a nested begin block, and then we're
      > back to where we started from. :-(
      >
      > As for:
      >
      > use strict;
      > use warnings;
      >
      > Yes, of course, but I was trying to give the shortest possible
      > snippet of code, but...
      >
      > If I use warnings, then every class method invoked as a remote call
      > generates a warning msg:
      >
      > Use of inherited AUTOLOAD for non-method Child::get_count() is
      > deprecated at ./client line 45.
      >
      > Comments?
      >
      >
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >
      > Your use of Yahoo! Groups is subject to
      > http://docs.yahoo.com/info/terms/
      >
      >
    • fulkohew <fulkohew@yahoo.com>
      ... I m currently developing on 5.6.1 on Linux (RedHat 7.2) I ll try to get and post another code snippet to show as an example.
      Message 2 of 15 , Jan 30, 2003
        --- In soaplite@yahoogroups.com, Sean.Meisner@V... wrote:

        > What version of Perl are you using, on what OS?
        >
        > I'm not seeing that behaviour in the autodispatching client I
        > run on Linux and Solaris, using 5.6.1 and 5.6.0 respectively.

        I'm currently developing on 5.6.1 on Linux (RedHat 7.2)
        I'll try to get and post another code snippet to show as an example.

        ... snip ...

        > > From: fulkohew <fulkohew@y...> [mailto:fulkohew@y...]
        > > Sent: Thursday, January 30, 2003 9:51 AM

        > > As for:
        > >
        > > use strict;
        > > use warnings;
        > >
        > > Yes, of course, but I was trying to give the shortest possible
        > > snippet of code, but...
        > >
        > > If I use warnings, then every class method invoked as a remote
        > > call generates a warning msg:
        > >
        > > Use of inherited AUTOLOAD for non-method Child::get_count() is
        > > deprecated at ./client line 45.
      • quinn@fetter.org
        ... The problem is that autodispatch relies on AUTOLOAD. If a function or method can t be found in your local code, SOAP::Lite s AUTOLOAD gets invoked and
        Message 3 of 15 , Jan 30, 2003
          On Thu, Jan 30, 2003 at 02:50:57PM -0000, fulkohew <fulkohew@...> wrote:

          > If I use warnings, then every class method invoked as a remote call
          > generates a warning msg:
          >
          > Use of inherited AUTOLOAD for non-method Child::get_count() is
          > deprecated at ./client line 45.

          The problem is that autodispatch relies on AUTOLOAD. If a function or
          method can't be found in your local code, SOAP::Lite's AUTOLOAD gets
          invoked and sends it as a SOAP call. However, the use of AUTOLOAD for
          vanilla subroutines (as opposed to methods) is deprecated as of Perl
          5.6.

          Luckily, Perl 5.6 introduces different "classes" of warnings, so you can
          selectively turn off deprecated warnings like this:

          use warnings;
          #Don't warn me about the use of AUTOLOAD for non-method subroutines,
          #because SOAP::Lite's autodispatch depends on that "accidental feature"
          no warnings "deprecated";
          use strict;

          That's what I do in my code, which is running in Perl 5.6.1 on Solaris.
          An unfortunate side effect is that you won't see warnings for any other
          deprecated features, either. :(

          I understand that Perl 5.8 actually does away with this behavior of AUTOLOAD
          --that is, it invokes AUTOLOAD only when dispatching methods, not when
          "dispatching" or resolving regular subroutines. Does anyone know how
          SOAP::Lite works around this?

          ---
          qw (Quinn Weaver); #President, San Francisco Perl Mongers
          =for information, visit http://sf.pm.org/ =cut
        Your message has been successfully submitted and would be delivered to recipients shortly.