Hi all,
as MidLifeXis was saying I am trying to do same thing. Here is my code:
Module Connectivity.pm
use MyDB;
our @ISA = qw(Exporter);
our @EXPORT = qw(ConnectSsh SendAndGet_Cmd);
sub ConnectSsh
{
#connect to shell
#writes to DB
WriteValueToDB ($text)
}
sub SendAndGet_Cmd
{
my ($cmd) = @_;
#sends commands over shell handle
}
1;
MyDB.pm
our @ISA = qw(Exporter);
our @EXPORT = qw(EndRub WriteValueToDB );
sub EndRub
{
#send close command
$op = SendAndGet_Cmd($test);
#add status to DB
WriteValueToDB ($op);
}
sub WriteValueToDB
{
my ($test) = @_;
#write to DB
...
....
....
}
1;
Now you see both are dependent on each other. So if I am getting error declaration is already done. |