Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an API for Perl Script

Status
Not open for further replies.

bradhiggins

Technical User
Sep 24, 2003
43
Hey all,

This may sound like an unusual question but please bear with me.

Like other programing languages such as Java you are aple to create a form of API eg a win32 .dll and then allow other applications to call these API functions to interact with your program.

Are you able to do the same using Perl?

I have a client and server script that is written in perl where the client initiates a request of data from the server which does a query on a database and returns the response back to the client script.

What I need is to allow other developers to call the client script from their applications in order to get the return results from the server scripts database query.

Am I making this too hard for myself and I don't need an API? Can a perl script be called easily from a 3rd party program and deal with the data passed back?

Any help would be greatfully appreciated.

Cheers

Brad Higgins
 
If you are using perl for all your programs just write Perl Modules, this is the perl equivelant of a java or c library.

If you are speaking about cross language usage Perl has the same limitations as the language you speak of.

 
Thanks for responding.

I already have the functions I use for this in a Module as I also use the same module for a Web application using CGI.

I think I am asking how do I go about creating an interface that allows a non Perl Language to call my Perl Scripts and/or use my Modules.

Cheers Brad
 
As with other languages you need to either wrap these in some other technology or expose them via another layer.

Usually this layer is a web-services API but other times it is language specific.

For example, C does not directly call Java code but I bet there is some person out there who has written a Java->C wrapper that C can access.

Specifically ,what language do you want to call your perl modules from??
 
Other developers will be trying to use my perl scripts within their applications.

They haven't told me what languages they use but I assume it will be either C++, VB or Delphi.

So I might leave it up to the developers to see if they can create a way to connect to my perl scripts rather then me do the running around for them.

cheers

brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top