For Programmers: Free Programming Magazines  


Home > Archive > AWK > November 2004 > Pick on Perl









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Pick on Perl
William James

2004-11-24, 3:55 am

I noticed something amusing at the Perl site
http://www.tek-tips.com/viewthread....d=955815&page=1

To convert a file like this

header.jpg
header.jpg
footer.gif
wrap.bmp

to

wrap.bmp|1
header.jpg|2
footer.gif|1

the most highly decorated programmer at the site posted this:

-----
my %log;
open(LOG, "<test.log") || die qq(Can't open "test.log" for input!\n);
chomp, $log{$_}++ while <LOG>;
close(LOG) || die qq(Can't close "test.log"!\n);
open(LOG, ">test.log") || die qq(Can't open "test.log" for output!\n);
writelog(%log};
close(LOG) || die qq(Can't close "test.log"!\n);

sub writelog {
my %log = @_;
while (my ($k, $v) = each %log) {
print LOG join("|", ($k, $v)), "\n";
}
}
-----

Then a rebel awker posted this:

-----
{ a[$0]++ }
END { for ( k in a )
print k "|" a[k]
}
-----

I suggest that awkers that read this should regularly visit that site
and sieze every opportunity to make Perl code look hideous.
Kenny McCormack

2004-11-24, 3:55 pm

In article <f8860640.0411232153.239861d8@posting.google.com>,
William James <w_a_x_man@yahoo.com> wrote:
....
>Then a rebel awker posted this:
>
>-----
>{ a[$0]++ }
>END { for ( k in a )
> print k "|" a[k]
>}
>-----
>
>I suggest that awkers that read this should regularly visit that site
>and sieze every opportunity to make Perl code look hideous.


They don't need out help to make Perl look hideous. It comes built-in.

Ed Morton

2004-11-24, 3:55 pm



William James wrote:

> I noticed something amusing at the Perl site
> http://www.tek-tips.com/viewthread....d=955815&page=1
>
> To convert a file like this
>
> header.jpg
> header.jpg
> footer.gif
> wrap.bmp
>
> to
>
> wrap.bmp|1
> header.jpg|2
> footer.gif|1
>
> the most highly decorated programmer at the site posted this:
>
> -----
> my %log;
> open(LOG, "<test.log") || die qq(Can't open "test.log" for input!\n);
> chomp, $log{$_}++ while <LOG>;
> close(LOG) || die qq(Can't close "test.log"!\n);
> open(LOG, ">test.log") || die qq(Can't open "test.log" for output!\n);
> writelog(%log};
> close(LOG) || die qq(Can't close "test.log"!\n);
>
> sub writelog {
> my %log = @_;
> while (my ($k, $v) = each %log) {
> print LOG join("|", ($k, $v)), "\n";
> }
> }
> -----
>
> Then a rebel awker posted this:
>
> -----
> { a[$0]++ }
> END { for ( k in a )
> print k "|" a[k]
> }
> -----


That awk script does NOT do the same thing as the perl script. The point
of the perl script is to modify the file "test.log" without using an
intermediate temporary file, producing useful error messages if the file
can't be opened for reading or writing. The equivalent awk code would
have a very similair structure to the perl code and may not be able to
produce such specific, useful diagnostics.

> I suggest that awkers that read this should regularly visit that site
> and sieze every opportunity to make Perl code look hideous.


That seems a bit pointless. I never use it myself, but perl appears to
be fairly useful.

Ed.
William James

2004-11-25, 3:55 am

Ed Morton <morton@lsupcaemnt.com> wrote
> That awk script does NOT do the same thing as the perl script. The point
> of the perl script is to modify the file "test.log" without using an
> intermediate temporary file, producing useful error messages if the file
> can't be opened for reading or writing.



# Modifies the log file without producing an intermediate temporary file.
{ a[$0]++ }
END {
for ( k in a )
print k "|" a[k] >FILENAME
if (close(FILENAME)) print FILENAME,"wasn't open."
}

When I ran this with a nonexistant file, I got this useful message:

awk95: can't open file datafoo
source line number 8

When I tried it on a read-only file, this was the message:

awk95: can't open file data
input record number 4, file data
source line number 5

It would be better if we were told whether the file was being opened for
reading or writing, but a person familiar with Awk should be able to
deduce that.

Anyway, I think that there a lot of Perl users who don't realize how much
can be done with Awk and who would prefer to use a simpler, more elegant
language when the cryptic complexity of Perl isn't needed.
Ed Morton

2004-11-25, 3:55 am



William James wrote:
> Ed Morton <morton@lsupcaemnt.com> wrote
>
>
>
>
> # Modifies the log file without producing an intermediate temporary file.
> { a[$0]++ }
> END {
> for ( k in a )
> print k "|" a[k] >FILENAME
> if (close(FILENAME)) print FILENAME,"wasn't open."
> }


awk '...' file > file

may SOMETIMES work too, but I wouldn't count on it and neither would I
count on being able to write to the same file that's still open for
reading as above.

> When I ran this with a nonexistant file, I got this useful message:
>
> awk95: can't open file datafoo
> source line number 8
>
> When I tried it on a read-only file, this was the message:
>
> awk95: can't open file data
> input record number 4, file data
> source line number 5


Just curious - what was the message when you ran it on a file you could
read from but couldn't write to?

> It would be better if we were told whether the file was being opened for
> reading or writing, but a person familiar with Awk should be able to
> deduce that.


Well, yeah, but you could say the same for the perl script - I'm sure it
could've been written to be less expressive too.

> Anyway, I think that there a lot of Perl users who don't realize how much
> can be done with Awk and who would prefer to use a simpler, more elegant
> language when the cryptic complexity of Perl isn't needed.


Maybe so, but I hardly think that's a reason to stalk a perl newgroup
looking for opportunities to cruiticise it. In any case, I'm absolutely
certain that if we were having this conversation in comp.unix.shell one
of the resident perl experts would be able to demonstrate as simple a
script as the awk one - when I see perl solutions posted there to
various problems, they're rarely significantly different from the awk
equivalent.

Ed.
E. Rosten

2004-11-25, 3:55 pm

Ed Morton wrote:
>
>
> William James wrote:
>
>
>
> awk '...' file > file
>
> may SOMETIMES work too, but I wouldn't count on it and neither would I
> count on being able to write to the same file that's still open for
> reading as above.


It will never work on UNIX since the shell will truncate and open file
before executing the command.

-Ed



--
(You can't go wrong with psycho-rats.) (er258)(@)(eng.cam)(.ac.uk)

/d{def}def/f{/Times findfont s scalefont setfont}d/s{10}d/r{roll}d f 5/m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0 rmoveto}
for /s 15 d f pop 240 420 m 0 1 3 { 4 2 1 r sub -1 r show } for showpage

Kenny McCormack

2004-11-25, 3:55 pm

In article <41A5F118.8050204@my.sig>, E. Rosten <look@my.sig> wrote:
>Ed Morton wrote:

This technique is reasonably safe (meaning: I use it regularly and have
never had a problem) - at least under Unix.

(Of course) It might not work on trash OSs like Novell or Microsoft.
[color=darkred]
>
>It will never work on UNIX since the shell will truncate and open file
>before executing the command.


True. Believe it or not, I've seen people try things like:

awk '...' file | (sleep 5;cat > file)

(Never tried it myself - don't have any desire to)

William James

2004-11-25, 8:55 pm

Ed Morton wrote:

>I never use it myself, but perl appears to
>be fairly useful.


Of course. Anything that gigantic and malformed had better be useful.
I'm not saying that it doesn't function effectively.

>William James wrote:
>
>awk '...' file > file
>
>may SOMETIMES work too, but I wouldn't count on it and neither would I


awk '...' file > file does NOT work in a dos-box under windoze 2000
and, as two others have pointed out, it will NEVER work under Unix.

>count on being able to write to the same file that's still open for
>reading as above.


FILENAME is NOT still open for reading; it has been COMPLETELY
read and has been CLOSED. If you feel insecure about it, use
END{ close(FILENAME) ... }.

I, like Kenny McCormack, use this method REGULARLY and have NEVER had
the SLIGHTEST problem with it.

>but I hardly think that's a reason to stalk a perl newgroup


What? "Stalk"? What an extremely pejorative and unfair way of
describing what I proposed. A stalker is someone who, it is feared, may
mug, rape, or murder the stalkee.

>looking for opportunities to cruiticise it.


When did I use the word CRUITICISE or even CRITICIZE? As I said, the
rebel awker merely posted awk code that made the Perl code look ugly.
Simply JUXTAPOSING Awk and Perl is damaging to Perl's reputation.

Many fair-minded people have been fooled by Perl hierophants into
thinking that they have no choice but to put up with obfuscated
ugliness. If we don't show them what Awk can do, no one will. (Besides,
it's fun and gives you a chance to hone your programming skills.)
Ed Morton

2004-11-25, 8:55 pm



William James wrote:
> Ed Morton wrote:

<snip>
> What? "Stalk"? What an extremely pejorative and unfair way of
> describing what I proposed. A stalker is someone who, it is feared, may
> mug, rape, or murder the stalkee.



From dictionary.com:

stalk
...
1. To pursue by tracking stealthily.
2. To follow or observe (a person) persistently, especially out of
obsession or derangement.
3. To go through (an area) in pursuit of prey or quarry.

What you suggested in your quote below IS stalking, it just doesn't
always have the connotations you ascribe to it.

>
>
>
> When did I use the word CRUITICISE or even CRITICIZE?


Your quote:

"I suggest that awkers that read this should regularly visit that site
and sieze every opportunity to make Perl code look hideous."

You do not need to use the word criticise to express the intent to
criticise.

As I said, the
> rebel awker merely posted awk code that made the Perl code look ugly.


Because it did not do the same thing as the perl code and neither does
the awk code you posted. The perl code could have been written as simply
as the awk code.

> Simply JUXTAPOSING Awk and Perl is damaging to Perl's reputation.
>
> Many fair-minded people have been fooled by Perl hierophants into
> thinking that they have no choice but to put up with obfuscated
> ugliness.


From what I've seen or perl, I prefer awks syntax myself, but I don't
think it's up to me to decide what others should consider ugly or
beautiful. I'd find it annoying if in this awk newgroup somone started
posting perl solutions to every problem just because THEY think we need
to be educated on the wonders of perl.

If we don't show them what Awk can do, no one will. (Besides,
> it's fun and gives you a chance to hone your programming skills.)


Is that what you're doing? Saving the perl programmers from themselves?
I'd like to just say "go for it", but the danger here is that since
there isn't a large awk community watching the perl newsgroup, what will
get posted there is half-baked attempts at solving the problem in awk
(as in the particular case you pointed out) which will lead perl
programmers to think awk is NOT as useful as perl which will have
exactly the opposite effect of what you claim to be pursuing.

Ed.
Ed Morton

2004-11-25, 8:55 pm



Kenny McCormack wrote:
> In article <41A5F118.8050204@my.sig>, E. Rosten <look@my.sig> wrote:
>
<snip>[color=darkred]
>
>
> True. Believe it or not, I've seen people try things like:
>
> awk '...' file | (sleep 5;cat > file)
>
> (Never tried it myself - don't have any desire to)
>


The example I really intended to give was:

cat file | awk '...' > file

which apparently does work sometimes (according to related questions
I've seen posted in comp.unix.shell).

Ed.
Kenny McCormack

2004-11-25, 8:55 pm

In article <Ka-dncp_2a5FyTvcRVn-gw@comcast.com>,
Ed Morton <morton@lsupcaemnt.com> wrote:
....
>
>The example I really intended to give was:
>
> cat file | awk '...' > file
>
>which apparently does work sometimes (according to related questions
>I've seen posted in comp.unix.shell).
>
> Ed.


That, too. In fact, I've seen this as a justification for the UUOC.
It seems like it would only work on a heavily loaded system.

Even still, it would be safer with a sleep in there:

cat file | (sleep 5;awk '...' > file)

And this only if file is small enough to fit in the pipe - i.e., size less
than PIPEBUFSIZ (or whatever that constant is called).

E. Rosten

2004-11-26, 3:55 pm

Kenny McCormack wrote:

>
>
> True. Believe it or not, I've seen people try things like:
>
> awk '...' file | (sleep 5;cat > file)
>
> (Never tried it myself - don't have any desire to)



Ahem.

I would never do anything like:

find . -name '*.a' | dd bs=16k 2>/dev/null | xargs -n 1 ln -s

ever.

Although it is a little more reliable, since the bahaviour of dd is a
littel more well... repeatable in this case :-)

-Ed





--
(You can't go wrong with psycho-rats.) (er258)(@)(eng.cam)(.ac.uk)

/d{def}def/f{/Times findfont s scalefont setfont}d/s{10}d/r{roll}d f 5/m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0 rmoveto}
for /s 15 d f pop 240 420 m 0 1 3 { 4 2 1 r sub -1 r show } for showpage

E. Rosten

2004-11-26, 3:55 pm

Ed Morton wrote:
>
>
> The example I really intended to give was:
>
> cat file | awk '...' > file
>
> which apparently does work sometimes (according to related questions
> I've seen posted in comp.unix.shell).


I'm slightly suprised. I thought the shell (well, I guess it depends on
this then) usually opens file (evaluating the > file) first. Maybe it
instead evaluates the

awk '...' > file

after the bit on the left of the pipe, in which case, it relys on cat
guzzling the whole file before fork and exec has time to run. Risky.

-Ed



--
(You can't go wrong with psycho-rats.) (er258)(@)(eng.cam)(.ac.uk)

/d{def}def/f{/Times findfont s scalefont setfont}d/s{10}d/r{roll}d f 5/m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0 rmoveto}
for /s 15 d f pop 240 420 m 0 1 3 { 4 2 1 r sub -1 r show } for showpage

William James

2004-11-26, 3:55 pm

> FILENAME is NOT still open for reading; it has been COMPLETELY
> read and has been CLOSED.


From "lib.c" in the source-code of Brian Kernighan's Awk
("The One True Awk"):

========================================
=========================

int getrec(char **pbuf, int *pbufsize, int isrecord) /* get next input record */
{ /* note: cares whether buf == record */

----- lines snipped -----

buf[0] = 0;
while (argno < *ARGC || infile == stdin) {

----- lines snipped -----

c = readrec(&buf, &bufsize, infile);
if (c != 0 || buf[0] != '\0') { /* normal record */

----- lines snipped -----

return 1;
}
/* EOF arrived on this file; set up next */
if (infile != stdin)
fclose(infile);
infile = NULL;
argno++;
}
*pbuf = buf;
*pbufsize = bufsize;
return 0; /* true end of file */
}

========================================
=========================


The pertinent part is:

/* EOF arrived on this file; set up next */
if (infile != stdin)
fclose(infile);

When end-of-file is reached in FILENAME, it is closed immediately.
Kenny McCormack

2004-11-27, 3:55 pm

In article <41A5F118.8050204@my.sig>, E. Rosten <look@my.sig> wrote:
>Ed Morton wrote:

This technique is reasonably safe (meaning: I use it regularly and have
never had a problem) - at least under Unix.

(Of course) It might not work on trash OSs like Novell or Microsoft.
[color=darkred]
>
>It will never work on UNIX since the shell will truncate and open file
>before executing the command.


True. Believe it or not, I've seen people try things like:

awk '...' file | (sleep 5;cat > file)

(Never tried it myself - don't have any desire to)

Kenny McCormack

2004-11-29, 3:58 pm

In article <f8860640.0411232153.239861d8@posting.google.com>,
William James <w_a_x_man@yahoo.com> wrote:
....
>Then a rebel awker posted this:
>
>-----
>{ a[$0]++ }
>END { for ( k in a )
> print k "|" a[k]
>}
>-----
>
>I suggest that awkers that read this should regularly visit that site
>and sieze every opportunity to make Perl code look hideous.


They don't need out help to make Perl look hideous. It comes built-in.

William James

2004-11-29, 3:58 pm

Ed Morton wrote:

>I never use it myself, but perl appears to
>be fairly useful.


Of course. Anything that gigantic and malformed had better be useful.
I'm not saying that it doesn't function effectively.

>William James wrote:
>
>awk '...' file > file
>
>may SOMETIMES work too, but I wouldn't count on it and neither would I


awk '...' file > file does NOT work in a dos-box under windoze 2000
and, as two others have pointed out, it will NEVER work under Unix.

>count on being able to write to the same file that's still open for
>reading as above.


FILENAME is NOT still open for reading; it has been COMPLETELY
read and has been CLOSED. If you feel insecure about it, use
END{ close(FILENAME) ... }.

I, like Kenny McCormack, use this method REGULARLY and have NEVER had
the SLIGHTEST problem with it.

>but I hardly think that's a reason to stalk a perl newgroup


What? "Stalk"? What an extremely pejorative and unfair way of
describing what I proposed. A stalker is someone who, it is feared, may
mug, rape, or murder the stalkee.

>looking for opportunities to cruiticise it.


When did I use the word CRUITICISE or even CRITICIZE? As I said, the
rebel awker merely posted awk code that made the Perl code look ugly.
Simply JUXTAPOSING Awk and Perl is damaging to Perl's reputation.

Many fair-minded people have been fooled by Perl hierophants into
thinking that they have no choice but to put up with obfuscated
ugliness. If we don't show them what Awk can do, no one will. (Besides,
it's fun and gives you a chance to hone your programming skills.)
Ed Morton

2004-11-29, 3:58 pm



Kenny McCormack wrote:
> In article <41A5F118.8050204@my.sig>, E. Rosten <look@my.sig> wrote:
>
<snip>[color=darkred]
>
>
> True. Believe it or not, I've seen people try things like:
>
> awk '...' file | (sleep 5;cat > file)
>
> (Never tried it myself - don't have any desire to)
>


The example I really intended to give was:

cat file | awk '...' > file

which apparently does work sometimes (according to related questions
I've seen posted in comp.unix.shell).

Ed.
William James

2004-11-29, 3:58 pm

Ed Morton <morton@lsupcaemnt.com> wrote
> That awk script does NOT do the same thing as the perl script. The point
> of the perl script is to modify the file "test.log" without using an
> intermediate temporary file, producing useful error messages if the file
> can't be opened for reading or writing.



# Modifies the log file without producing an intermediate temporary file.
{ a[$0]++ }
END {
for ( k in a )
print k "|" a[k] >FILENAME
if (close(FILENAME)) print FILENAME,"wasn't open."
}

When I ran this with a nonexistant file, I got this useful message:

awk95: can't open file datafoo
source line number 8

When I tried it on a read-only file, this was the message:

awk95: can't open file data
input record number 4, file data
source line number 5

It would be better if we were told whether the file was being opened for
reading or writing, but a person familiar with Awk should be able to
deduce that.

Anyway, I think that there a lot of Perl users who don't realize how much
can be done with Awk and who would prefer to use a simpler, more elegant
language when the cryptic complexity of Perl isn't needed.
Ed Morton

2004-11-29, 3:58 pm



William James wrote:
> Ed Morton <morton@lsupcaemnt.com> wrote
>
>
>
>
> # Modifies the log file without producing an intermediate temporary file.
> { a[$0]++ }
> END {
> for ( k in a )
> print k "|" a[k] >FILENAME
> if (close(FILENAME)) print FILENAME,"wasn't open."
> }


awk '...' file > file

may SOMETIMES work too, but I wouldn't count on it and neither would I
count on being able to write to the same file that's still open for
reading as above.

> When I ran this with a nonexistant file, I got this useful message:
>
> awk95: can't open file datafoo
> source line number 8
>
> When I tried it on a read-only file, this was the message:
>
> awk95: can't open file data
> input record number 4, file data
> source line number 5


Just curious - what was the message when you ran it on a file you could
read from but couldn't write to?

> It would be better if we were told whether the file was being opened for
> reading or writing, but a person familiar with Awk should be able to
> deduce that.


Well, yeah, but you could say the same for the perl script - I'm sure it
could've been written to be less expressive too.

> Anyway, I think that there a lot of Perl users who don't realize how much
> can be done with Awk and who would prefer to use a simpler, more elegant
> language when the cryptic complexity of Perl isn't needed.


Maybe so, but I hardly think that's a reason to stalk a perl newgroup
looking for opportunities to cruiticise it. In any case, I'm absolutely
certain that if we were having this conversation in comp.unix.shell one
of the resident perl experts would be able to demonstrate as simple a
script as the awk one - when I see perl solutions posted there to
various problems, they're rarely significantly different from the awk
equivalent.

Ed.
E. Rosten

2004-11-29, 3:58 pm

Ed Morton wrote:
>
>
> William James wrote:
>
>
>
> awk '...' file > file
>
> may SOMETIMES work too, but I wouldn't count on it and neither would I
> count on being able to write to the same file that's still open for
> reading as above.


It will never work on UNIX since the shell will truncate and open file
before executing the command.

-Ed



--
(You can't go wrong with psycho-rats.) (er258)(@)(eng.cam)(.ac.uk)

/d{def}def/f{/Times findfont s scalefont setfont}d/s{10}d/r{roll}d f 5/m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0 rmoveto}
for /s 15 d f pop 240 420 m 0 1 3 { 4 2 1 r sub -1 r show } for showpage

Ed Morton

2004-11-29, 3:58 pm



William James wrote:
> Ed Morton wrote:

<snip>
> What? "Stalk"? What an extremely pejorative and unfair way of
> describing what I proposed. A stalker is someone who, it is feared, may
> mug, rape, or murder the stalkee.



From dictionary.com:

stalk
...
1. To pursue by tracking stealthily.
2. To follow or observe (a person) persistently, especially out of
obsession or derangement.
3. To go through (an area) in pursuit of prey or quarry.

What you suggested in your quote below IS stalking, it just doesn't
always have the connotations you ascribe to it.

>
>
>
> When did I use the word CRUITICISE or even CRITICIZE?


Your quote:

"I suggest that awkers that read this should regularly visit that site
and sieze every opportunity to make Perl code look hideous."

You do not need to use the word criticise to express the intent to
criticise.

As I said, the
> rebel awker merely posted awk code that made the Perl code look ugly.


Because it did not do the same thing as the perl code and neither does
the awk code you posted. The perl code could have been written as simply
as the awk code.

> Simply JUXTAPOSING Awk and Perl is damaging to Perl's reputation.
>
> Many fair-minded people have been fooled by Perl hierophants into
> thinking that they have no choice but to put up with obfuscated
> ugliness.


From what I've seen or perl, I prefer awks syntax myself, but I don't
think it's up to me to decide what others should consider ugly or
beautiful. I'd find it annoying if in this awk newgroup somone started
posting perl solutions to every problem just because THEY think we need
to be educated on the wonders of perl.

If we don't show them what Awk can do, no one will. (Besides,
> it's fun and gives you a chance to hone your programming skills.)


Is that what you're doing? Saving the perl programmers from themselves?
I'd like to just say "go for it", but the danger here is that since
there isn't a large awk community watching the perl newsgroup, what will
get posted there is half-baked attempts at solving the problem in awk
(as in the particular case you pointed out) which will lead perl
programmers to think awk is NOT as useful as perl which will have
exactly the opposite effect of what you claim to be pursuing.

Ed.
E. Rosten

2004-11-30, 8:55 pm

Ed Morton wrote:
>
>
> William James wrote:
>
>
>
> awk '...' file > file
>
> may SOMETIMES work too, but I wouldn't count on it and neither would I
> count on being able to write to the same file that's still open for
> reading as above.


It will never work on UNIX since the shell will truncate and open file
before executing the command.

-Ed



--
(You can't go wrong with psycho-rats.) (er258)(@)(eng.cam)(.ac.uk)

/d{def}def/f{/Times findfont s scalefont setfont}d/s{10}d/r{roll}d f 5/m
{moveto}d -1 r 230 350 m 0 1 179{1 index show 88 rotate 4 mul 0 rmoveto}
for /s 15 d f pop 240 420 m 0 1 3 { 4 2 1 r sub -1 r show } for showpage

Kenny McCormack

2004-11-30, 8:55 pm

In article <41A5F118.8050204@my.sig>, E. Rosten <look@my.sig> wrote:
>Ed Morton wrote:

This technique is reasonably safe (meaning: I use it regularly and have
never had a problem) - at least under Unix.

(Of course) It might not work on trash OSs like Novell or Microsoft.
[color=darkred]
>
>It will never work on UNIX since the shell will truncate and open file
>before executing the command.


True. Believe it or not, I've seen people try things like:

awk '...' file | (sleep 5;cat > file)

(Never tried it myself - don't have any desire to)

Ed Morton

2004-11-30, 8:55 pm



William James wrote:
> Ed Morton wrote:

<snip>
> What? "Stalk"? What an extremely pejorative and unfair way of
> describing what I proposed. A stalker is someone who, it is feared, may
> mug, rape, or murder the stalkee.



From dictionary.com:

stalk
...
1. To pursue by tracking stealthily.
2. To follow or observe (a person) persistently, especially out of
obsession or derangement.
3. To go through (an area) in pursuit of prey or quarry.

What you suggested in your quote below IS stalking, it just doesn't
always have the connotations you ascribe to it.

>
>
>
> When did I use the word CRUITICISE or even CRITICIZE?


Your quote:

"I suggest that awkers that read this should regularly visit that site
and sieze every opportunity to make Perl code look hideous."

You do not need to use the word criticise to express the intent to
criticise.

As I said, the
> rebel awker merely posted awk code that made the Perl code look ugly.


Because it did not do the same thing as the perl code and neither does
the awk code you posted. The perl code could have been written as simply
as the awk code.

> Simply JUXTAPOSING Awk and Perl is damaging to Perl's reputation.
>
> Many fair-minded people have been fooled by Perl hierophants into
> thinking that they have no choice but to put up with obfuscated
> ugliness.


From what I've seen or perl, I prefer awks syntax myself, but I don't
think it's up to me to decide what others should consider ugly or
beautiful. I'd find it annoying if in this awk newgroup somone started
posting perl solutions to every problem just because THEY think we need
to be educated on the wonders of perl.

If we don't show them what Awk can do, no one will. (Besides,
> it's fun and gives you a chance to hone your programming skills.)


Is that what you're doing? Saving the perl programmers from themselves?
I'd like to just say "go for it", but the danger here is that since
there isn't a large awk community watching the perl newsgroup, what will
get posted there is half-baked attempts at solving the problem in awk
(as in the particular case you pointed out) which will lead perl
programmers to think awk is NOT as useful as perl which will have
exactly the opposite effect of what you claim to be pursuing.

Ed.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com