in reply to Re: Nested Modules in perl
in thread Nested Modules in perl
MyDB.pmuse 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;
Now you see both are dependent on each other. So if I am getting error declaration is already done.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;
|
|---|