NAME Net::Shared::Local
DESCRIPTION
Net::Shared::Local
is the initial class that is used to share the data; it is also the object that actually stores the data as well. You'll almost never have to interface with Net::Shared::Local
objects; most interfacing will be done with Net::Shared::Handler
. However, Net::Shared::Local
does provide 2 useful methods: lock and port. Lock functions like a file lock, and port returns the port number that the object is listening on. See the methods section for more details. The constructor to Net::Shared::Local
takes 1 argument: a hash. The hash can be configured to provide a number of options:
name
-
The name that you will use to refer to the variable; it is the only required option. It can be anything; it does not have to be the same as the variable itself. However, note that if
Net::Shared::Remote
is going to be used on another machine, it will have to know the name of the variable it needs in order to access it. access
-
access is an optional field used to designate which address to allow access to the variable. Assign either a reference to an array or an anyonomous array to access. access will default to localhost if it is not defined.
port
-
If you really want to, you can specify which port to listen from; however, its probably best to let the OS pick on unless you are going to use
Net::Shared::Remote
at some other Location. debug
-
Set to a true value to turn on debuging for the object, which makes it spew out all sorts of possibly useful info.
As stated earlier, there are also 2 methods that can be called: port and lock.
- c<port()>
-
Returns the port number that the Net::Shared::Local object is listening on.
- c<lock()>
-
Works like a file lock; 0=not locked; 1=temp lock used during storage, and 2=completely lock.
MORE
See Net::Shared's pod for more info.