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

module privacy

Expand Messages
  • Jason Yates
    In the simple example below, I import the CGI module but only the :html2 export group. Then I use SOAP::Lite to dispatch the CGI module. The problem is
    Message 1 of 3 , Nov 26, 2002
    • 0 Attachment
      In the simple example below, I import the CGI module but only the :html2
      export group. Then I use SOAP::Lite to dispatch the CGI module. The problem
      is SOAP::Lite dispatches every function inside CGI.pm, whether it's in the
      :html2 or not. How can I only dispatch the functions included in the :html2
      export group.

      use SOAP::Transport::HTTP;
      use CGI qw(:html2);

      SOAP::Transport::HTTP::CGI
      -> dispatch_to('CGI')
      -> handle;


      Jason Yates
    • Paul Kulchenko
      Hi Jason, ... True, but import is more convenience than protection mechanism. Even if you import :html2 only you still can access any other function using full
      Message 2 of 3 , Nov 26, 2002
      • 0 Attachment
        Hi Jason,

        > The problem
        > is SOAP::Lite dispatches every function inside CGI.pm, whether it's
        > in the
        > :html2 or not. How can I only dispatch the functions included in
        > the :html2 export group.
        True, but import is more convenience than protection mechanism. Even
        if you import :html2 only you still can access any other function
        using full notation CGI::foobar. It's possible to do something like
        this; see if it works for you:

        use SOAP::Transport::HTTP;
        use CGI qw(:html2);

        my $cgi = 'CGI::('.join('|',@{$CGI::EXPORT_TAGS{':html2'}}).')';
        SOAP::Transport::HTTP::CGI
        -> dispatch_to($cgi)
        -> handle;

        Best wishes, Paul.

        --- Jason Yates <jaywhy2@...> wrote:
        > In the simple example below, I import the CGI module but only the
        > :html2
        > export group. Then I use SOAP::Lite to dispatch the CGI module.
        > The problem
        > is SOAP::Lite dispatches every function inside CGI.pm, whether it's
        > in the
        > :html2 or not. How can I only dispatch the functions included in
        > the :html2
        > export group.
        >
        > use SOAP::Transport::HTTP;
        > use CGI qw(:html2);
        >
        > SOAP::Transport::HTTP::CGI
        > -> dispatch_to('CGI')
        > -> handle;
        >
        >
        > Jason Yates
        >
        > ------------------------ 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!?
        Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
        http://mailplus.yahoo.com
      • Keanan Smith
        dispatch_to( Module ) dispatches to the *entire* module (It has nothing whatsoever to do with the export list) if you want only certain functions to be
        Message 3 of 3 , Nov 26, 2002
        • 0 Attachment
          dispatch_to('Module') dispatches to the *entire* module (It has nothing
          whatsoever to do with the export list) if you want only certain functions to
          be accessible, you need to dispatch to those functions, you'd want to do
          *something like* (Although this wouldn't work for all cases)

          dispatch_to(map('CGI::$_',@{$CGI::EXPORT_TAGS{:html2}}))


          -----Original Message-----
          From: Jason Yates [mailto:jaywhy2@...]
          Sent: Tuesday, November 26, 2002 12:14 PM
          To: 'soaplite@yahoogroups.com'
          Subject: [soaplite] module privacy


          In the simple example below, I import the CGI module but only the :html2
          export group. Then I use SOAP::Lite to dispatch the CGI module. The
          problem
          is SOAP::Lite dispatches every function inside CGI.pm, whether it's in the
          :html2 or not. How can I only dispatch the functions included in the :html2

          export group.

          use SOAP::Transport::HTTP;
          use CGI qw(:html2);

          SOAP::Transport::HTTP::CGI
          -> dispatch_to('CGI')
          -> handle;


          Jason Yates


          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/
        Your message has been successfully submitted and would be delivered to recipients shortly.