Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.

In reply to Re: Let's face it, Perl *is* a scripting language by Mutant
in thread Let's face it, Perl *is* a scripting language by Ovid

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-06-15 04:01 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.