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

Re: [soaplite] Possible bug in SOAP::Lite

Expand Messages
  • Vishal Verma
    ... I have a question. Does it hurt to do a require A::SubPackageA , if A::SubPackageA has already been loaded? What side effects will that have? ...
    Message 1 of 4 , May 7 11:02 AM
    • 0 Attachment
      --- Duncan Cameron <dcameron@...> wrote:
      > A couple of points.
      > A package might have been loaded due to it being
      > within the same file as
      > another package. For example;
      >
      > file A.pm
      >
      > package A;
      >
      > package A::SubPackageA;
      >
      > 1;
      >
      > Odd perhaps, but still valid. In this case you
      > definitely don't want to
      > do a 'require A::SubPackageA;'. So checking %INC
      > isn't quite the right
      > thing to do.

      I have a question. Does it hurt to do a "require
      A::SubPackageA", if "A::SubPackageA" has already been
      loaded? What side effects will that have?

      >
      > In your case,
      >
      > sub never_call_me
      > {
      > B::foo();
      > }
      >
      > shouldn't you have a 'use B;' statement anyway.

      Remember, I told you that nobody calls
      "never_call_me". So we don't actually need a "use B;"
      statement for this to work. Odd perhaps, but still
      valid. I actually saw this happen!


      -vish

      __________________________________
      Do you Yahoo!?
      The New Yahoo! Search - Faster. Easier. Bingo.
      http://search.yahoo.com
    • Duncan Cameron
      ... Well in this case the require will fail because there is no such file as A/SubPackageA.pm. But in general you are right, there should be no problem in
      Message 2 of 4 , May 7 12:28 PM
      • 0 Attachment
        On 2003-05-07 Vishal Verma wrote:
        >--- Duncan Cameron <dcameron@...> wrote:
        >> A couple of points.
        >> A package might have been loaded due to it being
        >> within the same file as
        >> another package. For example;
        >>
        >> file A.pm
        >>
        >> package A;
        >>
        >> package A::SubPackageA;
        >>
        >> 1;
        >>
        >> Odd perhaps, but still valid. In this case you
        >> definitely don't want to
        >> do a 'require A::SubPackageA;'. So checking %INC
        >> isn't quite the right
        >> thing to do.
        >
        >I have a question. Does it hurt to do a "require
        >A::SubPackageA", if "A::SubPackageA" has already been
        >loaded? What side effects will that have?
        Well in this case the 'require' will fail because there is no such file
        as A/SubPackageA.pm. But in general you are right, there should be no
        problem in requiring a file that has already been loaded (if I read
        perlfunc correctly!).
        Given this, I am not too sure what SOAP::Lite is really checking for
        when it tests the existence of the symbol table for, in your example,
        module B.

        Regards,
        Duncan
      Your message has been successfully submitted and would be delivered to recipients shortly.