Hello, 

I was a little confused regarding scopes of packages. I did read
portions of 
Programming Perl but am still a little unclear.

Basically, I am trying to implement a simple form of RPC in which 
a command takes in a function name and passes it across to a daemon. The
daemon
using symbolic referencing invokes the function.

the daemon sources in 3 libraries (use A; use B; use C;)
Let's say A contains functions - foo, bar
and   B contains functions - foofoo, barbar
      C contains functions - morefoo, morebar

The daemon's top few lines look like
----------
   package daemon;

   use strict;

   use A;
   use B;
   use C;

A.pm's top few lines look like
----------
   package A;

   use strict;

   use vars qw(@ISA @EXPORT);

   @ISA       = qw (Exporter);
   @EXPORT    = qw (foo bar);

   sub foo
   {
       print "foo called\n";
   }

   sub bar 
   {
       print "bar called\n";
   }
   
The questions I had were
1. To invoke a function (for e.g. foo) - what do i send across from the
client
   command ? - daemon::foo  ? A::foo ? or just foo ? - I guess my
question is
   once you 'use' a package what happens to all the symbols from that
package.
   Do they become part of the importing package ?
2. A followup question is that if B and/or C had the same name
subroutines
   as A.pm did then what would happen.

thanks a lot, 

tarak

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to