Apologies if this post is a little off-topic; I'm hoping that people here will have a little more experience with this than me, and they'll let me pick their brains a little *grin* ...

I'm about to embark on a major project for my final year at University, which will ultimately involve the design and implementation of a web service, alongside a whole load of background work and reporting. The Uni recommend writing this service in Java, but use the phrase "suitable language", and as I'm much more comfortable working in Perl than in Java, it seems to make sense to use Perl, assuming I can sell the idea to my supervisor :)

This is a very new subject to me, and I've done a little research into things like SOAP and Perl's XML capabilities, but there seems to be little out there for someone relatively new to the whole concept, let alone someone that needs to write a convincing argument as to why Perl, rather than Java, is the way to go (and I'm not sure that it is atm).

Those monks who have written/worked on web services in Perl, what made you choose Perl over Java, or another language? Did you find Perl's strengths helped, or that its programming style and features hindered the development? Would you use Perl again for a similar project, or look to different languages?

Finally, can anyone recommend a book (or books) that covers Perl and/or web services? I'd very much like to do some in-depth background reading into the subject, and I'm not having much luck with the net atm :/

Thanks in advance for your help and advice.

-- Foxcub

Replies are listed 'Best First'.
Re: Perl and Web Services
by davorg (Chancellor) on Jul 14, 2003 at 09:38 UTC
Re: Perl and Web Services
by Excalibor (Pilgrim) on Jul 14, 2003 at 10:35 UTC

    Hi there,

    Every time I read the words "web service" stuck together, the alarms in my head goes on like crazy; if there's an ill defined, over hyped phrase nowadays is probably that one.

    Perl can do most Java can do without sweating, however things are less formalized than in the Java world.

    As for the beast itself, Perl has a superb support for databases (DBI) and LDAP directories; and fantastic building pachake(s) like HTML::Mason and an decent support for XML protocols like SOAP or XML-RPC (loads lighter that SOAP) if you can allow its limitations.

    If you know Perl, take the advice given by a fellow monk in this trhead (I forgot who, sorry). If you happen to know Python, Zope can be another (free software) possibility to construct the thing (dunno much about it myself).

    good luck,

    our $Perl6 is Fantastic;

Re: Perl and Web Services
by CodeJunkie (Monk) on Jul 14, 2003 at 11:11 UTC

    Its really interesting to hear you say that, I actually had to make a similar decision last year when I started my final year dissertation for uni. Luckily my supervisor was as keen on Perl as I was, so didn't take much convincing! :-)

    For my final year project I designed a web robot, using the LWP library of Perl modules, check it out here if you are interested: Nebukadnezar Project. It's pretty cool and I managed to get 85% for it! :-)

    I'm not sure what you've decided to do, but the main advantages and reasons I quoted for using Perl were:

    • regular expressions. - This is something it (at least used to) kick java's ass at ;-).
    • Perl is widely regarded as pretty fast and simple and excellent for creating simple web based applications. - Java is slow, strict and laborious (at least in my opinion).
    • There is also a very wide community of help with Perl, I posted lots of message on this site about my project and got lots of help! (i'm not saying there isn't any help out there for java... the might be... I just don't know...)

    The most important thing is that you pick the tool that is best for the job, Also if you know how to program in Perl this is another good reason to choose it over Java. You need to think about the time it would take to learn another language.

    Anyway I hope that's some help, it really depends what kind of web service you are going to write as well I think? Although I guess the most important thing is to take the advice of your supervisor, after all it's them who will be marking it!

    Good luck with the project!


    By the way, thanks to all those people that helped out on my project last year! It was much appreciated and the reason I ended up with a 2:1 :-)

      ... it really depends what kind of web service you are going to write as well I think ...

      Well, the rest of the project brief talks about XML and inter-device operability (the service has to be accessible via a PDA, cellphone, text client, stuff like that), and has to provide "useful content".

      My initial thought was to write a CMS of some sort, to publish stuff online, with XSL stylesheeting to render the pages for non-standard displays. I don't know if that counts as a web service, mind .. *grin* ..

      Thanks for your reply - it's given me some useful things to think about.

      -- Foxcub

        Here you have it, you aren't really sure of what you're being asked for... silly marketroid "web services" expression... sigh

        I'd start defining very well what the thing is exactly going to do and to provide. Then I would ask the boss/customer/whomever if that meets their definition of web services. If so, then go ahead with some precise user requests or some requisites and some design. Then full to code. Do not worry too much about the low level design, you'll change it some 100 times, anyway. Just be sure to follow the "simple" rule of design: 1 thunk, 1 responsibility (for whatever definition of thunk may fit your preferred development paradigm, be it function, object, whichever). Working in layers (like the internet protocol tower works) that provide an API for the next one and connect to another one usually provides a clean, easy to maintain, scalable and plugable design. It, however, makes the program flow more complicated.

        Have a good test suite handy (nothing bad if you write it first, la Extreme Programming) just be sure to keep it updated (my last/current big project in Perl started with very detailed and helpful tests, but as things started to move faster, and the system is extremely decoupled between 3 different machines and 9 processes of which I can only control 5, I preferred the code to be the test itself in the end. Most tests do still work, however, even despite the fact that the interfaces have changed a bit since then...)

        CMS certainly fits my definition of web services, but have you considered something more "ooh-aah!" and service looking like making a multi-display web to offer stocks or searches or such things you can gather around from google or yahoo! using their XML APIs? That should impress anyone and it will give you lots of fun with a lot of CPAN modules as well :-) Be sure to offer a WAP interface, nobody uses it anymore, or maybe they do, but it's a standard and each phone kinda solves the presentation problem by itself (usually not displaying anything but an error, or anything at all); very instructive as well... Oh, whichever it is, a SMS module to send in SMS queries and to get an SMS with a reply back would certainly gain you loads of adepts. It may not look like a web service, but what's that thing, after all?

        good luck,

        our $Perl6 is Fantastic;

Re: Perl and Web Services
by sri (Vicar) on Jul 14, 2003 at 10:49 UTC
    I'm developing web services with perl because I am more comfortable with perl than with java. (btw. I don't like java at all) :)

    SOAP is a little over hyped at the moment, it's just too bloated and the perl binding SOAP::Lite is very very slow. :(

    I have tested a lot of configurations and protocols but finally found the simplest of all to be the best.

    Currently I'm just sending simple xml documents over http using Apache/mod_perl on the server- and LWP on the client side.

    For most services the requests are so simple that I could pass the values on the GET string and only respond with xml files. (This is known as REST)

    If the request is more complex I'm sending an xml document within the request.

    Parsing xml documents with perl is thanks to XML::Parser (based on expat) very fast.
      If you decide to use a SOAP implementation (rather than REST), Paul Kulchenko has a great Perl module called SOAP::Lite ( You do end up with a lot more overhead (read: slow) than a REST implementation, but you can write clients that consume other web services really quickly.
Re: Perl and Web Services
by tibolik (Initiate) on Jul 14, 2003 at 20:53 UTC
    O'Reilly has an excellent service: Safari

    You pay $15 to read 10 books and the first 14 days are free... There are other plans, too.

    Here they are:

    =====> I think now I will read the formatting tips, just to make links behave like links...