The stupid question is the question not asked | |
PerlMonks |
Re: How to give promptby 1nickt (Canon) |
on Mar 16, 2018 at 12:02 UTC ( [id://1211030]=note: print w/replies, xml ) | Need Help?? |
Hi, I don't know anything about your requirement or telnet prompts, but your question seems to be one about basic software design. You should write a module named something like MyConnect.pm containing the code that is used for all cases. Then you should write subclasses like MyConnect/SomeDevice.pm and MyConnect/OtherDevice.pm which contain the functions that are specific to each case. Then use the appropriate subclass in each case. See perlmod and many other resources, e.g. https://perlmaven.com/how-to-create-a-perl-module-for-code-reuse.
The way forward always starts with a minimal test.
In Section
Seekers of Perl Wisdom
|
|