How well is Perl suited for modifying command line output/ Huge Text and XML Files?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanguy
    New Member
    • Dec 2011
    • 2

    How well is Perl suited for modifying command line output/ Huge Text and XML Files?

    Hi,

    I am a SAN Administrator and planning to pick up a scripting language primarily for the following:

    1) process and modify the command line outputs to get it in the desired format.
    All of my management stations are windows so looking for a language that can take in the command line output as input and allow me to grep or awk it, but using some functions or methods provided by the language than something OS dependent.

    2) Processing large volumes of text files and XML Files....readin g from XML Files and allowing me to structure the output in such a way that I can pass that as an argument or a function (or something...sor ry I dont know the right term)to another file or program.

    3) Something that will understand the hex digits so that lets say I want to create hex digits between a range of A and F, then it should autofill B,C,D,and E....It should allow me to sort in Hex.

    4) Automatation of work. Instead of me running 5 commands, each depending on the output of previous command, can I create a script in Perl that will run the commands depending on the output of the previous command? Does Perl have a module that can understand the error codes of commands?

    5) I am also looking at a language that will let me create reports in excel in a graph format etc.

    Is Perl well suited for all this?

    6) Generally, all the elements of a Data Structure are pre defined, but if I dont know how many fields are going to be there in a data structure, will Perl allow me to create it on the fly?

    7) How is Perl in terms of future demand? I keep hearing all this stuff that Perl is Dead, but that doesnt seem to be the case. Is there a demand in the market for Perl Scripting still?


    Sorry if any of my questions, especially the last one seems naive or offending. That is not my intent.

    My intent is to find one good scripting language and stick to it. I am ready to invest time in learning Perl, but then that would depend on how well suited it is for what I am looking for.

    Please let me know.
  • RonB
    Recognized Expert Contributor
    • Jun 2009
    • 589

    #2
    Yes, Perl is well suited for each of the items you asked about and far more.

    Perl is alive and well.

    Comment

    • numberwhun
      Recognized Expert Moderator Specialist
      • May 2007
      • 3467

      #3
      First, here is a history of Perl.

      Second, I would suggest you pick up a good Perl tutorial and read up on how it works. :)

      Regards,

      Jeff

      Comment

      • Niheel
        Recognized Expert Moderator Top Contributor
        • Jul 2005
        • 2432

        #4
        Perl is really well suited for your needs. It's been around long enough that that there are lots of packages to help you with the tasks you've listed.

        Other languages you might try:

        PHP CLI(command line interface) or Python
        Last edited by Niheel; Dec 6 '11, 07:32 AM.
        niheel @ bytes

        Comment

        • sanguy
          New Member
          • Dec 2011
          • 2

          #5
          Hi All,

          Thanks for taking time to reply.

          Niheel - I did try Python, but the indentation confused me :)

          May be Perl will allow me to do all the stuff that I want.

          Just wanted to thank you all.

          Comment

          • numberwhun
            Recognized Expert Moderator Specialist
            • May 2007
            • 3467

            #6
            Don't get me wrong, Perl is one of my favorite languages, but the indentation in Python is actually nice because it forces you into good coding standards. You just have to keep in mind that anything indented in a group is part of the same block of code. You actually get used to it really fast.

            Of the languages mentioned, I would say play with each of them a little bit and see which one suits your needs and you, best. Then concentrate on learning it.

            Perl started out as a kind of glue and a language for parsing text files when Larry Wall was at (I think) NASA. File processing is at the core of its bread and butter. If you have anything specific you are trying to do, try to write code to do it and if you get stuck, post the code here (as well as any errors your receiving) and we will try and help you as best we can.

            Regards,

            Jeff

            Comment

            Working...