[23876] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6079 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 4 14:10:56 2004

Date: Wed, 4 Feb 2004 11:10:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 4 Feb 2004     Volume: 10 Number: 6079

Today's topics:
    Re: Perl For Amateur Computer Programmers <edgrsprj@ix.netcom.com>
    Re: Perl For Amateur Computer Programmers <edgrsprj@ix.netcom.com>
    Re: Perl For Amateur Computer Programmers <edgrsprj@ix.netcom.com>
    Re: Perl For Amateur Computer Programmers <edgrsprj@ix.netcom.com>
    Re: Perl For Amateur Computer Programmers <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: Perl For Amateur Computer Programmers <edgrsprj@ix.netcom.com>
    Re: Perl For Amateur Computer Programmers <uri@stemsystems.com>
    Re: Perl For Amateur Computer Programmers <edgrsprj@ix.netcom.com>
    Re: Perl For Amateur Computer Programmers <edgrsprj@ix.netcom.com>
    Re: Perl For Amateur Computer Programmers <uri@stemsystems.com>
    Re: Perl, Python, and Ruby <edgrsprj@ix.netcom.com>
    Re: RegExp for matching word "karl@aol.com" or word "pa <rtbvfg99@lnubb.qr>
        Simple syntax question (Trimbitas Sorin)
    Re: Simple syntax question <mike@ellwoods.org.uk>
    Re: Simple syntax question <raisin@delete-this-trash.mts.net>
    Re: Site Visitor's eMail Address <sbryce@scottbryce.com>
    Re: Site Visitor's eMail Address <ceo@nospan.on.net>
    Re: Site Visitor's eMail Address <ceo@nospan.on.net>
    Re: vdmfec and Perl? <jwillmore@remove.adelphia.net>
    Re: When to "use strict" when teaching? <nobull@mail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 04 Feb 2004 16:23:41 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <h09Ub.10285$GO6.3910@newsread3.news.atl.earthlink.net>

"David K. Wall" <dwall@fastmail.fm> wrote in message
news:Xns9482824C73591dkwwashere@216.168.3.30...
> "edgrsprj" <edgrsprj@ix.netcom.com> wrote:

>
> It's not only possible that there are errors, it's certain.
>

I will take another look at the codes on that page.  I checked the .html
file with both Internet Explorer and Newscape and the I thought that the
codes looked Ok.  Perhaps some characters are not printing correctly with
certain browsers.

If correction upates to that Web page are not being posted there immediately
it is simply because of time limitations.  Also, remember that my primary
goal here is to find the best programming language to shift to for the types
of applications being considered.  That Web page is more of an afterthought.
It will eventually disappear if I do not choose Perl or if the page does not
seem to be serving any useful function.




------------------------------

Date: Wed, 04 Feb 2004 16:26:48 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <c39Ub.10288$GO6.9784@newsread3.news.atl.earthlink.net>

"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x74quan0ls.fsf@mail.sysarch.com...
> >>>>> "DKW" == David K Wall <dwall@fastmail.fm> writes:
>

> i was taught that it was because we didn't appease the gods and they
> were stomping around doing polkas. and that we can stop them by offering
> up perl virgins in sacrifice. i should put this up in a web page
> too. does anyone who knows how to *program* in html wanna help me?
>

Netscape has a free, downloadable Web page editor which I find works nicely.
You don't really need to understand html to create Web pages though it
helps.




------------------------------

Date: Wed, 04 Feb 2004 16:36:07 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <Xb9Ub.10312$GO6.2124@newsread3.news.atl.earthlink.net>

"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:apus101fs05mppvmeccqrc5pqkqgh55rtn@4ax.com...
> On 31 Jan 2004 23:21:47 GMT, "Tassilo v. Parseval"
> <tassilo.parseval@rwth-aachen.de> wrote:
>

> Well, it is clear that the OP is *not* "yet another troll", or at

There is a very serious informal, international scientific project involved
with this.  As I have said in other posts, time limitations are controlling
what is and is not being done.  I managed to get a full day free in order to
create that Perl Web page.  And since then I have not been able to get any
large blocks of time free to do any more work on it.  At the moment there
can even be several day periods of time between the times when I can post
notes here or answer my e-mail.




------------------------------

Date: Wed, 04 Feb 2004 17:10:31 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <bI9Ub.10349$GO6.4254@newsread3.news.atl.earthlink.net>

"Iain Chalmers" <bigiain@mightymedia.com.au> wrote in message
news:bigiain-39F8C2.15434703022004@news.fu-berlin.de...
> In article <qkOSb.4022$jH6.3447@newsread1.news.atl.earthlink.net>,
>  "edgrsprj" <edgrsprj@ix.netcom.com> wrote:
>

> Which is fine if you once knew enough c to be able to work out what you
> get there, but like you've identified, its not in the useful for "people
> around the world who are not professional computer programmers could use
> with the same ease as Basic" category...
>

The applications it is needed for are not that complex.  I myself can
already create the necessary code.  So once things get past a certain point
it might work fine.  Right now I need to determine how well Perl, Python,
Ruby, or some other language can do with controlling Windows screens.  On my
PC I already have Perl controlling Windows screens by having it send
instructions to a simple Windows control program through the Windows
clipboard.  And it works.  But it is slow.  And I would rather have Perl or
whatever do all of those Windows screen operations itself.




------------------------------

Date: Wed, 4 Feb 2004 09:14:32 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <o99rvb.5ro.ln@goaway.wombat.san-francisco.ca.us>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

On 2004-02-04, edgrsprj <edgrsprj@ix.netcom.com> wrote:
> "David K. Wall" <dwall@fastmail.fm> wrote in message
> news:Xns9482824C73591dkwwashere@216.168.3.30...
>> "edgrsprj" <edgrsprj@ix.netcom.com> wrote:
>
>> It's not only possible that there are errors, it's certain.
>
> I will take another look at the codes on that page.  I checked the .html

David was not just referring to the html, but to your Perl code and
explanations, a significant amount of which is also either wrong or
extremely bad.  He even quoted a few examples--did you fix those yet?

- --keith

- -- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFAISh2hVcNCxZ5ID8RAlZiAJ9gI6V33iI/IJJ7bR2ltfxZTFiLFgCeLmHB
qgaQt4MsciEg0+HLnbttcEY=
=5HXg
-----END PGP SIGNATURE-----


------------------------------

Date: Wed, 04 Feb 2004 17:47:45 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <5faUb.10409$GO6.9028@newsread3.news.atl.earthlink.net>

"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:9unu10d236pg8sfi86jpmg5p3rvn64q4di@4ax.com...
> On Sat, 31 Jan 2004 13:45:58 GMT, "edgrsprj" <edgrsprj@ix.netcom.com>
> wrote:
>

Michele, here is what that Web page says or is intended to say:

If you have never used Perl and want to write a simple program which will
read two numbers from the keyboard, multiply them together, and store the
results in a file then do "this, this, and that."  And when you are done the
numbers you want should be present in that file.

It explains where to find the original download Perl file and the location
of some helpful Web sites etc.

It is presently intended to a large extent just to provide people with
enough information that they can write a simple program and get it running
without having to spend weeks reading through the documentation.  The codes
on the page are not meant to be perfect.  They are simply ones which will
work for someone who just wants to see if he or she can write a Perl program
which will let him or her add or subtract two numbers etc.

From what I can tell, so far just a relatively few people have looked at
that Web page.  And I would guess that most of them were probably
experienced Perl users who are not about to change the way they write
programs based on the information on that page.

I have been making extensive use of the available .html documentation files.
However I found that quite often there would be helpful information in some
file which you would not be able to find by just following the links.  If
you do a Windows search for a particular word or group of words then you can
find all of those references and check them individually.

Most of the people with whom I am talking are using the Windows program as
am I.  So I am trying to organize things so that as many people as possible
will be able to understand the material.

And finally, as I have been saying, that Web page will probably remain there
only if it appears that it is going to be helpful to people.  It is largely
experimental at the moment.  At this point no decision has been made on its
future.




------------------------------

Date: Wed, 04 Feb 2004 17:48:32 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <x7y8ri4txs.fsf@mail.sysarch.com>

>>>>> "e" == edgrsprj  <edgrsprj@ix.netcom.com> writes:

  e> "Uri Guttman" <uri@stemsystems.com> wrote in message
  e> news:x74quan0ls.fsf@mail.sysarch.com...
  >> >>>>> "DKW" == David K Wall <dwall@fastmail.fm> writes:
  >> 

  >> i was taught that it was because we didn't appease the gods and they
  >> were stomping around doing polkas. and that we can stop them by offering
  >> up perl virgins in sacrifice. i should put this up in a web page
  >> too. does anyone who knows how to *program* in html wanna help me?
  >> 

  e> Netscape has a free, downloadable Web page editor which I find
  e> works nicely.  You don't really need to understand html to create
  e> Web pages though it helps.

OY!!!!

you are so clueless, that i don't want to be in any area where you are
doing earthquake research. have you sacrificed a perl virgin yet or are
you still alive?

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Wed, 04 Feb 2004 17:57:08 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <UnaUb.10431$GO6.2894@newsread3.news.atl.earthlink.net>

"Keith Keller" <kkeller-usenet@wombat.san-francisco.ca.us> wrote in message
news:o99rvb.5ro.ln@goaway.wombat.san-francisco.ca.us...

>
> David was not just referring to the html, but to your Perl code and
> explanations, a significant amount of which is also either wrong or
> extremely bad.  He even quoted a few examples--did you fix those yet?
>

I have made a few corrections to that Web page.  Checks for others will have
to wait until I can get some more time free.

As I have been saying, it is an experimental Web page at the moment.  If I
decide to use another language, if it does not look like it is going to be
helpful, or if it is too much trouble to maintain it will probably
disappear.




------------------------------

Date: Wed, 04 Feb 2004 18:06:29 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <FwaUb.10445$GO6.9920@newsread3.news.atl.earthlink.net>

"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7y8ri4txs.fsf@mail.sysarch.com...
> >>>>> "e" == edgrsprj  <edgrsprj@ix.netcom.com> writes:
>

> you are so clueless, that i don't want to be in any area where you are

Your original post was fairly clear.  I was just trying to be nice.




------------------------------

Date: Wed, 04 Feb 2004 18:55:23 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Perl For Amateur Computer Programmers
Message-Id: <x7ptcu4qud.fsf@mail.sysarch.com>

>>>>> "e" == edgrsprj  <edgrsprj@ix.netcom.com> writes:

  e> "Uri Guttman" <uri@stemsystems.com> wrote in message
  e> news:x7y8ri4txs.fsf@mail.sysarch.com...
  >> >>>>> "e" == edgrsprj  <edgrsprj@ix.netcom.com> writes:
  >> 

  >> you are so clueless, that i don't want to be in any area where you are

  e> Your original post was fairly clear.  I was just trying to be nice.

telling me about html editors is being foolish and not nice. not
detecting sarcasm is not nice either.

you just don't get it. teaching anything to any group is hard. teaching
programming to non-programmers can be very hard. your skills in perl and
teaching are non-existant and it shows. i can't imagine anyone getting
any value from your site. just getting the free beginning perl or a
quality free tutorial (a couple exist) would do more for any perl
newbie. just point your earthquake people to those resources and drop
your silly site already.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Wed, 04 Feb 2004 17:01:16 GMT
From: "edgrsprj" <edgrsprj@ix.netcom.com>
Subject: Re: Perl, Python, and Ruby
Message-Id: <wz9Ub.10341$GO6.9845@newsread3.news.atl.earthlink.net>

"Tim Hammerquist" <tim@vegeta.ath.cx> wrote in message
news:slrnc1r0ih.27d.tim@kimari.saiyix...
> edgrsprj <edgrsprj@ix.netcom.com> wrote:

Thanks for all of that helpful information.




------------------------------

Date: Wed, 04 Feb 2004 17:39:23 +0100
From: Robert Meyer <rtbvfg99@lnubb.qr>
Subject: Re: RegExp for matching word "karl@aol.com" or word "paul@hotmail.com" ?
Message-Id: <pan.2004.02.04.16.39.16.196934@lnubb.qr>

Am Wed, 04 Feb 2004 13:47:49 +0100 schrieb Gerd Pohlmann:

> Just a stupid question from a newbie: 
> How do I setup a reg exp which matches if the text (line) contains
> either the full word "karl@aol.com" or the full word "paul@hotmail.com" (without quotes)?
> 
> (karl@aol.com|paul@hotmail.com)
> 
> does not work.
> 
> Gerd

Hi Gerd,

you have to mask the @ and the . with a \

So it looks like this
(karl\@aol\.com|paul\@hotmail\.com)

If you want to use it in a Perl Program then you must includ it into two /
like this
(/karl\@aol\.com/|/paul\@hotmail\.com/)

If you want to learn more about Regexp then use ISBN 3-89721-349-4 from
O'Reilly.

greets
Robert

-- 
There are only 10 types of people in the world:
Those who understand binary, and those who don't.
http://www.one-m.de
http://www.lugbz.org/documents/smart-questions_de.html



------------------------------

Date: 4 Feb 2004 08:46:27 -0800
From: lacroix-iv@go.ro (Trimbitas Sorin)
Subject: Simple syntax question
Message-Id: <2fa2cde3.0402040846.764fb1a1@posting.google.com>

Hello
I have a simple syntax question :
What does the following line mean:
1: %checkType; ?? I know that @test="" is an array and $test="" is a
simple variable.
Thank you
With best regards
Trimbitas Sorin


------------------------------

Date: Wed, 4 Feb 2004 17:02:07 +0000
From: Mike Ellwood <mike@ellwoods.org.uk>
Subject: Re: Simple syntax question
Message-Id: <Pine.WNT.4.56.0402041657510.221@harris.CIS.rl.ac.uk>

On Wed, 4 Feb 2004, Trimbitas Sorin wrote:

> Hello
> I have a simple syntax question :
> What does the following line mean:
> 1: %checkType; ?? I know that @test="" is an array and $test="" is a
> simple variable.
> Thank you
> With best regards
> Trimbitas Sorin

Learn to fish.

The answer can be found, for example, somewhere here:

http://learn.perl.org/library/beginning_perl/

(look for hashes), or e.g. "Learning Perl" published by O'Reilly.
(and cheap at twice the price :) )

Regards,

-- 
mike@ellwoods.org.uk


------------------------------

Date: Wed, 4 Feb 2004 13:01:50 -0600
From: Web Surfer <raisin@delete-this-trash.mts.net>
Subject: Re: Simple syntax question
Message-Id: <MPG.1a8afd95e6c3b0e69897ac@news.mts.net>



In article <2fa2cde3.0402040846.764fb1a1@posting.google.com>, lacroix-
iv@go.ro says...
> Hello
> I have a simple syntax question :
> What does the following line mean:
> 1: %checkType; ?? I know that @test="" is an array and $test="" is a
> simple variable.
> Thank you
> With best regards
> Trimbitas Sorin
> 

%checktype is a "hash"

# unlike a "normal" array whose index value needs to be an integer 
value, the "index" for a hash can be just about any kind of scalar 
value.

%colors  = ( "apple" => "red" , "orange" => "orange" ,
		"lemon" => "yellow" );

print "The color of an apple is ",$colors{"apple"},"\n";

Consult the "perldoc" command or your Perl reference manual for further 
details on hashes.


------------------------------

Date: Wed, 04 Feb 2004 10:07:54 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Site Visitor's eMail Address
Message-Id: <10229naq99jk578@corp.supernews.com>

Steve wrote:


> You could send a link like this 
> 
> http://www.mysite.com/stuff/grab.pl?name=johnsmith

John could re-mung this URL, so you wouldn't know it was John.

This is more of a CGI question than a Perl question.



------------------------------

Date: Wed, 04 Feb 2004 18:10:14 GMT
From: Chris <ceo@nospan.on.net>
Subject: Re: Site Visitor's eMail Address
Message-Id: <aAaUb.32016$po6.631@newssvr33.news.prodigy.com>

Tore Aursand wrote:
> On Wed, 04 Feb 2004 07:54:03 +0000, snoopy wrote:
> 
>>Would it be possible for me to get email addresses of those who click on
>>the link in the email I send them?
> 
> 
> Yes.  What have you tried so far?  What didn't work?
> 
> 

No.  He's talking about sniffing the address, which you can't normally 
do.  Not without some hacking or cross-site scripting which isn't what 
he wants either.  And he's ASKING because he doesn't know WHAT to try or 
do -- which is fair (but some people in this NG don't see it that way.)

Chris
-----
Chris Olive
chris -at- technologEase -dot- com
http://www.technologEase.com
(pronounced "technologies")



------------------------------

Date: Wed, 04 Feb 2004 18:22:50 GMT
From: Chris <ceo@nospan.on.net>
Subject: Re: Site Visitor's eMail Address
Message-Id: <ZLaUb.32021$Xi6.4137@newssvr33.news.prodigy.com>

snoopy wrote:
> I teach Mathematics using Internet to secondary school students.  I have
> many students to whom I send emails on Monday, Wednesday, and Friday.
> 
> Each email I send to my students have a link to the problem sets for that
> day, and when my students receive that email, they are supposed to click on
> the link, and do the problems.
> 
> Now I have many students, and need to follow up who is visiting the site and
> doing the problems.  At this point, I see how many visitors incur for each
> site through Log file, but there is no way for me to know which students are
> visiting the site and which students are not doing the problems at all.
> 
> Would it be possible for me to get email addresses of those who click on the
> link in the email I send them??  Can anybody help me realize this using
> Perl??
> 
> Any help will be deeply appreciated.
> 
> Thanks.
> 
> 

You can't "sniff" a user's email address by them clicking a link on a 
web page.  Lots of people would LIKE to be able to do this, but you 
can't do this directly.

Indirectly, it would require some hacking or cross-site scripting, which 
you don't want to get into.

Aside from the GET URL solution you have already been offered (which is 
a good workable solution, though not foolproof), is another solution 
(also not foolproof):

Host your problem sets in files on an FTP server allowing "anonymous" 
login and ask your students to update their browsers to include their 
real email addresses for anonymous FTP access.  Every time they click a 
link to download your problem sets, the login "password" will 
automatically be their email address -- they don't have to enter 
anything.  Just check your FTP log for the accesses just like you are 
doing for browser clicks.

The downside here is you probably won't get all your students to 
cooperate with this scheme (it would be voluntary on their parts) and it 
would also potentially open them up to SPAM from other sites they FTP'd 
into (which would harvest their anonymous login passwords containing 
their email addresses -- which is one reason I would NEVER change my 
anonymous FTP password to my real email address.)

But...  It's a thought.  (Not at all related to Perl.)

Chris
-----
Chris Olive
chris -at- --spammers-are-vermen-- technologEase -dot- com
http://www.technologEase.com
(pronounced "technologies")



------------------------------

Date: Wed, 04 Feb 2004 14:00:27 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: vdmfec and Perl?
Message-Id: <pan.2004.02.04.19.00.25.639432@remove.adelphia.net>

On Tue, 03 Feb 2004 13:10:26 -0800, Andreas Wachhold wrote:

> Hello, I am trying to use the program vdmfec from within perl. I am
> trying to use it together with tar or gzip etc. I wonder how it works?
> Every time I use it, i get error messages. Has anyone any experince with
> vdmfec?

NEI (Not Enough Information).

What have you tried?  Where's the code ;-)

You might, for starters, read perlipc.  This *may* be of some use in what
you're trying to do.  Also look over the 'system' function, IPC::Open2,
and IPC::Open3.  Without knowing this 'vdmfec' application and without
seeing what you tried, this is what I can offer.

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
"OK, now let's look at four dimensions on the blackboard."   --
Dr. Joy 



------------------------------

Date: 04 Feb 2004 18:44:04 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: When to "use strict" when teaching?
Message-Id: <u965em7ki3.fsf@wcl-l.bham.ac.uk>

mjd@plover.com (Mark Jason Dominus) writes:

> In article <bvlvj6$36g$1@south.jnrs.ja.net>,
> Simon Andrews  <simon.andrews@bbsrc.ac.uk> wrote:
> >1) When do you think it's best to introduce strictures into the programs 
> >people write.
> 
> 
> When I do three-day intro classes, I introduce subroutines early in
> the afternoon of day 2.  The next section of the class is about 'my'
> variables, because there's no use for 'my' variables until...

Now I know you have more experience of teaching but I think this is
arse-about-face.  I suspect your idea of the logical idea to introduce
concepts is being influenced by the history of Perl (in the same way
as feotal development seems to mirror evolution).

Most languages don't have implicit variable declaration.  I see no
reason to introduce the concept so early.

> ... programs are big enough to need to have subroutines.

I know that when people are first leaning a language they tend to
write really short programs. I also know that implicit quoting of
strings and implicit variable declaration can be a handly techniques
when writing very short programs.  (Once again, I think it makes more
sense to express it in that positive way than your negative way).

However, the students are not learning to write small programs in
Perl.  They are learning Perl.  The correct place to introduce "no
strict qw( subs vars)" is in the lesson where one talks about special
techniques for one-liner programs and the command line switches -e -F
-l -n -p and so on.  

(The correct place to introduce "no strict qw(refs)" is in "advanced
techniques" along with GLOBs and AUTOLOAD methods).

> The motivation for all three features is similar.  You want
> subroutines for modularity and reusability.  Subroutines that refer to
> global variables are neither modular nor reusable, so you need 'my'
> variables.  And 'strict vars' helps you remember to declare the
> variables.

You are letting your knowledge the evolutionary history of Perl bias
you towards seeing "use strict" as adding features.  It is not.  For
someone looking at Perl5 afresh it is more appropriate to see it as
switching off rarely useful features (implicit quoting, implicit
declaration of unqualified package variables, symbolic references) that
are enabled by default for largely historical resons.

> I don't cover 'strict refs' until the following afternoon, after
> we've seen references; then I can discuss the serious and
> untraceable problems that can be caused by accidental use of
> symbolic references.

In a 3-day class probably would never mention in detail the
consequences of omitting "use strict".  (Actually that depends on the
audience - a 3-day course for Unix sysadmins probably would include
the lession about one-liner programs and the command line switches -e
-F -l -n -p).

> I think the philosophy that says that you should always have 'use
> strict' at the top of every program from the start of day one is
> misguided.

I disagree.
 
>  The theory is that you're training people to follow good
> programming practices.

That's not my theory.  Teaching them to follow good practice is
separate.  Given that we're doing that anyhow "use strict; use
warnings;" just makes life easier for them.

>  But this theory somehow manages to forget that
> putting stuff into your program when you don't know what it does is
> the very worst of all possible programming practices.

When I say "use MODULE" I only need to know what it does upto some
level.  The whole point about modularisation is that I don't need a
full understanding of the internals.

I would tell them the truth: "use strict" disables three features of
Perl that are only rarely useful and make debugging a whole lot harder
if you accidently use them when you didn't intend.  If my students are
smart they'll ask why are these features enabled by default.  The
answer I'd give is: "party history and partly because two of these
features are primarily useful in one-line scripts where the overhead
of having to explicitly switch them on would be proportionately very
high".

That is enough.  They now understand why it is that omitting "use
strict" should be considered a positive action.

Once I've given them enough information for them to understand why
omitting "use strict" should be considered a positive action that very
same argument "putting stuff into your program when you don't know
what it does is the very worst of all possible programming practices"
now applies to leaving out strict.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 6079
***************************************


home help back first fref pref prev next nref lref last post