Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Avoiding extra dependencies in co-developed module and application

by VinsWorldcom (Prior)
on Dec 10, 2015 at 14:55 UTC ( [id://1149899]=note: print w/replies, xml ) Need Help??


in reply to Avoiding extra dependencies in co-developed module and application

I'm by no means an expert, but have used 2 and 3 for various reasons. Shameless self-promotion as example relevant to answer to follow:

I developed Cisco::SNMP and the distribution has several simple example scripts. For a much more comprehensive tool, I have https://github.com/vinsworldcom/crapps, which uses Cisco::SNMP - so in this case, I'm using option 2 - split the module and the "tool on its own".

With the CRAPPS tool on GitHub, it not only does the SNMP stuff (with Cisco::SNMP) but also does Telnet and optionally SSH and other stuff too. So it requires Net::Telnet::Cisco but will run without the optional Net::SSH2::Cisco - you just don't get the option to use SSH. There are other modules which I optionally use so if the user doesn't have them installed, the script still runs and if they request an option that requires a module that is not installed, it produces a nice error telling them they need a module to use that feature. So that is like your option 3.

So a question could be, does your tool run without the graphing modules such that you can make them optional? If they are conditionally used, maybe you don't have to have extra dependencies, but if the user sees your PerlDoc and tries to use the graph, they get a nice error message saying they need to install an additional module, but for users not graphing, it will work without additional dependencies.

VinsWorldcom@C:\Users\VinsWorldcom> crapps --ver Modules, Perl, OS, Program info: C:\usr\bin\crapps.pl Version 3.02 - 09 JUL 2015 strict 1.07 warnings 1.18 Getopt::Long 2.41 Pod::Usage 1.63 Sys::Hostname 1.17 Socket 2.013 Cisco::SNMP 1.01 Net::Ping 2.41 Net::Telnet::Cisco 1.10 Net::SSH2::Cisco [NOT INSTALLED] Crypt::PasswdMD5 [NOT INSTALLED] Term::ReadKey [NOT INSTALLED] Perl version 5.018001 Perl executable C:\strawberry\perl\bin\perl.exe OS MSWin32
  • Comment on Re: Avoiding extra dependencies in co-developed module and application
  • Download Code

Replies are listed 'Best First'.
Re^2: Avoiding extra dependencies in co-developed module and application
by Dallaylaen (Chaplain) on Dec 11, 2015 at 14:42 UTC

    Makes sense. However, I would like to keep both the library and the tool under the same repository for as long as possible. My development process (or lack thereof) often includes simultaneous edits to both. I don't want to add jumping between directories to the mix...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1149899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-19 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found