Adding installable script to a perl module distro?
am 30.08.2005 21:24:55 von unknownPost removed (X-No-Archive: yes)
Post removed (X-No-Archive: yes)
Ignoramus8644 wrote:
> I created a perl module distro Net::eBay, and added to it a small
> sample program get-ebay-official-time.pl. How do I make it install
> into /usr/bin without being too unix specific.
I suppose you're using ExtUtils::MakeMaker for your module.
Have a look at the EXE_FILES parameter.
Rob
Post removed (X-No-Archive: yes)
Ignoramus8644
> On Tue, 30 Aug 2005 21:50:04 +0200, Robert Jordan
> wrote:
>> Ignoramus8644 wrote:
>>> I created a perl module distro Net::eBay, and added to it a small
>>> sample program get-ebay-official-time.pl. How do I make it install
>>> into /usr/bin without being too unix specific.
>>
>> I suppose you're using ExtUtils::MakeMaker for your module.
>> Have a look at the EXE_FILES parameter.
>
> Thanks. I did it, but it does not install into /usr/bin when I do
> "make install". It installs into
>
> /usr/lib/perl5/site_perl/5.8.6/Net/ebay-official-time.pl
>
> It's not where I want it to be. Any ideas?
I wouldn't want a script to install *anything* in my /usr/bin.
If it's a short example I would put it in the pod documentation.
If you want to have it installed,
/usr/lib/perl5/site_perl/5.8.6/Net/eBay/examples might be a good place
or
/usr/lib/perl5/site_perl/5.8.6/Net/eBay/eg
or
/usr/lib/perl5/site_perl/5.8.6/Net/eBay/demo
(after a look at my C:\Perl)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Post removed (X-No-Archive: yes)
Ignoramus8644
> Well, it is a useful script. People could use it.
Like I said, put it in the pod doc. I can't imagine it's more then 10
lines.
Just a q wrt documentation:
DetailLevel => "0",
I doubt "" are needed here
* function1
* function2
* officialTime
?
I have no idea how the api works, but
$ebay->submitRequest( "AddItem",
maybe $ebay->AddItem would be easier? (or $ebay->add_item, see below)
And things like DetailLevel, ErrorLevel, etc. shouldn't they be set
globally?
(and finally, either use CamelCase (e.g. DeveloperKey) or under_scores
(e.g. site_level). I prefer the latter, more Perlish.
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Post removed (X-No-Archive: yes)
Post removed (X-No-Archive: yes)
Ignoramus8644 wrote:
>>
>>I wouldn't want a script to install *anything* in my /usr/bin.
>
>
> Well, it is a useful script. People could use it.
But it shoudl be installed into $Config{'installsitescripts'} (IIRC),
if anywhere.
This may well be somewhere other than /usr/bin, but should be
appropriate for any particular Perl instalaltion.
--
Just because I've written it doesn't mean that
either you or I have to believe it.
Post removed (X-No-Archive: yes)
"Ignoramus8644"
> >
> > But it shoudl be installed into $Config{'installsitescripts'}
(IIRC),
> > if anywhere.
I think that should be $Config{installscript}, which is where EXE_FILES go.
> >
> > This may well be somewhere other than /usr/bin, but should be
> > appropriate for any particular Perl instalaltion.
>
> Hm, how do I accomplish that? I do not think that the script was
> installed into any other place than the one I mentioned.
>
The place you mentioned and $Config{installscript} should be one and the
same place. To check, run:
perl -V:installscript
Cheers,
Rob
Post removed (X-No-Archive: yes)
Ignoramus8644
> On 30 Aug 2005 20:41:56 GMT, John Bokma
>> DetailLevel => "0",
>>
>> I doubt "" are needed here
>
> Whatever, that 0 is not going to be used numerically, it is a string.
Which Perl probably handles for you ;-)
>> * function1
>> * function2
>> * officialTime
>>
>> ?
saw the above in the documentation, but no idea what it means
>> I have no idea how the api works, but
>>
>> $ebay->submitRequest( "AddItem",
>>
>> maybe $ebay->AddItem would be easier? (or $ebay->add_item, see below)
>
> Not really, my Net::eBay does not know any application details.
Which might be a pitty, see below.
> It
> simply wraps requests into proper XML, supplies eBay credentials and
> sends the request to ebay. Every request has a name, and a hash of
> parameters. (hashes of hashes are allowed and are translated into
> proper XML structures).
Yes, but a module is a nice place to make things abstract, and easier to
use.
>> (and finally, either use CamelCase (e.g. DeveloperKey) or
>> under_scores (e.g. site_level). I prefer the latter, more Perlish.
>
> I'll think about it. My reasoning when I did the original module was
> that the keys and token are ebay values, and site_evel is purely a
> perl value that ebay knows nothing about.
Ok, clear. But you are already "translating" XML to Perl, so why not go
all the way, e.g. hide the whole fact that it's just hashes translated
to XML, and CamelCase. Just provide a module that has a very easy
interface to use, but internally does all the work.
You might for example both support "raw" methods, and nice wrappers
(e.g. $ebay->add_item, or even add a Net::eBay::Item class instead of
passing a hash).
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Ignoramus8644
> I changed site_level to SiteLevel and cleaned up the pod
> documentation. Just uploaded Net-eBay-0.06. Thanks John.
You're welcome. :-)
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
Post removed (X-No-Archive: yes)