Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Perl vs java?

  1. #1
    Join Date
    Jul 2009
    Location
    England
    Beans
    54
    Distro
    Ubuntu 10.04 Lucid Lynx

    Perl vs java?

    Well, i'm currently browsing the net to try and answer for this as i'm writing and assignment for uni. Well. final year project.

    So what is the advantage of writing a program in one or the other?


    The program I am planning to write will keep a computerised backup of a plan of our uni network and where all ports are plugged in, etc. It will load data from flat files, compare files, create backups, enable users to log in and keep a paper trail of their usage so that other users can see who changed what while being able to revert to old working versions if someone changes something in the real network and breaks it.


    So... your thoughts. To me there does not seem to be much difference, faster to make programs in perl and less strict but ive never used perl so...

    If anyone knows any links to any good articles or anything discussing this. I'll keep hunting though, infact I think i'll moove to a diff planning part as i've been on this point for quite a while.

    I've been looking at

    http://oss.oetiker.ch/mrtg/index.en.html

    Which is designed to interrogate network switches via SNMP (which is the 2nd part to my project) and it written in perl so that's why i'm overall a bit stumped.

  2. #2
    Join Date
    May 2009
    Beans
    303

    Re: Perl vs java?

    Java will range from slightly slower to much faster depending on what exactly you're benchmarking, will scale better, but will take more memory and has a slower startup, amen.

  3. #3
    Join Date
    May 2007
    Location
    I really do not know.
    Beans
    130
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Perl vs java?

    I would recommend Java as well for such a project.
    perl is more of a scripting language isn't not suited for that type of project (not impossible thought)
    The road not yet taken.

  4. #4
    Join Date
    Jan 2006
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Perl vs java?

    if you're using flat files, Perl all the way. Perl also doesn't throw up like Java does on large inputs.

    and always use strict in Perl.
    I am infallible, you should know that by now.
    "My favorite language is call STAR. It's extremely concise. It has exactly one verb '*', which does exactly what I want at the moment." --Larry Wall
    (02:15:31 PM) ***TimToady and snake oil go way back...
    42 lines of Perl - SHI - Home Site

  5. #5
    Join Date
    Apr 2008
    Beans
    507

    Re: Perl vs java?

    Quote Originally Posted by 0cton View Post
    I would recommend Java as well for such a project.
    perl is more of a scripting language isn't not suited for that type of project (not impossible thought)
    I disagree. Perl is perfectly suited to system/network administration. Far more so than Java. There are countless Perl modules that deal with SNMP etc. Search CPAN or look here http://net-snmp.sourceforge.net/

    For *any* kind of text parsing, Perl flogs Java hands down. Trust me you don't want to do serious text parsing in Java it is a nightmare.

    If you were to opt for Java here then be prepared to write *alot* of code.

    And do take Slavik's advice, if you use Perl always use strict (and warnings).
    Go you good thing!

  6. #6
    Join Date
    Sep 2009
    Location
    New York City
    Beans
    116

    Re: Perl vs java?

    Quote Originally Posted by JayKay3000 View Post
    ...

    It will load data from flat files, compare files, create backups, enable users to log in and keep a paper trail of their usage so that other users can see who changed what while being able to revert to old working versions if someone changes something in the real network and breaks it.

    Perl hands down.

    There is a decent book, "Perl for System Administrators"

    Doing system administration in java is like using a Winnebago to cut grass.
    It's easy to solve the halting problem with a shotgun.

    -- Larry Wall

  7. #7
    Join Date
    Sep 2009
    Location
    New York City
    Beans
    116

    Re: Perl vs java?

    Quote Originally Posted by 0cton View Post
    I would recommend Java as well for such a project.
    perl is more of a scripting language isn't not suited for that type of project (not impossible thought)

    What does Java offer for system administration that is even remotely close to Perl??

    Perl has been called the Swiss Army Chainsaw of Unix utilities -- why would anyone use a quasi-compiled, typed, OO language that requires a VM for a basic set of system tools?

    Did you think before you responded or are you just another fanboy?
    It's easy to solve the halting problem with a shotgun.

    -- Larry Wall

  8. #8
    Join Date
    Nov 2008
    Location
    Lleida, Spain
    Beans
    1,157
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Perl vs java?

    I'm a java programmer and if I were you I'll use perl for this stuff.

    Java should not be used for system administration, of course java brings you things as jpa and ejb, and thousands of classes for do what you want in an easy way, but you should realize of the requeriments of your project.

  9. #9
    Join Date
    Jul 2009
    Location
    England
    Beans
    54
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Perl vs java?

    Cheers for the input guys. I was going to type 'i'm more confused than ever' oh wait. I just did .

    But seriousley I think based on what you say I think I better understand to what perl can be suited for and what java can be suited for.

    Great to get some real feedback, articles on the net get a bit vague sometimes.

    We learnt java in uni but I think I will have a look at perl in a bit more detail anyway. I nearly brought a book on it the other day. It definatley looks interesting but the 'you can do one thing a thousand ways scares me a little'

    Without trying to start a flame war, i've read that everything you can do in perl you can do in java, then again they say everything you can do in java you can do in C++ so that may have been a throw away comment.

    Again. Thanks for the input.

  10. #10
    Join Date
    Aug 2006
    Location
    Germany
    Beans
    396

    Re: Perl vs java?

    exactly the point, you have to choose what language/framework is appropriate for the problem and then also what you can learn/use easy.

    That's not easy to decide since you have to code and not anyone who writes here.

    Maybe look at sample implementations of important sub problems for your project and see where you can grasp concepts and such the best way.

    regards Andreas
    the jvm is my home...
    http://clojure.org/
    http://www.scala-lang.org/...and it rocks a lot!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •