Re: debugger exiting



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
.



Relevant Pages

  • Re: dns querry script.
    ... use warnings; ... use strict; ... C:\Dload> perl dns.pl ...
    (comp.lang.perl.misc)
  • Re: Any way to access global variable in Perl script from one module file?
    ... use strict; ... use warnings; ... a separate process has a completely separate memory space. ... There is probably no reason to create a new perl ...
    (comp.lang.perl.misc)
  • Re: Debug Help Please
    ... In Perl there is the expression TIMTOWTDI which means that you will probably get different opinions on "The Right Way" to do something in Perl. ... use strict; ... That is a specious argument because you can disable specific strictures or warnings in local scope: ... for all Failures ...
    (perl.beginners)
  • Re: List Variable becomes undefined inexplicably
    ... warnings and strictures very often find bugs in programs. ... It is inconsiderate of your audience to post without warnings and strict. ... There is a Perl and there is a perl. ... chomp $LINE; ...
    (comp.lang.perl.misc)
  • Re: Debug Help Please
    ... If you had enabled the warnings and strict pragmas then perl would have ... foreach my $logfile { ...
    (perl.beginners)