From: Tony F. <to...@sy...> - 2006-11-13 20:33:55
|
On Mon, 2006-11-13 at 14:32 -0500, C. Duncan Hudson wrote: > I have several shell scripts that load invoices & pos, and which > print > pick lists. I'm in the process of moving them all to > LWP::UserAgent. > The way I see it I'm safer with LWP then I am with the API - the API > requirements are far more likely to change then the screens are. > Even > if the screens do change then it's pretty straight forward updating > the > Perl script. Also, I agree that it's better to not have to shell to > call the API as that's just another point of failure. It's also > difficult to determine whether the API call actually worked or not. > I > think there was some talk, along time ago, about a Perl module for > SQL-Ledger, but that would get outdated in no time. LWP, in my > opinion, > is a better fit. I agree with your LWP opinion. The API and the HTML forms are basically the same. All the API is is a way to supply the CGI scripts a query string as a command line parameter. I also think that scripts that use LWP (or any HTTP library) are more flexible, all they need is HTTP access to you SQL Ledger installation. They don't need to run locally on the SQL Ledger server. Some time ago I wrote this proof of concept code: http://openledger.sourceforge.net/SL-Api.tar.gz Basically, it provides a simple to understand PERL API by automating the SQL Ledger web interface with LWP anf HTML::Form in the background. As it was only a proposal and no one showed any interest in it at the time it only works with the GL. Adding more modules shouldn't be a big deal though. -- Tony Fraser to...@sy... Sybaspace Internet Solutions System Administrator phone: (250) 246-5368 fax: (250) 246-5398 |