Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

What do you use Perl for and Why?

by pg (Canon)
on Oct 12, 2003 at 19:50 UTC ( #298703=perlmeditation: print w/replies, xml ) Need Help??

Hope meditations is the right place for this post.

I think there are two types of Perl guys, one type uses Perl for everything or most of their things; one type uses Perl for certain things, or under certain situations. Now, each type of person has their reasons. Well, this is not this post is really about. I am just thinking, whatever which type you are, it is interesting to know what our monks are doing daily (maybe only once a while) by using Perl? Your project (can simply be a fun project for yourself)? Why do you pick Perl?

Okay let's talk about myself as a starter.

I am the second type of guy, so I only use Perl for certain things. It is partly because that I worked for a large corporation (I dismissed myself from the army per Anonymous Monks comment ;-), although I am a team leader, I don't always have the right to pick the language for each project (On the other hand, I don't always pick Perl, even if I have the right, if it does not fit ;-)

I have written some testing tools for a large communication system in Perl. i also did quite a few small tools for myself and my team in perl.

I use Perl whenever there is a need to quickly put something together, to help the main projects I am working on.

I don't usually feel comfortable to do an entire big project in Perl, and never made or supported this kind of decision.

I have my own web site running, and the server side is 100% Perl when the client side is mainly Java applets and Code Fusion.

A kind reminder: This post is not about to heat up some heated argument whether Perl is better or the best (I saw this kind of fighting couple of times here, and to be frank I hated those ;-), this is just about telling your own success story and Perl life, and enlighten other monks so that they might use Perl next time for something they would not usually use Perl.

Replies are listed 'Best First'.
Re: What do you use Perl for and Why?
by Abigail-II (Bishop) on Oct 13, 2003 at 00:09 UTC
    I've been programming in Perl since 1995. The first year and a half, I did some webstuff with it, but nowadays, I hardly do webstuff. The only webstuff I do are some cron jobs that generate simple HTML files.

    I've used Perl in all of the many jobs I've had since 1996, although the only programming job I had in those 7 years lasted for a mere 10 weeks. In all other cases, I used Perl to write tools to make my (work) life easier. This varied from one-liners to move around some files, to a project that modified/created about 500 files containing SQL statements, generating over 75,000 lines of SQL code. Most of the Perl I've written, and most of what I write nowadays could be considered "systems coding". If I wouldn't have had Perl, most of my code would be in sh and AWK. I'd also say that most of my programs are less than 100 lines, and using more than 200 is rare. Most of my programs do just one thing, and are specifically written to do that thing. A large fraction, probably more than half of the programs I write, run only once (not counting test runs), and are discarded afterwards.

    And I can say the same about what I do with Perl at home. Except that at home, I also write Perl code just to experiment, or to do fun and exciting things, like creating whacky regexes and JAPHs.


Re: What do you use Perl for and Why?
by kutsu (Priest) on Oct 12, 2003 at 20:17 UTC

    To take your question in steps: I use a combination of perl, html tinkering, and javascript for web-development. Use a combination of perl and korn shell for must Linux applications. I'd like to be able to write perl executables and GUI applications, I'm learning Tk at the moment, but for now that's in the relm of java and VB. My favorite use for perl is to make my own computer run better and to tackle little ideas and problems I have.

    Why: I started using perl for webpage design because that's what the scripts I would be working on were written in - I continue to use it for it adaptablity (esp. used with CGI and HTML::Template). When I write scripts for Linux, they need to be able to easily pass and obtain data from the OS and other scripts, which many times are not written in perl, perl offers the best and quickest way for me to do this. I have little control over what I write my executables and GUI in, so even after learning Tk well enough to use it, it will be a while before I use it at work.

    "Pain is weakness leaving the body, I find myself in pain everyday" -me

      I consider myself a computer user who programs to get a job done, and not a programmer. You are very limited as a computer user if you don't program.

      I wanted to write a 21st century Family Photo/History Book, a sequel to a Family Book written in 1917. I didn't even consider a paper version. Paper books are static, and it is unclear if paper books will even be popular in 100 years, or if they will be something people collect like stamps? So, a "Living Book", in an electronic format seemed the way to go.

      I chose Perl because I was told it could be done in Perl. Perl is difficult for a non programmer to learn, but makes life very easy after you start thinking in Perl. Initially I tried Tk and HTML for the UI, the results were ok but not really acceptable. I migrated to Flash for the User Interface, which I suppose is a seperate language, but I just view it as an exotic file format managed by Perl.

      Perl seems to have been a very fortunate first choice. It is amazing how much you can accomplish without understanding the details of how a computer works. Although I view the Flash Player as a transitory technology, I am hopeful Perl will be like Fortran or Cobol, supported long after it has passed its prime.

      Mindless plug from a non pro programmer, OReilly Books are like Lessons from the Gods!!!
Re: What do you use Perl for and Why?
by nimdokk (Vicar) on Oct 12, 2003 at 20:51 UTC
    Why we use Perl? Well I am one member of a small team that maintains an automated file transfering system. It runs between Unix, Windows2k and Mainframes, as well as whatever our clients might happen to be using to drop off or pick up files from our site. We primarly use Perl to glue together some of the diffenent applications we use (i.e. PKZIP, PGP, SilverKey, and so forth). We were using NT command scripts on the NT side but I pushed to start using Perl there as well as on the Unix side because we could consolidate code and it would be relatively platform independent. Perl also gives us greater flexibility in scripting and it runs very fast. I've also demonstrated how fast Perl can be used to generate monthly reports from the logs that our system creates. Also, Net::SMTP makes things like email notifications quicker and require less in the way of platform specific solutions. By standardizing to one language across both of our main platforms, code developed, tested and working on one can (with some modifications) be used on the other. This also eases troubleshooting when a script breaks, you simply learn how the basics of one language works and then you don't have to switch as many mental gears when going from one platform to the other. Also, with POD, we can keep documentation within the code itself which is a big plus. Hopefully this will enable us to have a system that is relatively fault-tolerant and can be easily be maintained by future people.

    "Ex libris un peut de tout"

      Yes, Perl is fast, and that actually amazed me when I first started using Perl. That largely changed my view as what scripting language is, or to be more precise, whether Perl is still a traditional scripting language. After a while, when I realized Perl's extended coverage (thanks to Perl core modules, and mostly to CPAN.), I now no longer view Perl as (traditional) scripting language.

      A major benefit I got from Perl is that, Perl actually allows me to spend more time thinking, instead of coding. I recently wrote in Perl, a tool that analyzes the performance of our system. It basically reads a log file (that has time stamps with log msgs), and do whole bunch of regexp. It worked great. It only cost me two hours and quickly pointed out the bottle neck of our system.

      Late when someone asked why not using Java, and I told him if he could write it in Java within 10 times the size of my Perl code, I would use Java (10 times is probably a little bit ... but I don't think it is too wrong)

Re: What do you use Perl for and Why?
by jacques (Priest) on Oct 13, 2003 at 02:47 UTC
    I use Perl as an outlet for my creative urges. It seems like many languages seek to strip the humanity from the code. Perl, on the other hand, encourages individualism. It puts us back into the equation. When I program in Perl, I feel like I am having dinner with an old friend, who is overjoyed to see me again. I feel accepted, as I sip the red wine.
Re: What do you use Perl for and Why?
by pinetree (Scribe) on Oct 13, 2003 at 02:42 UTC

    I guess I fall into the first category - those who use Perl for most things. While not 100% of my coding is in Perl, Perl is usually my first choice language.

    What my Perl does at work:

    • Send email (I built an email engine for our outbound marketing email with a rough speed of 40-50,000 personalized emails/hour. The average size list that's sent right now is anywhere from 100,000 - 450,000 addresses.
    • Build lists of email addresses for mailings from our customer database. I have a number of list building scripts that do most of the heavy lifting when it comes to building outbound email lists:
      * build lists based on SQL query
      * build a list of x random users based on a SQL query
      * create an A/B split of a list
      * split one list based on another
    • Create XML feeds for partners
    • Handle incoming data feeds
    • Provide web-based self service tools for other departments

    I'm sure there are other scripts I've missed but these are the ones I work with the most.


      Did you really want to admit to being a spammer in public?

      UPDATE: It is possible that I am being premature. Certainly there are many legitimate reasons to send lots of email, and I have done so myself.

      However my presumption definitely was that someone whose job entails little but sending impressive amounts of "personalized bulk mail" is likely to be engaging in spam. As a project or three among many others, that makes sense. But little but?

      I wonder what other people's experience is?

        Did you really want to admit to being a spammer in public?

        I think that applying the "spammer" label is a bit premature. There are plenty of business that have large customer bases that they contact via email. Somebody needs to turn the crank. A friend has a completely legitimate job that sounds very much like what pinetree describes, minus Perl.

Re: What do you use Perl for and Why?
by allolex (Curate) on Oct 13, 2003 at 07:21 UTC

    After having spent a rather long dormant period vis--vis programming, I picked up Perl because it is very useful for the kind of work I increasingly find myself doing. I work in the area of computational linguistics, with a heavy emphasis on the linguistics, i.e. I like to focus on rule-based approaches, as opposed to statistical fudging, because if you write your rules well, you can apply them to all kinds of data, whereas statistics are often only applicable to the data you used to generate them.

    Anyway, I've found that the knowledge I've gained about Perl and programming in general has, in the last couple of years, broadened by horizons to the extent that I am now considering approaches and projects that were simply beyond me back not too long ago. For one, I tend to use "Find & Replace" in OpenOffice a lot less...

    So what sort of things have I been doing that involve Perl:

    • Wrote a dictionary tool (thread, code)
    • What are the monks doing with Perl and Linguistics?.
    • Got linguistic data (newspapers, books, etc.) from various sources (internet, CDs, etc.) and converted it into SGML/XML (or whatever).
    • Indexed corpora for our dictionary project's database.
    • Tried to help people with topics I know something about (finally!)
    • Wrote a suite of scripts to maintain my mutt and procmail installation: alias coloring, generating list filters from list subscriptions, etc.
    • Fixing broken HTML, generating web pages.

Re: What do you use Perl for and Why?
by Anonymous Monk on Oct 12, 2003 at 20:05 UTC
    I worked in a corporal environment,

    You mean in the military? :-P

      No no, it means he has a physical body. He is not just a disembodied, Perl-programming spirit.

      -- Mike

      XML::Simpler does not require XML::Parser or a SAX parser. It does require File::Slurp.
      -- grantm, perldoc XML::Simpler

Re: What do you use Perl for and Why?
by Old_Gray_Bear (Bishop) on Oct 13, 2003 at 15:52 UTC
    I guess I fall in the middle, sort of. I got into the Unix/Linux world after spending 25 years in IBM mainframes. I encountered Perl and realized that the language was designed by Programmers for Programmers, to make Programming easier.

    After a few months of reading and writing a few small scripts (20 - 100 lines, including comments), I came to the conclusion that Perl probably should be my language of choice when confronted with a New Problem, with excursions into Shell or Java (and now C), only when I am forced to. (When 90% of the New Problem is already available as Java classes, it does not really make a huge amount of sense to re-code. Just write the additional class to glue everything together and get out.)

    Now my first thought when Management drops a New Problem in my lap is "I wonder what's on CPAN that addresses this...", and I am off. The ability to get a quick'n'dirty mock up of what they want seems to really impress the Management. And the fact that I can flesh out the demo/skeleton into a real application so quickly is a real plus.

    Perl lets me do what I want to, with out getting in the way. (You might consider Perl the 'Learned Hand' of program languages -- it tells you how to do what you want to do.)


Re: What do you use Perl for and Why?
by mpeppler (Vicar) on Oct 13, 2003 at 14:53 UTC
    I've been using perl since 1990 - originally for system administration type jobs, then as glue/reporting code in a commodities trading system. Later I was lead engineer on a large data migration project at a large Cable TV company with the target of moving all of their billing data from legacy Tandem and IBM systems to a distributed Sybase system (in perl, of course). Later still a lot of web-related stuff...

    Nowadays I mostly write DBA scripts, and maintain the Sybase::* and DBD::Sybase modules.


Re: What do you use Perl for and Why?
by zentara (Archbishop) on Oct 13, 2003 at 14:55 UTC
    The one thing no one has mentioned, is what Perl teaches you about running linux systems. There were so many things I was unaware of, until I saw a Perl script "doing it". Then I began to "wake up" to what is going on behind the gui. The biggest use of Perl for me is the learning experience.
      I have been writing Perl since it was offered as a programming class in college. Since then I work at a University that needed a Perl programmer for various "in house" tasks. Most of my scripts are for system admin stuff, permissions, data crunching, e-mail users, disk usage, CPU usage etc...

      It's very interesting being strictly on windoze but it's fun!
Re: What do you use Perl for and Why?
by bakunin (Scribe) on Oct 13, 2003 at 17:08 UTC
    It was 1998 when I'm first introduced to a programming language, namely C++. It was OOP, and I was struck by it. From that point on, it is OOP forever. The OO design did something to my neurons; I will come to this point later again.

    The second most important thing in my programming life was the Internet. First I thought I should be in it, then I said to myself, I should work in this field.

    Consecutively, I met with Linux through internet. The philosophy of Open Source, the quality of Open Source, the quantity of Open Source... "OK, Linux it is" I said.

    Two years had passed with no achievement on the programming front.(due to school, terrible terrible times)

    I was using Linux and I had the ongoing desire to learn web programming to build e-business sites. Now the question had arisen. Which programming language for database management? C++ and MySQL, together! Sounds nice and I know the language... I had heard Perl of course. I got the Camel book, but never touched it!

    At that time, I had to take a Java class at school. OOP and Java... Hmmm... My friends still don't understand why I don't use Java.

    I tried php, worked OK. I can't explain it.

    I had bought a book on MySQL from Oreilly. My intention was to learn the database. But as I explained, the programming language choice was very problematic.
    The book covered several extensions. And there it was, Perl. In 24 hours, I was back with Java, cursing... "Final decision" I said... Then I saw the Camel book on the shelf.

    Friends, call it political, call it ideological, call it weird... I wouldn't be using Perl for anything if I weren't using Linux. When I saw the Camel book, I distinctly remember that I waited for a minute, looking to the cover, as if I was making a life altering decision... Well I think I was. I decided to give Perl a try no matter what, since at that moment to me it was what Linux was... The book explained the weird Perl syntax. My neurons again was triggered. There was nothing weird about Perl. Unlike the other languages, Perl was humane. As the name suggests, Perl is practical. Very...Perl is humane; and this one sentence alone explains the reason why it is so powerful and preferable.

    Today, I am doing (OO) web programming with Perl. This includes the visual design(CSS), database management, CGI applications, and SWF animations. Yes! SWF animations!
    With ming-perl. I actually expanded ming-perl with Perl!!

    If I don't create every bit of mark-up,animation and style sheet automatically, I can't sleep.

    In short, I'm using Perl for everything I devoted my programming life for. Here and there I have distorted opinions and desires, but Perl does not get angry, on the contrary, it assists me in any way it can; never lets me down.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://298703]
Approved by kutsu
Front-paged by kutsu
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2023-09-25 03:03 GMT
Find Nodes?
    Voting Booth?

    No recent polls found