Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Perl, the right tool for the job?

by Anonymous Monk
on Jan 27, 2012 at 11:43 UTC ( [id://950337]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I want to write an app which will run on tablet computers, for this I can't use perl. The app should comminicate to a server process running on another computer over bluetooth or wireless lan. The server process just interacts with a couple of command line tools. Is perl the right tool for this task? If so what do I need to read up on to get up to speed with bluetooth/networking? I have some perl CGI experience.

Replies are listed 'Best First'.
Re: Perl, the right tool for the job?
by raiph (Deacon) on Jan 27, 2012 at 18:00 UTC
    Please excuse our rudeness. I'm confident perl will be a great choice based on your outline of what it is you want to do (write a server daemon script to sit in the middle of things). Checkout CPAN. All free. An amazing resource. Search there for bluetooth etc. CPAN is generally of surprisingly high quality, but don't expect it all to be good. If you haven't been scared off by our rudeness, please come back if you have more questions.
Re: Perl, the right tool for the job?
by pemungkah (Priest) on Jan 27, 2012 at 18:03 UTC
    Perl may very well be the right tool for the job on the back-end. The tablet side will probably let you do either a Web app (which will work, but will not be optimum for the platform), or a native one, which will give you the best performance and appearance. If it's not an iPad/Xoom/etc., and is a full-up computer running Windows or Linux, then you could use Perl on the client side, probably LWP or WWW::Mechanize -- or maybe the native browser will be sufficient.

    Back-end wise, you have a ton of options. In Perl, there's Catalyst, Dancer, and Mojo; in Ruby, you've got Rails; in Python, you've got Django, Zope, and probably others.

    The real problem is that the problem space is so big that there's no good way to narrow the choices down solely on the basis of feature set.

    Editing, based on discussion above: yes, Perl could be a good choice, but so could any of the others. Remember that wireless and Bluetooth are just transport mechanisms; the protocol you use across the link is completely up to you. I've seen (from my experience with iPhone apps) custom TCP-based APIs; RESTish APIs, WebDAV implementations (over Bluetooth or wireless, depending on which you had handy). So: if it's iOS-related, I'd be happy to talk to you about my experiences with that offline (I've implemented a streaming-audio-over-TCP server that uses standard HTTP protocols over wireless, and can show you sample code for connecting to HTTP servers via URLs); can't help a lot with Bluetooth directly, but I'd be happy to help you find the resources in the iOS documentation. Basically, though, you can implement it very much as if it were a good old CGI app and connect to it that way as long as your server understands how to talk over the protocols you've selected. I will guess that wireless will be much easier than Bluetooth, but I may be wrong.

Re: Perl, the right tool for the job?
by sundialsvc4 (Abbot) on Jan 27, 2012 at 13:15 UTC

    In a very similar situation, I have successfully and recently used the tool haXe (http://www.haxe.org), which is a cross-platform tool, on the client side, and Perl (of course...) on the server side.

    What I would suggest at this point is that you fully flesh out the functional specifications for the project, from stem to stern, paying particular attention to the server side and to the client/server interactions if you think that these will be problematic.   (Not just, “unfamiliar at the moment to you.”)   Be more concerned with what the two computers need to do and to say, than, at this point, with how the trick will be done.   Build a complete and detailed, finished, blueprint of a project that hasn’t even been started yet.   (And don’t start it until you’ve done that.)

    Perl, of course, is the very best tool with which to do anything ... ;-) ... it even makes Julienne fries!

    Seriously, you have plenty of options on the server side.   Plenty of good ones.

Re: Perl, the right tool for the job?
by Argel (Prior) on Jan 28, 2012 at 03:01 UTC
    You might find A new MMOG written in Perl of interest. It's about a game called The Lacuna Expanse that uses Perl on the backend. It has iPhone, PC and web clients. The article the MMOG node links to has a PDF you might find interesting. The "Architecture" section starts on page 36. Sounds like it's overkill for what you want to do, but obviously if Perl is good enough for that it should be good enough for what you are attempting to do.

    Elda Taluta; Sarks Sark; Ark Arks
    My deviantART gallery

Re: Perl, the right tool for the job?
by luis.roca (Deacon) on Jan 28, 2012 at 04:06 UTC

    "If so what do I need to read up on to get up to speed with bluetooth/networking?"

    Since one of your target OSs will be iOS (BSD) you may want to check out FreeBSD and some of the great books that have been written for it as well as the documentation:

    Just to add a little to what others have said, keep in mind that both Android and iOS support HTML5, CSS3 and JavaScript as a way to create a universal language. You can do some of what others have suggested on the back end along with those markup/scripting languages rather than having to learn ObjectiveC and Java. Just another option to think about. Good luck!


    "...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." — Don Quixote
Re: Perl, the right tool for the job?
by InfiniteSilence (Curate) on Jan 27, 2012 at 16:47 UTC

    This question is silly on multiple levels:

    • You don't pick tools and then try to fit them to the problem. You specify the problem as well as you can and then identify the correct tools.
    • "...for this I can't use Perl." Why are you asking this question in Perlmonks then?
    • "...communicate to a server"..."over bluetooth or wireless lan"..."server process just interacts with...command line tools..." Pretty much every toolkit for mobile devices can communicate via bluetooth and/or wireless LAN and every language worth learning or using can shell out to utilize 'command line tools.' That is not a specification. That is like saying 'I need an elephant for my parade' only to be surprised when someone arrives with an eight inch toy elephant.
    • "..what do I need to read up on..." I can help you here. Perl is not the right tool for your task. Your task requires someone to do your work for you and to help you do your research and thinking. There are many toolsets available out there that purport to do exactly that. You should use one of those.

    Celebrate Intellectual Diversity

Re: Perl, the right tool for the job?
by ww (Archbishop) on Jan 27, 2012 at 12:48 UTC
    If you "can't use perl" why are you asking if it's "the right tool for this task?"

    And why do you think you can't use Perl?

    As to "what (you) need to read" it might be well to start by reading Google (or Yahoo or Bing or any other general-purpose search engine), using "bluetooth" and "network" as search terms. Did you expect us to do the research and create an off-topic curriculum for you?

    - -

      Yeah, the OP was not phrased very well, but I 1) understood exactly what he was asking about and 2) was immediately wracking my brain to try and find that game for the iPhone that uses Perl on the backend that was mentioned on this site. Luckily I still have it installed, because finding it has proven to be be like searching for a needle in a haystack (it's "The Lacuna Expanse", btw).

      Meanwhile, all you did was hurl insults at a post you apparently failed to read the entirety of. All I can say is you should really find a better pastime than trolling for poorly phrased questions.

      Update: You know, looking at the OP again, it looks fine to me. It's written in a very casual style, but the OP makes it very clear he's looking for pointers to good resources on what he is trying to do, so a more formal style is not necessary. The only problem I see here is the overzealous responses the OP received.

      Elda Taluta; Sarks Sark; Ark Arks
      My deviantART gallery

      Perl isn't supported by android marketplace and the apple app stores. I didn't expect you to do research for me, just to point me in the right direction if you knew what you were talking about, but it doesn't seem like you do. You didn't read my question, I stated that perl couldn't be used for the tablet part, outlined what the server side component should do and asked if perl was suitable for that task. But thanks all the same, for jumping to conclusions and bashing the newbie. Did you even try a websearch for "bluetooth" or "network", several pages in and the results have nothing to do with what I've asked. Don't give such stupid advice. If you don't know the answer, or don't want to help, fine, just don't pounce on those requesting help.
        You made it difficult to tell what you were asking. You start with a worthless title and start chattering about an app on a tablet instead of getting to anything relevant to what you want. Don't expect people to wade that deep into your post just to find the actual question.

        Simply asking "Does anyone know of some good resources on using perl for bluetooth/wireless communication?" would've gotten you a much better response.

        "I stated that perl couldn't be used for the tablet part"

        Before you flame, I suggest you check your premise.

        A google search for terms("android" "Perl") produces dozens of hits... including these for the first five:

        1. https://www.socialtext.net/perl5/android
        2. http://szabgab.com/perl-on-android.html
        3. http://arul-jegadish.com/release/?p=35
        4. http://code.google.com/p/perldroid/
        5. http://radar.oreilly.com/2009/06/scripting-comes-to-android.html

        Given the number of reputable fora there, I'm led to suspect that one or more would prove useful in terms of running Perl on an Android tablet (but no, I didn't do any more of your research for you). In any case, even if none of those hits and the hundreds which follow 'pan out' for you, it was a valid suggestion, in the face of an inchoate question.

        To your "Did you even try a websearch for "bluetooth" or "network"" the answer is "no" ...because I suggested '"bluetooth" AND "network"' (emphasis supplied) ... and if that forces you to review the hits "several pages in" -- why, I say 'aw, gee, I'm sorry, poor, abused little OP.'

        But, were it not for the tenor of the reply overall, <sarcasm> I might be tempted to ++ it, for including a critical element: the range of tablets </sarcasm> (but, on the other hand, probably not).

        <ill-tempered Note:> List Items deliberately not linkified, with malice aforethought. </ill-tempered note>

        Now excuse me, please, while I rinse the acid off my tongue... and out of my eyes.

        updated with sarcasm tags and to correct missing close_paren

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://950337]
Approved by Ratazong
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-19 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found