in reply to Are we obsessed with CGI?

Is it just me, or are there others out there who would like to see Perl being used in a more widespread fashion, not just by web script jockeys?

I'd like to see Perl used for what's it good at doing. This is obviously a lot of things, one of them being writing CGI scripts. This isn't a bad thing, it's what attracts a lot of people to Perl in the first place and enables them to learn what other roles Perl can fill.

The idea that someone wouldn't ask a question here because they view the site as too CGI centered is silly. If you look around the site and see who frequents it, you'll realize that the chances of a question going over everyone's heads is pretty close to zero.

Replies are listed 'Best First'.
Re: Re: Are we obsessed with CGI?
by strat (Canon) on Apr 17, 2002 at 14:46 UTC
    Hello,

    in my career of a perlprogrammer for four years now I've very seldom written cgi-Scripts or the like (Just sometimes when I needed a userinterface or something to visualize data. count < 20). I mostly use perl for data-munging, interfaces between datasources or systems and such stuff.

    I am a proud member of the german webforum www.perl.de, and there is about the same... I often have to remind the people that perl is more than just cgi. I've seen answers to questions like "How can I read parameters into variables" as the following:

    use CGI qw(:standard); my $var = param("name");
    and the helped people wondered why it didn't work. Yes, they were writing non-cgi-scripts... And I don't know how many people have installed a webserver because somebody told them they need a webserver to write perl-code :-(

    Best regards,
    perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

Re: Re: Are we obsessed with CGI?
by mortenal (Novice) on Apr 17, 2002 at 16:22 UTC
    I used to exclusively use Perl for CGI, but I've found that PHP is much more useful for that application. (IMHO -- don't bother flaming me about this; I've been on both sides of the fence, and I'm not coming back)

    This deeply saddened me, because Perl is such a strong, useful language... so now, I've been forcing myself to use Perl in many other ways, and I've been reaping the benefits. For example, I've written a few applications that write PHP for me. (and in turn, the PHP writes SQL, HTML, JavaScript... and more PHP... yes, a couple of my coding engines write recursively)

    Whenever I need a number of files edited, I use Perl. In short, whenever I need anything that would normally take more time than thought, I use Perl to reverse the thought:time ratio.

      I used to exclusively use Perl for CGI, but I've found that PHP is much more useful for that application.

      I cannot believe that any experienced Perl programmer can be able to like PHP in any way. Have you not experienced the usefulness of strict? Do not you like having modules? Do you like all the parameters being global variables?

      Anyhow, if "code-in-html" is why you choose for PHP, please have a look at PLP, which is perl-in-html.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.
      

        For some reason set register_globals and register_argc_argv to off in php.ini and use error_reporting(E_ALL) or die!* doesn't have the same ring to it as use strict;.

        For me PHP is only really bareable if I do everything in a very strict OO style. The language got off to a really bad start when it comes to language design and is still trying to catch up. They just don't have the big guns behind them like Perl. I think of it as Perl's idiot younger brother. I love it, but still... so much country is covered in CPAN. Over in PHP land it's a wide open prarie, full of bad uns and varmits waiting to be taimed by a few brave souls.

        ()-()
         \"/
          `                                                   ` 
        
        * p.s. Actually do this and most PHP libraries, such as PEAR or Sourceforge, will start choking up blood. A lot of bad habits have built up over the years.
        Lets not get into a religious debate here... but know that I programmed webscripts in Perl for 2 years before I found PHP, and became quite adept at the language for what I used it for. (no master, by any means... but I learned it to the point that I stopped having to look at language references more than once a week or so)

        Many perl hackers haven't seen enough "mature" PHP code to form a valid opinion about it. They see the quick hacks that some of PHP's features allow... but I don't use any of those now. My PHP skill is now far superior to my Perl skill, and the PHP code that I write is cleaner, tighter, and safer than my Perl code. Also, I grew up on C. PHP almost exactly copies C syntax, which keeps me happy.

        Stuff like automatically setting GET, POST, and cookie variables as global is a really bad idea, and a huge security hole. Do you let your users arbitrarily set variables in your scripts? I didn't think so. Neither do I. My PHP code wouldn't generate even a single warning if there was a strict option in PHP.
        Hmm.. this argument seems to be lacking a through knowledge of PHP. Though not modules, using PHP includes with self contained classes emulates this functionality quite easily. and I'm assuming your strict argument and global are the same. Kinda moot there but variables are not all "global" in PHP. Quite frankly PHP is much easier for many cgi functions than perl, that being said Perl is more powerful and obviuosly has the advantage of being much more mature a language. I just find your arguments weak.
      A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Re: Are we obsessed with CGI?
by Anonymous Monk on Apr 17, 2002 at 16:40 UTC
    Where I work, one guy wrote a perl script that uses a data dictionary to generate sql and C code for out application. The sql that is generated by the perl script is used to create the database based on the data dictionary. This include all the indexes and things like that. Of course there is stored procedures that are made the old fashoned way. The C code is used in the C programming we do. We have a generic table API that you call this function pass it the table name and the operation and the key index (0, 1, 2 etc) and then it fills up a structure that was also generated by the perl script. All this allows us to make changes to the data dictionary then run this script and build new databases out of it. Kinda cool.