Aldebaran that's cool!
The question I ask myself at this stage is whether I want all the functionality to go into a script or shall I create some high-level functions or even a class and store into the module. I usually prefer the latter and in most cases a class. For example, in your case you need to read the API key from the configuration each time you send for a translation. That can probably be stored in your class. So you get functionality like:
use My::Translator; my $trans = My::Translator->new(Config => 'config.txt'); my ($ret, $conf) = $trans->translate("abc xyz"); print "output is '$ret' with confidence $conf %\n";
but even without a class/OOP you get a nice high-level API like:
use My::Translator; my $conf = Config::Tiny... my $prep = My::Translator::prepare_with_some_transformations("abc xyz" +); my ($ret, $conf) = My::Translator::translate($prep, $conf); print "output is '$ret' (via $prep) with confidence $conf %\n";
btw, if you have any scripts you want installed via make install, then insert an EXE_FILES => ['bin/myscript.pl'] into Makefile.PL as a parameter to WriteMakefile() (e.g. just below PL_FILES => {},. In this way make install will install your script(s) along with any module files.
Edit: I also find useful setting temporarily (when doing my own tests) INSTALL_BASE => '$ENV{HOME}".'/usr', as a parameter to WriteMakefile() will install this module in user's own /home/user/usr dir which does not require admin rights.
In reply to Re^3: installing module starter
by bliako
in thread installing module starter
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |