Re: debugger exiting
- From: rob.dixon@xxxxxxx (Rob Dixon)
- Date: Tue, 04 Nov 2008 04:11:50 +0000
Chas. Owens wrote:
Rob Dixon wrote:
I also think that you have not written
use strict;
use warnings;
at the start of your program, and anything that is presented to this list should
at least have those in place.
Just because I am in a grumpy/contrary mood, I take issue with that
statement. Perl is not just a programming language; it is also a
command line tool. There is no reason to say
perl -Mstrict -wnle 'print $1 if /foo="([^"]*)"' file_of_records
when
perl -nle 'print $1 if /foo="([^"]*)"/' file_of_records
will do; however, I do agree that any script should definitely use the
strict and warnings pragmas. Of course, I haven't seen a
Perl-as-a-command-line-tool question in a long time, so I am just
being grumpy.
Contrary is fine Chas, and here is my view.
I think portraying Perl as a command-line tool limits it to fewer platforms than
we would like to see it ported to. In particular the quoting standards for an -e
script vary widely, and I tire of seeing people publish scripts here that will
work only as a Unix shell command line.
I have said several times that the shortcut behaviour of the logical operators
is ugly and unfamilar to non-Unix users (yes, I know C does it, but that is a
deficiency) and I can think of no excuse at all for naming the function 'grep'.
I have also seen far too many questions about 'how can I reduce this algorithm
to a single statement?' Golf aside, there is no reason to reduce any Perl
program to a minimal byte count.
If I had things my way there would never be any use of Perl as a command-line
tool. To use it as one is to clip its wings and invite the prejudice of the many
platforms where that simply will not work. A lot of work has gone into porting
historical behaviour to most conceivable hosts, in particular the fabrication of
a 'fork' call where no such native concept exists. Also -w has been superseded
with 'use warnings', but nothing is so far in place to represent the -n and -p
qualifiers, and they must be considered a legacy.
There is no reason any more to write Perl programs on the command line, and the
sooner we stop trying to force it to be a utility the quicker the world will
adopt it as a language.
Rob
.
- Follow-Ups:
- Re: debugger exiting
- From: Telemachus
- Re: debugger exiting
- From: "Jenda Krynicky"
- Re: debugger exiting
- References:
- debugger exiting
- From: Sharan Basappa
- Re: debugger exiting
- From: Rob Dixon
- Re: debugger exiting
- From: "Chas. Owens"
- debugger exiting
- Prev by Date: Re: debugger exiting
- Next by Date: Re: perl reg. exp. (search and replace)
- Previous by thread: Re: debugger exiting
- Next by thread: Re: debugger exiting
- Index(es):
Relevant Pages
|