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

1193Re: [soaplite] Warning from SOAP::Lite on die()

Expand Messages
  • Paul Kulchenko
    Jan 28, 2002
    • 0 Attachment
      Hi, Sam!

      > Which looks big-time suspicous to me... Where do the hash named "U"
      > get
      > initialized? Or does sprintf have some tokenizer voodoo to know
      > that you
      > meant a formatting string for a long unsigned integer? But I guess
      > it works fine, right?
      This method is used to define whether several variables point to the
      same object. Function gen_id is called ONLY for blessed references
      and returns stringified address ("%U" returns unsigned long). For
      objects that have stringification overloaded this function may return
      wrong (non-numeric in this case) value. I do have alternative
      function that works properly in all cases, but it's MUCH slower than
      currently used one. You can override it in serializer to get desired
      behavior:

      use SOAP::Lite;
      ....

      use overload;
      sub SOAP::Serializer::gen_id { overload::StrVal($_[1]) =~
      /\((0x\w+)\)/o; $1 }

      If someone knows better way to do that, let me know.

      > I just want to silence the warning really!
      you can use 'no warnings' pragma to control warnings, or use
      'local($^W)' to disable them. Let me know if your class doesn't
      override stringification (something else is wrong then).

      Best wishes, Paul.

      --- Sam Tregar <sam@...> wrote:
      > When I die() inside a SOAP method I'm getting warnings like this:
      >
      > Argument "Bric::Util::DBI --
      > /usr/local/bricolage/lib/Bric/Util/DB..."
      > isn't numeric in sprintf at /
      > usr/local/lib/perl5/site_perl/5.6.1/SOAP/Lite.pm line 802.
      >
      > This is coming from line 802 in SOAP::Lite:
      >
      > sub gen_id { sprintf "%U", $_[1] }
      >
      > Which looks big-time suspicous to me... Where do the hash named "U"
      > get
      > initialized? Or does sprintf have some tokenizer voodoo to know
      > that you
      > meant a formatting string for a long unsigned integer? But I guess
      > it
      > works fine, right? I just want to silence the warning really!
      >
      > -sam
      >
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > 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/
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Great stuff seeking new owners in Yahoo! Auctions!
      http://auctions.yahoo.com
    • Show all 2 messages in this topic