in reply to Nested Modules in perl

Hi gjoshi,

Please post us the exact error + the code you are trying so that we can help you better.

Read: How do I post a question effectively?


All is well. I learn by answering your questions...

Replies are listed 'Best First'.
Re^2: Nested Modules in perl
by gjoshi (Sexton) on Aug 04, 2015 at 04:00 UTC
    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.