简体   繁体   中英

Wrapping up a Perl script into a webservice

I have a Perl script that can be run from the command line and takes a file as an argument. I want to be able to call this script from my JavaScript (in a Firefox addon). I was planning on using XMLHttpRequest . But what is the best way to wrap up my Perl script into a webservice? (Is there any Perl to SOAP convertor?)

But what is the best way to wrap up my Perl script into a webservice?

  1. Split the existing functionality of the code into a module that does the work and a small wrapper script to add a command line interface
  2. Write another wrapper that presents a web interface. (Probably using something like CGI::Application (which now supports other interfaces, so you aren't restricted to CGI) or Web::Simple ).

(Is there any Perl to SOAP convertor?)

Don't use SOAP.

SOAP is chunky, complex, and covers many many edge cases that are unlikely to be problems for you. Use a light weight RESTful API instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM