Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Let's face it, Perl *is* a scripting language

by Mutant (Priest)
on Aug 08, 2006 at 09:16 UTC ( [id://566098]=note: print w/replies, xml ) Need Help??

in reply to Let's face it, Perl *is* a scripting language

Perl 5 (and probably Perl 6) *can* be used to write scripts. That doesn't necessarily mean that it's a scripting language (implying that it can only be used for that purpose).

I define a script as something that looks like a script for a play. That is, it has a list of instructions which should be executed in order. There may be the odd sub-routine, but these are mostly in the same file (of course, with Perl, there may be various calls to CPAN modules, but the code specific to this operation is more or less all in once place). Of course there are no hard and fast rules (i.e. you *could* push some of it into a module), but we're talking about a matter of style here.

One way of writing bad Perl (and there are many, TIMTOWDI applies even here) is to attempt to extend this style for use in applications. I'm sure we've all seen this first hand: huge if/elsif/else structures, requires all over the place, global variables used without regard for the future maintainer's sanity. Some of us (myself included) may have even written code like this.

The scripting style is certain useful for small, fairly self contained pieces of code. Or for one-shot jobs that are again fairly simple. Any other use is probably a bad idea.

I think one reason why people who don't know Perl well have difficulty in understanding the difference between a language that can be used for scripting, and a language that can *only* be used for scripting, is that many languages only allow one style. Perl, of course, allows many.

Additionally, many junior programmers don't really understand the concept of coding style. They just use whatever works. That's why, when you ask them to write a more complex application, they may use the scripting style they've always used.

These things can contribute to a bad (but undeserved) reputation for Perl.

Replies are listed 'Best First'.
Re^2: Let's face it, Perl *is* a scripting language
by Ovid (Cardinal) on Aug 08, 2006 at 09:31 UTC

    My reply was extensive enough that I made an update to the root node of this post. I don't think anyone should mistake my main point, but it's clear from what you wrote that I failed to make the point clearly enough.


    New address of my CGI Course.

      Maybe it was just me who failed to grasp your main point :)

      At any rate, I think my point is still valid. The distinction to me is that instead of saying "you're out of date, Perl *isn't* a scripting language", I think the actual message should be "you're out of date, Perl's not just a scripting language, it's so much more!" (wow, that *really* does sound like marketing :)

      The rest of my tirade was just my thoughts on how we got into this perceptual mess in the first place.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://566098]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-06-24 22:00 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.