We had the worst severity 1 problem I had ever seen. Last Friday, for some reason, our database was down, and the main business of the company could be seriously impacted.

One of our main business is store ordering. On one end, the orders are usually loaded into H.Q. database through flat files coming from stores. On the other end, the database outputs flat files and then feeds legacy warehouse system.

With the database down, obviously we lost all the nice functionality provided by our main application. After some brainstorming, we agreed upon an alternative under emergency: to directly transform the store flat files into flat files that can be recognized by the warehouse system.

Now here comes the great opportunity for Perl. In a Java/c# world, Perl shined on that day, because:

  1. It supports quick development. I quickly came up with some working scripts within 1 hour.
  2. It has strong regexp support. That's exactly what we wanted.
  3. Fast, it is not a problem for Perl to process series of big files with lightening speed.

Perl rocks!!!

Replies are listed 'Best First'.
Re: Perl rocks!!!
by spiritway (Vicar) on Aug 07, 2005 at 23:42 UTC

    This is one of the many things I just love about Perl. You have a problem. As you figure out the necessary steps to solve the problem, you have almost written the script that will perform the task. I am constantly amazed at how well Perl fits in with the way I need to work out the logic. I've never seen anything else that comes close.

      "As you figure out the necessary steps to solve the problem, you have almost written the script that will perform the task."

      What you said was so true. It was sort like I just wrote down what was in mind with some natural language.

      My teammates were all amazed. All the main issues were resolved last Friday, but there was some leftover. A guy phoned me this morning and asked whether I could join him at work. He had tons of files needed to be processed, and he wanted my Perl to do it.

      Hey, he made the offer that I could not refuse. It was nice to work in office on Sunday, huh ;-?

      He made the right call, and perl resolved his problem with no time.

Re: Perl rocks!!!
by tbone1 (Monsignor) on Aug 09, 2005 at 13:14 UTC
    I made converts of a bunch of our Oracle people. We had an internal project to do back-end processing; we wanted to take the data files we normally produce for customers and provide them in a fairly wonky format for another group in the company. Being the Unix geek-of-all-trades and de facto text slinger, I was handed the task and thought "You know, I only want to write this once." (We have over thirty data products that we sell, and surely this one product would not be the only one we'd have to convert.) So I wrote a Perl script to read our file format description files and store that data (a hash of arrays of hashes) in a Perl data structure. When we reviewed the code, the Oracle people were impressed. When I told them about the DBI modules, they were ready to jump in feet first. Of course, bloody management said ...

    Well anyway, when they get data that does not map cleanly to the Oracle way or database way, they often come to me to help, or at least to try to get a different view of the data. Not only are they learning Perl, but they are learning to see our data from a different perspective; as such, they are writing better database objects.

    Now that is cool.

    --
    tbone1, YAPS (Yet Another Perl Schlub)
    And remember, if he succeeds, so what.
    - Chick McGee

Re: Perl rocks!!!
by exussum0 (Vicar) on Aug 08, 2005 at 18:55 UTC
    Ok, I'll bite. I'll prolly ruffle a few feathers. But perl does indeed rock as do many things in computer science and software engineering.
    # It supports quick development. I quickly came up with some working scripts within 1 hour.
    # It has strong regexp support. That's exactly what we wanted.
    # Fast, it is not a problem for Perl to process series of big files with lightening speed.
    Point 1 - There are many languages that are quick to write in. Python, perl, Ruby, Java, C++, not asm, C maybe if you are using the GTK and/or GLIB (not glibc). Just a matter of knowing the tools, eh? ddd for C/C++, eclipse for java. I'm sure there's good stuff for Ruby.

    Point 2 - I cannot think of many languages that don't have regexp support. POSIX and perl's implementations of re's have been pushed into many other languages, Either as access to the C library implementations or language native versions. jakarta-oro, a pure java implementation of RE's familiar to perl users. Sun releases one that is similar, but has it's smaller differences. (btw, php, ruby and others support re's)

    Point 3 - Isn't this a case of just (os and in language) buffering? Java's IO layer isn't particularly bad. Were you thinking something specific?

    perl definitely rawks, but I believe it's more for things like, it's very easy to create functions on the fly, or creating code that's very English like. Maybe even for terseness in some cases. A very clean base, vs php, but an extensive amount of modules (via CPAN). Being losely typed is nice too. No Integer.parseInt(....)s.

    ----
    Give me strength for today.. I will not talk it away..
    Just for a moment.. It will burn through the clouds.. and shine down on me.

      Ahem. Sorry something in my throat.

      1. Subjective, ignored.

      2. The regex engine in Perl has more features than the ones in Python, Ruby and Java - and is most likely faster and more robust due to how long it has been part a first-class part of the language. I've seen speed trials that are less than two years old against Python/Perl and Java/Perl. No evidence for Ruby. C++ is apples-and-oranges.

      3. I think the speed in terms of development time of dealing with large files, is where the "fast" comes from. Perl was designed with processing text files in mind, every aspect of the language is geared for it. It has been doing it for a long time and is very good at it. Try recursively processing a directory tree of files in Java to make a histogram of the occurances of words. Now do it in Perl. You will see the difference.

      4. CPAN. Enough said.

      -Andrew.


      Andrew Tomazos  |  andrew@tomazos.com  |  www.tomazos.com
        1. You can't ignore the fact that there are tonnes of good languages. Perl is indeed one of them. Otherwise, oneday, you'll use perl for the most inappropriate thing.

        2. First to market doesn't always mean best. Altavista was great for a while. But now is google. 'sides, perl's regexp has been outwardly ported many many times.

        3. Neither is particularly hard to do. Familiarity with any given language will bring speed.

        4. The ruby and python api's are huge. php's are as well,i'll conceed, though i really don't like it. :) java is insanely huge.