[16997] in Perl-Users-Digest
Perl-Users Digest, Issue: 4409 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 22 21:10:24 2000
Date: Fri, 22 Sep 2000 18:10:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969671411-v9-i4409@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 22 Sep 2000 Volume: 9 Number: 4409
Today's topics:
multiple replaces one line at a time <gollands@cornell.edu>
Re: multiple replaces one line at a time <mauldin@netstorm.net>
Re: multiple replaces one line at a time (Arthur Darren Dunham)
Re: multiple replaces one line at a time <godzilla@stomp.stomp.tokyo>
Re: multiple replaces one line at a time <lr@hpl.hp.com>
Re: multiple replaces one line at a time (Abigail)
Re: multiple replaces one line at a time <godzilla@stomp.stomp.tokyo>
Re: multiple replaces one line at a time <lr@hpl.hp.com>
Re: parsing parentheses nested files <tim@ipac.caltech.edu>
Re: Perl Shell on Windows NT <elephant@squirrelgroup.com>
Re: Perl working directory in IIS <elephant@squirrelgroup.com>
Re: REQ how to create one line of text (Abigail)
Re: REQ how to create one line of text (Abigail)
Re: REQ how to create one line of text <uri@sysarch.com>
Re: Setting remote values (Win32::TieRegistry) <elephant@squirrelgroup.com>
Re: Teaching Perl <spug@halcyon.com>
Re: Thnaks to the Gurus! <randy_734@my-deja.com>
Re: Thnaks to the Gurus! <spragg@cs.ucdavis.edu>
too many errors in my program <wedeking@msa.attmil.ne.jp>
Re: Warning message in Win32::ODBC module <ag@xroodnet.demon.co.uk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 22 Sep 2000 18:32:39 -0400
From: Brian Gollands <gollands@cornell.edu>
Subject: multiple replaces one line at a time
Message-Id: <39CBDE06.940157DF@cornell.edu>
An embarassing newbie question (just when I think I'm getting the hang
of regex, I hit a wall):
I have a multiple line file where each line looks line:
010731003011300003012FAIRFIELD, PFD, 5229 COURT B 12
I'm reading the file in a line at a time and replacing all alphanumerics
or spaces in columns 10-18 with a bullet (). Using the following, I can
only get the change in the first line.
$line =~ s/^(\d{9})[\w\s]{9}/\1/gi; # that's a backslash and a one
before the bullet
I've tried a number of things, looked in the man pages, all to no avail.
It must be obvious -- what am I doing wrong?
Thanks loads,
Brian
------------------------------
Date: Fri, 22 Sep 2000 23:46:23 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: multiple replaces one line at a time
Message-Id: <39CBEF20.85376EE1@netstorm.net>
Brian Gollands wrote:
>
> An embarassing newbie question (just when I think I'm getting the hang
> of regex, I hit a wall):
>
> I have a multiple line file where each line looks line:
> 010731003011300003012FAIRFIELD, PFD, 5229 COURT B 12
>
> I'm reading the file in a line at a time and replacing all alphanumerics
> or spaces in columns 10-18 with a bullet (). Using the following, I can
> only get the change in the first line.
>
> $line =~ s/^(\d{9})[\w\s]{9}/\1/gi;
^ ^^
Better written as
$line =~ s/^(\d{9})[\w\s]{9}/$1/;
Use $1 in the replacement; \1 should only be used on the pattern match
side. No need for /g because the regex can only match once per line
because of the ^ anchor. No need for /i because \w matches upper and
lower case.
You could also do
substr($line,9,9) = '';
unless there really are cases where the nine to be replaced could
contain something not in your character class (i.e. where the match
should fail).
This being said, there is nothing inherently wrong with the regex, so
the problem has to be in the way you read the file.
-- Jim
------------------------------
Date: 23 Sep 2000 00:02:33 GMT
From: add@netcom.com (Arthur Darren Dunham)
Subject: Re: multiple replaces one line at a time
Message-Id: <8qgrup$e2p$1@slb3.atl.mindspring.net>
In article <39CBDE06.940157DF@cornell.edu>,
Brian Gollands <gollands@cornell.edu> wrote:
>An embarassing newbie question (just when I think I'm getting the hang
>of regex, I hit a wall):
>
>I have a multiple line file where each line looks line:
>010731003011300003012FAIRFIELD, PFD, 5229 COURT B 12
>
>I'm reading the file in a line at a time and replacing all alphanumerics
>or spaces in columns 10-18 with a bullet (). Using the following, I can
>only get the change in the first line.
>
>$line =~ s/^(\d{9})[\w\s]{9}/\1/gi; # that's a backslash and a one
>before the bullet
1) Don't use \1 on the replace side. Use $1 instead. (however, that's
not causing you problems here probably)
2) That's just a line, and the line works. Are you expecting that that
one command is going to change multiple lines? We'd need to see your
code to understand what you're doing.
You'll either need to read your whole file into a scalar and use /m, or
run the regexp in a loop, once on each line.
perldoc perlop has the lowdown on the bits at the end...
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco Bay Area
< Please move on, ...nothing to see here, please disperse >
------------------------------
Date: Fri, 22 Sep 2000 17:08:02 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: multiple replaces one line at a time
Message-Id: <39CBF462.80290270@stomp.stomp.tokyo>
Brian Gollands wrote:
> An embarassing newbie question
>(just when I think I'm getting the hang of regex, I hit a wall):
Evidently, head first.
> I have a multiple line file where each line looks line:
> 010731003011300003012FAIRFIELD, PFD, 5229 COURT B 12
My presumption is your second use of "line" is
meant to be "like", correct?
Do you mean every line looks just like your example?
Otherwords, a series of identical lines? Well. I am
guessing you mean each line has a format similar to
your displayed example.
> I'm reading the file in a line at a time and replacing all
> alphanumerics or spaces in columns 10-18
I see no columns in your example. Do you mean replacing
characters in string positions 9 to 17, inclusive, with
your first example character, 0, being just that, zero.
> with a bullet ().
With a bullet? You exemplify an asterisk enclosed within
parentheses. Do you want a bullet, as in " <li> " or do
do you want an asterisk or a parenthetical asterisk?
> Using the following, I can
> only get the change in the first line.
> $line =~ s/^(\d{9})[\w\s]{9}/\1/gi; # that's a backslash and a one
> before the bullet
So read and write more than one line.
> I've tried a number of things, looked in the man pages,
> all to no avail. It must be obvious -- what am I doing wrong?
What you are doing wrong is writing an incomprehensible article.
user configuration:
$string = "whatever the Hades is your input";
$replace = "*";
code to make this work:
$do_it = substr ($string, 9, 9, $replace);
Godzilla!
--
Dr. Kiralynne Schilitubi Ķ Cooling Fan Specialist
UofD: University of Duh! Ķ ENIAC Hard Wiring Pro
BumScrew, South of Egypt Ķ HTML Programming Class
TEST SCRIPT:
____________
#!/usr/local/bin/perl
print "Content-Type: text/plain\n\n";
$string = "010731003011300003012FAIRFIELD, PFD, 5229 COURT B 12";
print "Input\n $string\n\n";
$replace = "*";
$do_it = substr ($string, 9, 9, $replace);
print "Output\n $string";
exit;
PRINTED RESULTS:
________________
Input
010731003011300003012FAIRFIELD, PFD, 5229 COURT B 12
Output
010731003*012FAIRFIELD, PFD, 5229 COURT B 12
------------------------------
Date: Fri, 22 Sep 2000 17:29:26 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: multiple replaces one line at a time
Message-Id: <MPG.1435993fb0bc963198adb9@nntp.hpl.hp.com>
In article <39CBEF20.85376EE1@netstorm.net> on Fri, 22 Sep 2000 23:46:23
GMT, Jim Mauldin <mauldin@netstorm.net> says...
> Brian Gollands wrote:
...
> > I have a multiple line file where each line looks line:
> > 010731003011300003012FAIRFIELD, PFD, 5229 COURT B 12
> >
> > I'm reading the file in a line at a time and replacing all alphanumerics
> > or spaces in columns 10-18 with a bullet (). Using the following, I can
> > only get the change in the first line.
> >
> > $line =~ s/^(\d{9})[\w\s]{9}/\1/gi;
> ^ ^^
> Better written as
>
> $line =~ s/^(\d{9})[\w\s]{9}/$1/;
...
> You could also do
>
> substr($line,9,9) = '';
>
> unless there really are cases where the nine to be replaced could
> contain something not in your character class (i.e. where the match
> should fail).
I wonder if 'replacing all alphanumerics or spaces ... with a bullet'
really means 'each' instead of 'all. That would explain the 'g' in the
original regex.
Then possible solutions would be:
substr($_, 9, 9) = do { (my $x = substr $_, 9, 9) =~ s/[\w\s]//g; $x };
or, equivalently,
s/(?<=^.{9})(.{9})/(my $x = $1) =~ s%[\w\s]%%g; $x/e;
> This being said, there is nothing inherently wrong with the regex, so
> the problem has to be in the way you read the file.
Read or write the file. But that code wasn't posted.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 23 Sep 2000 00:40:59 GMT
From: abigail@foad.org (Abigail)
Subject: Re: multiple replaces one line at a time
Message-Id: <slrn8snuui.5fq.abigail@alexandra.foad.org>
Brian Gollands (gollands@cornell.edu) wrote on MMDLXXIX September
MCMXCIII in <URL:news:39CBDE06.940157DF@cornell.edu>:
[] An embarassing newbie question (just when I think I'm getting the hang
[] of regex, I hit a wall):
[]
[] I have a multiple line file where each line looks line:
[] 010731003011300003012FAIRFIELD, PFD, 5229 COURT B 12
[]
[] I'm reading the file in a line at a time and replacing all alphanumerics
[] or spaces in columns 10-18 with a bullet (). Using the following, I can
[] only get the change in the first line.
[]
[] $line =~ s/^(\d{9})[\w\s]{9}/\1/gi; # that's a backslash and a one
[] before the bullet
[]
[] I've tried a number of things, looked in the man pages, all to no avail.
[] It must be obvious -- what am I doing wrong?
That's hard to say, as you don't show enough code. After all, something
has to put the first line in $line, and something else has to fail to
put each other line in $line.
Here's what I would use:
perl -wpe 'substr ($_, 9, 9) =~ s/[^\W_]| /*/g'
I don't know what kind of character you have in the replacement part of
your regex, but code point (hex)95 is undefined in any ISO-8859 font
and also undefined in all Unicode standards.
Abigail
--
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_;
sub _ {push @_ => /::(.*)/s and goto &{ shift}}
sub shift {print shift; @_ and goto &{+shift}}
Hack ("Just", "Perl ", " ano", "er\n", "ther "); # 20000922
------------------------------
Date: Fri, 22 Sep 2000 17:44:50 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: multiple replaces one line at a time
Message-Id: <39CBFD02.58937110@stomp.stomp.tokyo>
Larry Rosler wrote:
> Jim Mauldin wrote:
> > Brian Gollands wrote:
(substringed and replaced)
> > unless there really are cases where the nine to be replaced could
> > contain something not in your character class (i.e. where the match
> > should fail).
> I wonder if 'replacing all alphanumerics or spaces ... with a bullet'
> really means 'each' instead of 'all. That would explain the 'g' in the
> original regex.
Wonder no more Mr. Rosler! This boy will respond with,
"Well, actually I have more than just alphanumeric
characters and spaces. Let's say.... "
*laughs*
Godzilla!
--
Dr. Kiralynne Schilitubi Ķ Cooling Fan Specialist
UofD: University of Duh! Ķ ENIAC Hard Wiring Pro
BumScrew, South of Egypt Ķ HTML Programming Class
------------------------------
Date: Fri, 22 Sep 2000 17:43:07 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: multiple replaces one line at a time
Message-Id: <MPG.14359c772003928b98adba@nntp.hpl.hp.com>
In article <39CBF462.80290270@stomp.stomp.tokyo> on Fri, 22 Sep 2000
17:08:02 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> says...
...
> code to make this work:
>
> $do_it = substr ($string, 9, 9, $replace);
Hmmm. The fourth argument to substr() was introduced in Perl 5.005:
perl5005delta:
4th argument to substr
substr() can now both return and replace in one operation. The
optional 4th argument is the replacement string. See substr in the
perlfunc manpage.
I thought that in your view everything 'good' already existed in Perl 4.
But here you are using a feature from Perl 5, and a relatively late
addition at that. What else are you hiding?
Nevertheless, this use of substr() isn't optimal, as you copy the
removed content into $do_it but then don't use it. It would be better
to use the lvalue form of the three-argument substr(), as I and others
have posted.
By the way, when you put your sample program after your signature cut-
line, intelligent newsreaders cut it out of the quoted material, and I'm
too lazy to put it back manually. Hence the quote from the body of the
text.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 22 Sep 2000 15:34:54 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: parsing parentheses nested files
Message-Id: <39CBDE8E.DDC695AE@ipac.caltech.edu>
bhaskaracharya@my-deja.com wrote:
>
> Are there standard ways to process parentheses nested files?
> I tried various ways like having subs to countparentheses(add 1 for open
> and -- for closing, etc) and pushing each word to an array but it looks
> tedoious...Are there any good parsing modules to do this? Any examples
> are appreciated..
Look at the Text::Balanced module at your local CPAN repository.
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: Sat, 23 Sep 2000 10:30:48 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Perl Shell on Windows NT
Message-Id: <MPG.1436a4bf3a73470d9897c4@localhost>
Scott Kirk wrote ..
>In article <8qaj2d$ong$1@nnrp1.deja.com>,
> charlie.bursell@healthcare.com wrote:
-
>> On Windows NT, it seems that perl runs in a sub-shell and not in the
>> active shell window. I note that I cannot redirect the standard
>> output of my perl scripts via ">" or "|".
>
>This is a common problem - because CMD.EXE is too stoopid to handle
>redirection properly.
>
>> Is there a way to make a perl script in Windows NT run in the current
>> shell?
>
>There a few things you can do:
>1. Open a file handle from inside the script and output to the
>filehandle. You can even output to STDOUT and STDERR.
>
>2. Use pl2bat.bat to convert your Perl script to a batch file. You
>can redirect the output from these.
>
>3. Get yourself a different command processor. I hear 4DOS is good,
>but I have never used it. I use CYGWIN - and I hear Cygnus have been
>acquired by Red Hat.
and
4. just call the program with perl.exe manually .. ie.
perl script.pl > outputfile
or
dir | perl script.pl
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Sat, 23 Sep 2000 10:38:09 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Perl working directory in IIS
Message-Id: <MPG.1436a680cd61d0b19897c5@localhost>
marcusmills@my-deja.com wrote ..
>We are having a problem with the working
>directory that PERL is using when being called
>from Microsoft IIS4
>
>We have setup the script map as normal and tested
>a script in the default website:
>
>====================
>print "content-type:text.html\n\n";
>print `cd`;
>====================
>
>On the default web site we get a correct result
>of: 'c:\inetpub\wwwroot\'
>
>but on any other web sites we setup we
>get: 'c:\winnt' instead of 'c:\inetpub\www2\'
>
>There don't seem to be any settings for a working
>directory any where.
this is an IIS4 problem .. not a Perl problem .. IIS4 will exhibit this
behaviour with any scripting engine .. you will probably get a better
answer from Microsoft or in one of the IIS related newsgroups
is there any reason why you can't just use the Perl function chdir to
change into the correct directory ?
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 23 Sep 2000 00:20:50 GMT
From: abigail@foad.org (Abigail)
Subject: Re: REQ how to create one line of text
Message-Id: <slrn8sntoo.5fq.abigail@alexandra.foad.org>
Chris Fedde (cfedde@u.i.sl3d.com) wrote on MMDLXXIX September MCMXCIII in
<URL:news:xqPy5.344$W3.189189632@news.frii.net>:
$$ In article <s6cnss87l0sssqorbv890uafg59cl5b3ks@4ax.com>,
$$ SomeWhat <registered12345@hotmail.com> wrote:
$$ >I have a text file which contains the following
$$ >
$$ >
$$ >
$$ >21-9-2000 | dat1 | data2
$$ >data5 | data 6
$$ >data7 | data 8 | data 9 | data 10
$$ >
$$ >21-9-2000 | data1 | data2
$$ >data5 | data 6
$$ >data7 | data 8 | data 9 | data 10
$$ >
$$ >
$$ >How is it possible to put each block on one line.
$$ >Is this possible with perl (preffered and exe file)
$$ >
$$ >Thanx
$$ >
$$
$$ Golf anyone?
$$ perl -lpe 'BEGIN{$/=""}s/\n/ | /'
Well, yours isn't correct. When run on the same input, it produces:
21-9-2000 | dat1 | data2 | data5 | data 6
data7 | data 8 | data 9 | data 10
21-9-2000 | data1 | data2 | data5 | data 6
data7 | data 8 | data 9 | data 10
We can fix that, and still gain 9 strokes:
perl -l -00pe's/^J/ | /g' # ^J appears here as 2 chars for Usenet
# purposes; use control-J in the program.
Note the order of the arguments; it's important that -l preceeds -0.
Abigail
--
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
${qq$\x5F$} = q 97265646f9 and s g..g;
qq e\x63\x68\x72\x20\x30\x78$&eggee;
{eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'
------------------------------
Date: 23 Sep 2000 00:28:42 GMT
From: abigail@foad.org (Abigail)
Subject: Re: REQ how to create one line of text
Message-Id: <slrn8snu7i.5fq.abigail@alexandra.foad.org>
Uri Guttman (uri@sysarch.com) wrote on MMDLXXIX September MCMXCIII in
<URL:news:x74s38cdi6.fsf@home.sysarch.com>:
\\ >>>>> "CF" == Chris Fedde <cfedde@u.i.sl3d.com> writes:
\\
\\ CF> Golf anyone?
\\ CF> perl -lpe 'BEGIN{$/=""}s/\n/ | /g'
\\
\\ perl -00l12pe 'y/\n//d'
\\
\\ this also works and is 2 chars shorter.
\\
\\ perl -00l12pey/\\n//d
Not if we assume the data fields have to be separated by ' | ' if no
newline acts as a separator.
Abigail
--
my $qr = /^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
$qr =~ s/$qr//g;
print $qr, "\n";
------------------------------
Date: Sat, 23 Sep 2000 00:44:45 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: REQ how to create one line of text
Message-Id: <x71yycc4xu.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@foad.org> writes:
A> Uri Guttman (uri@sysarch.com) wrote on MMDLXXIX September MCMXCIII in
A> <URL:news:x74s38cdi6.fsf@home.sysarch.com>:
A> \\ >>>>> "CF" == Chris Fedde <cfedde@u.i.sl3d.com> writes:
A> \\
A> \\ CF> Golf anyone?
A> \\ CF> perl -lpe 'BEGIN{$/=""}s/\n/ | /g'
A> \\
A> \\ perl -00l12pe 'y/\n//d'
A> \\
A> \\ this also works and is 2 chars shorter.
A> \\
A> \\ perl -00l12pey/\\n//d
A> Not if we assume the data fields have to be separated by ' | ' if no
A> newline acts as a separator.
yeah, the spec wasn't clear and i missed that. if only a | is needed as
a separator (why the extra blanks?) then this works.
perl -00l12pe'y/\n/|/d'
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sat, 23 Sep 2000 10:56:01 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Setting remote values (Win32::TieRegistry)
Message-Id: <MPG.1436aaab8541dc649897c6@localhost>
Alessandro Augusto wrote ..
>Iīm trying to set values to remote keys, but I am not having success.
>Can anyone please help me with a little example.
>
>For example, I logon as administrator on the Domain Controler (DC),
>and I want to change some values on the workstations (ws). How can
>I do that?
>
> DC
> |
> --------------------------
> | | | |
> ws_a ws_b ws_c ws_d
>
>how from DC, can I change values on ws_a for example.
>(please send some code as example).
answered in response to a direct email as well .. but reprinted here for
any onlookers
you just prepend the machine name to the registry key that you're
interested in .. eg.
# this refers to the SOFTWARE section of the current machine
$Registry->{'LMachine\SOFTWARE\\'};
# this refers to the same section of the ws_a machine
$Registry->{'\\\ws_a\LMachine\SOFTWARE\\'};
btw .. there are examples of this in the Win32::TieRegistry
documentation in the Examples section
notice the ugly triple backslash .. thank you Tye for the Delimiter
param (anyone using TieRegistry should make use of the delimiter param
to get around those silly backslashes) .. eg.
use Win32::TieRegistry( Delimiter => '/' );
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 23 Sep 2000 00:32:02 GMT
From: Seattle PERL Users Group <spug@halcyon.com>
Subject: Re: Teaching Perl
Message-Id: <8qgtm2$n6q$1@brokaw.wa.com>
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
:>>>>> "Adam" == Adam Trace Spragg <spragg@cs.ucdavis.edu> writes:
: Adam> I haven't done this sort of thing, but I still have some general
: Adam> advice. Knowing Perl will not automatically make you a good
: Adam> teacher. Teaching is a skill in and of itself, regardless of
: Adam> the subject matter.
: Yup. What I've noticed, and what I look for in other people who want
: to work for me, is some ability to be introspective... "how do I know
: this?" "how did I learn it?" "what prior knowledge did that build on
<SNIP>
: --
: Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
I agree, but I hasten to add a few points of my own, that are not often
appreciated by people outside this industry. I've learned them from my
nearly two decades of providing, and hiring others to provide, software
training, so you might find my comments of interest.
NOTE: Everything I say below is presented as opinion rather than
scientific fact, so I won't mind if you disagree! 8-}
First of all, I believe there are certain personality characteristics
and intellectual traits that are required to make a person a great
programmer, and certain ones that are required to make a person a great
teacher. These rarely develop to high levels in the same individual,
because they tend to come from opposite ends of certain psychological
dimensions (introversion vs. extraversion, reductionistic vs.
wholistic, logical vs. emotional, left-brain vs. right, etc.). This is
not to say that both sets of traits cannot be developed to some degree
in the same individual, but people who have both sets developed to high
degrees are hard to find.
To digress slightly, this is part of the reason why you don't generally
find extremely charming smooth-talking highly sociable people
programming computers, or nerdly math whizzes selling cars; different
personality traits are required, and those already having them, or
having the ability to develop them sufficiently, tend to gravitate to
the fields where those traits are most highly valued.
Surely there are individual variations in programmer personalities and
all the greats do not fit this, or any other, simplistic profile in
every respect, but other things being equal, great programmers tend not
to be great teachers, and great teachers tend not to be great
programmers. This is because teaching (when done well) is a highly
social activity and "performance art form", and programming is
primarily an activity involving elements of design and logic, conducted
in isolation (between code-review meetings), where emotions are your
enemy and mutating yourself psychologically into a wetware emulation of
a machine can be a great advantage.,8-}
(-been there; dribbled on my T-shirt, and later, found previous week's
Pad Thai in my beard, etc.)
So we have a quandary; to be a great teacher of programming, one should
have the requisite communication skills and learn the art of teaching,
but one must also have a great deal of programming experience, so
you'll understand what you're teaching about. I personally find that
working in one of these disciplines or the other for extended periods
tends to strengthen my skills in that discipline at the expense of
those in the other (when one goes up, it pushes the other down).
Personally, I don't have the intellectual or personality traits to be
either a really great programmer, or a really great teacher. And
that's *exactly why* I've been so successful in teaching UNIX (and more
recently Perl) for most of my working life! I'm *pretty good* (as I'm
told) at both activities, but not *so good* in either one that my
skills in the other get depressed to an unacceptable level.
I do feel it necessary to periodically take "sabbaticals" from teaching
and dive headlong into (contract) programming projects, to keep in
touch with the world my students occupy and keep my programming
knowledge up to date, and I can actually feel my inter-personal skills
eroding during this process!
I know I've had enough when my wife says:
<WIFE>
I asked you "How are you doing", and you replied with:
<ROBOT_VOICE>
"PLEASE BE MORE SPECIFIC: HOW AM I DOING AT WHAT?"
</ROBOT_VOICE>
I think it's time now for you to get back to teaching! 8-}
</WIFE>
In the Perl community, we are fortunate to have an abundance of Perl
programming experts who are also talented writers and educators. I
don't think that's an accident; I believe Perl, because of the unique
abilities it offers programmers for self-expression, *attracts8 people
with more "balanced" skill sets, and that's one of the reasons it's
achieved such widespread acceptance!
-Tim
*========================================================================*
| Dr. Tim Maher, CEO, Consultix (206) 781-UNIX/8649; ask for FAX# |
| Email: tim@consultix-inc.com Web: http://www.consultix-inc.com |
|Training- TIM MAHER: Unix, Perl DAMIAN CONWAY: Adv. Perl, OOP, Parsing |
I========================================================================*
------------------------------
Date: Fri, 22 Sep 2000 22:07:15 GMT
From: Randy <randy_734@my-deja.com>
Subject: Re: Thnaks to the Gurus!
Message-Id: <39cbd7ff.31924828@207.126.101.100>
Amen.
alphazerozero@my-deja.com wrote:
>I just wanted to thank the general PERL comunity for all of their
>efforts in producing a first class language that has made my
>programming day much more interesting and fun.
>
>Also thanks to those of you who have answered my pesky questions and to
>those of you who no doubt will answer the ones to come.
>
>It is much appreciated by this programmer and to be honest by many who
>I know.
>
>Thanks to all.
>
>alphazerozero
>ps (Especial thanks to Larry Wall, and to the many who wrote some of
>the funniest docs ive ever read.)
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
------------------------------
Date: 22 Sep 2000 23:16:14 GMT
From: Adam Trace Spragg <spragg@cs.ucdavis.edu>
Subject: Re: Thnaks to the Gurus!
Message-Id: <8qgp7u$mc2$1@mark.ucdavis.edu>
alphazerozero@my-deja.com wrote:
: ps (Especial thanks to Larry Wall, and to the many who wrote some of
: the funniest docs ive ever read.)
In "Programming Perl" the footnote for the sqrt function says:
"Don't try either of these approaches with negative numbers, as that poses
a slightly more complex problem."
THAT is comedy. Whoever wrote that has my deepest admiration.
Adam
------------------------------
Date: Sat, 23 Sep 2000 09:26:42 +0900
From: "Dan and Shelly" <wedeking@msa.attmil.ne.jp>
Subject: too many errors in my program
Message-Id: <8qgt1a$ad8$1@newsflood.tokyo.att.ne.jp>
I wrote a perl script that has so many error messages when I try to run it
that they scroll right past the end of the screen.
How can I capture these error messages into a file so I can step through
each one and try to fix them one at a time?
Dan
------------------------------
Date: Fri, 22 Sep 2000 23:36:51 +0100
From: Andrew <ag@xroodnet.demon.co.uk>
Subject: Re: Warning message in Win32::ODBC module
Message-Id: <39CBDF03.D8261EC6@xroodnet.demon.co.uk>
I had exactly the same problem this week and our in house Perl guru worked
this out too.
We looked at the latest Win32:ODBC module (can`t remember version) and its
already fixed.
Henry Hartley wrote:
> Philip Lees wrote:
> >
> > Hi. I'm using Win32::ODBC to read data from a database and insert it
> > into an html file for output. It's working fine, except that I get the
> > following warnings:
> >
> > Use of uninitialized value at C:/Perl/site/lib/Win32/ODBC.pm line 261.
> > foreach (@Results){
> > s/ +$//; # HACK
> > $self->{'data'}->{ ${$self->{'fnames'}}[$num] } = $_;
> > $num++;
> > }
> >
>
> Somewhere above the "foreach (@Results){" line there will be a line that
> starts with "my" and contains "$num". I don't remember the exact
> wording, I think it was:
>
> my(@Results, $num);
>
> Replace that single line with the two lines:
> my @Results;
> my $num = 0;
>
> Now, you don't have an uninitialized value of $num when you get to the
> reference below it. This really should be fixed in the source. Dave
> Roth, if you are listening...
>
> Henry Hartley
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4409
**************************************