[25499] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7743 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 6 06:05:37 2005

Date: Sun, 6 Feb 2005 03:05:11 -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           Sun, 6 Feb 2005     Volume: 10 Number: 7743

Today's topics:
    Re: Can't get perl to find .pm in my own private direct <spamtrap@dot-app.org>
        explain "Larry expects that he'll be certified..." (Brandon Walsh)
    Re: explain "Larry expects that he'll be certified..." <wyzelli@yahoo.com>
    Re: explain "Larry expects that he'll be certified..." <spamtrap@dot-app.org>
    Re: explain "Larry expects that he'll be certified..." <spamtrap@dot-app.org>
    Re: explain "Larry expects that he'll be certified..." <posted@cyberpomo.com>
    Re: perl style: can I combine two steps into one? <postmaster@castleamber.com>
    Re: perl style: can I combine two steps into one? <rasto@gmx.at>
    Re: perl style: can I combine two steps into one? <abigail@abigail.nl>
    Re: perl style: can I combine two steps into one? (Anno Siegel)
    Re: perl style: can I combine two steps into one? <>
    Re: perl style: can I combine two steps into one? <Red.Grittybrick@SpamWeary.Foo>
    Re: perl telnet (not www) bbs? <cavac@grumpfzotz.org>
        Problem with binary numbers perldude@nospam.com
    Re: Why aren't 'warnings' on by default? <matternc@comcast.net>
    Re: Why aren't 'warnings' on by default? <abigail@abigail.nl>
    Re: Why aren't 'warnings' on by default? <wyzelli@yahoo.com>
    Re: Why aren't 'warnings' on by default? <wksmith@optonline.net>
    Re: Why aren't 'warnings' on by default? <d@adelphia.net>
    Re: Why aren't 'warnings' on by default? <Red.Grittybrick@SpamWeary.Foo>
    Re: Why aren't 'warnings' on by default? <wyzelli@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 05 Feb 2005 18:44:10 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Can't get perl to find .pm in my own private directory
Message-Id: <KK-dnaK9vtbRx5jfRVn-sA@adelphia.com>

MJ wrote:

> One thing that I do quite often while developing modules is:
> 
> use lib ".";
> 
> Then, I can put the module hierarchy right in the same directory and my
> project is self-contained until it's ready to publish.

Quite right, but there's one aspect of it that might be worth expanding on
for any newbies who might be reading. While '.' is already in the default
@INC, it's at the *end*, so that the current directory is only searched if
the requested module isn't found elsewhere. So, if you try to "use()" a
module when there's a stable version of the same module already installed,
the local copy won't be used.

That's not good. If you're writing a test script, you want it to use the
local working copy instead of the global copy. That's what the "use lib
'.';" does for you - it adds "." to the *beginning* of @INC, so that local
modules are preferred over like-named global modules.

Of course, when you use MakeMaker for your modules, 'make test' will use
Perl's '-I' option to do that for you automagically... :-)

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: 6 Feb 2005 02:00:25 -0800
From: brandonwalsh_9@hotmail.com (Brandon Walsh)
Subject: explain "Larry expects that he'll be certified..."
Message-Id: <dd7a7ba2.0502060200.6db9f357@posting.google.com>

Hi,

I enjoy the tongue-in-cheek style of Perl documentation, but English
is not my mother tongue, so i don't get all jokes.

Can someone please explain this quote from perlfaq2: "Larry expects
that he'll be certified before Perl is."

What does the word "certified" means here?

Thanks in advance!


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

Date: Sun, 06 Feb 2005 10:22:11 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: explain "Larry expects that he'll be certified..."
Message-Id: <ndmNd.149966$K7.85573@news-server.bigpond.net.au>

"Brandon Walsh" <brandonwalsh_9@hotmail.com> wrote in message 
news:dd7a7ba2.0502060200.6db9f357@posting.google.com...
: Hi,
:
: I enjoy the tongue-in-cheek style of Perl documentation, but English
: is not my mother tongue, so i don't get all jokes.
:
: Can someone please explain this quote from perlfaq2: "Larry expects
: that he'll be certified before Perl is."
:
: What does the word "certified" means here?

A pun on the contextually different meanings of the word certified.

In the case of Larry being certified, it means officially declared 'insane' 
(mad, loony, etc) and probably consigned to an asylum.  Think 'certifiably 
mad'.

In the case of Perl being certified, it means officially accepted by a 
certifying body (ratified, declared as a standard etc) and the standard 
probably published.  Think 'Microsoft Certified' etc.

P
-- 
print "Just another Perl Hacker";




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

Date: Sun, 06 Feb 2005 05:24:52 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: explain "Larry expects that he'll be certified..."
Message-Id: <pLGdnce_yL3rbZjfRVn-qQ@adelphia.com>

Brandon Walsh wrote:

> Can someone please explain this quote from perlfaq2: "Larry expects
> that he'll be certified before Perl is."
> 
> What does the word "certified" means here?

Courtesy of <http://www.dictionary.com>:

    v. cer·ti·fied, cer·ti·fy·ing, cer·ti·fies 
        1. To confirm formally as true, accurate, or genuine.
        2. To guarantee as meeting a standard: butter that was certified
           Grade A. See Synonyms at approve.
        3. To acknowledge in writing on the face of (a check) that the
           signature of the maker is genuine and that there are sufficient
           funds on deposit for its payment.
        4. To issue a license or certificate to.
        5. To declare to be in need of psychiatric treatment or confinement.
        6. Archaic. To inform positively; assure.

My money's on #5. :-)

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 06 Feb 2005 05:27:03 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: explain "Larry expects that he'll be certified..."
Message-Id: <pLGdnca_yL1qbZjfRVn-qQ@adelphia.com>

Peter Wyzl wrote:

> Think 'certifiably mad'.
 ...
> Think 'Microsoft Certified'

There's a difference???

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


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

Date: Sun, 06 Feb 2005 12:01:13 +0100
From: Calle Dybedahl <posted@cyberpomo.com>
Subject: Re: explain "Larry expects that he'll be certified..."
Message-Id: <867jlmkl52.fsf@ulthar.bisexualmenace.org>

>>>>> "Sherm" == Sherm Pendley <spamtrap@dot-app.org> writes:

> Peter Wyzl wrote:
>> Think 'certifiably mad'.
> ...
>> Think 'Microsoft Certified'

> There's a difference???

Yes, the Microsoft version is much more expensive.
-- 
		     Calle Dybedahl <calle@cyberpomo.com>
		 http://www.livejournal.com/users/cdybedahl/
             Try again. Try harder. -*-  Fail again. Fail better.


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

Date: 5 Feb 2005 23:16:22 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: perl style: can I combine two steps into one?
Message-Id: <Xns95F4AFB01DE61castleamber@130.133.1.4>

Rasto Levrinc wrote:

[ snip defensive programming ]

> No I don't. But I still think that program, that goes sometimes, maybe 
> once a year, silently in the endless loop is a little bit worse, than 
> program that moves on silently with maybe wrong data. You wouldn't like 
> endless loop in your kernel for example.

Ah, but moving on with the wrong data is ok? Both are equally wrong to me.

> It's not that you want to work around your mistakes, there can be many 
> reasons, why i skips 10.

In my example I explicitly stated that i can not do such a thing. If it 
can, then it would be an error not to test >=.

But, again IMNSHO, don't try to "fix" things. Code is documentation too, if 
I see

i >= 10

I wonder in what cases I can be > 10.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Sun, 06 Feb 2005 01:14:46 +0100
From: Rasto Levrinc <rasto@gmx.at>
Subject: Re: perl style: can I combine two steps into one?
Message-Id: <42056083$0$8024$3b214f66@tunews.univie.ac.at>

John Bokma wrote:
> Rasto Levrinc wrote:
> 
> [ snip defensive programming ]
> 
> 
>>No I don't. But I still think that program, that goes sometimes, maybe 
>>once a year, silently in the endless loop is a little bit worse, than 
>>program that moves on silently with maybe wrong data. You wouldn't like 
>>endless loop in your kernel for example.
> 
> 
> Ah, but moving on with the wrong data is ok? Both are equally wrong to me.
> 

No it isn't ok, it is also wrong, but slightly less dangerous, than to 
get in an endless loop. Endless loop is always bad. Wrong data sometimes 
are important sometimes not, so statistically they are less evil.

> 
>>It's not that you want to work around your mistakes, there can be many 
>>reasons, why i skips 10.
> 
> 
> In my example I explicitly stated that i can not do such a thing. If it 
> can, then it would be an error not to test >=.
> 

If you have a little more complex algorithm, you usually don't prove its 
correctness, so you can't say, that you can not do such a thing.
Even if you are 100% sure, that you don't have any mistake in your 
algorithm, it is still possible, that something can go wrong outside 
your program. For example compiler can have a bug, or faulty hardware 
can cause i to skip 10. To test >= is slightly more fault tolerant, than 
== in this case, with very little effort.

-- 

Rasto Levrinc
http://sourceforge.net/projects/rlocate/


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

Date: 06 Feb 2005 00:20:12 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: perl style: can I combine two steps into one?
Message-Id: <slrnd0aols.g2.abigail@alexandra.abigail.nl>

Rasto Levrinc (rasto@gmx.at) wrote on MMMMCLXXVII September MCMXCIII in
<URL:news:42056083$0$8024$3b214f66@tunews.univie.ac.at>:
,,  John Bokma wrote:
,, > Rasto Levrinc wrote:
,, > 
,, > [ snip defensive programming ]
,, > 
,, > 
,, >>No I don't. But I still think that program, that goes sometimes, maybe 
,, >>once a year, silently in the endless loop is a little bit worse, than 
,, >>program that moves on silently with maybe wrong data. You wouldn't like 
,, >>endless loop in your kernel for example.
,, > 
,, > 
,, > Ah, but moving on with the wrong data is ok? Both are equally wrong to me.
,, > 
,,  
,,  No it isn't ok, it is also wrong, but slightly less dangerous, than to 
,,  get in an endless loop. Endless loop is always bad. Wrong data sometimes 
,,  are important sometimes not, so statistically they are less evil.


Wrong data is always bad. But it's defensive for other reasons. While
now the loop might be:

    $i = 0;
    while (true) {
        ...
        $i ++;
        ...
        last if $i >= 10;
    }

In the future, it might look like:

    $i = subroutine ();
    while (true) {
        ...
        $i += 1;
        ...
        last if $i >= 10;
    }

And the subroutine returns a floating point number which, due to rounding
errors, isn't quite an integer.

That's why I prefer to use '$i >= 10' instead of '$i == 10'.


Abigail
-- 
BEGIN {$^H {q} = sub {$_ [1] =~ y/S-ZA-IK-O/q-tc-fe-m/d; $_ [1]}; $^H = 0x28100}
print "Just another PYTHON hacker\n";


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

Date: 6 Feb 2005 01:16:44 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: perl style: can I combine two steps into one?
Message-Id: <cu3r5s$o4u$1@mamenchi.zrz.TU-Berlin.DE>

John Bokma  <postmaster@castleamber.com> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:

> > I lump together closing brackets of all kind, unless I want one to
> > stand out.  You don't want to miss an opening bracket, but the closing

[...]

> Ok, so the first line should have be:
> 
> sort { $b->[ 1] <=> $a->[ 1]}
> 
> ?

No, some constructs are special.  Closing "}" of blocks, and closing
')' of loop- and if-conditionals do get a preceding blank.  Those deserve
to stand out.

Anno


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

Date: 06 Feb 2005 09:01:33 GMT
From: "Henrik" <>
Subject: Re: perl style: can I combine two steps into one?
Message-Id: <4205dced$0$166$edfadb0f@dtext01.news.tele.dk>

John Bokma skrev:

> Anno Siegel wrote:
> > John Bokma  <postmaster@castleamber.com> wrote in
> > comp.lang.perl.misc:
> >> Michael Slass wrote:
> >> >|         ++$hack_count{$1};
> >> 
> >> I recommend using $hack_count{$1}++;
> > 
> > Why?
> 

Another good(?) reason, which also applies to C-code, is that
accidental omision of one + is caught at commpile time, but only if you
use post incrementation.

-- 
Henrik


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

Date: Sun, 6 Feb 2005 10:35:30 +0000 (UTC)
From: RedGrittyBrick <Red.Grittybrick@SpamWeary.Foo>
Subject: Re: perl style: can I combine two steps into one?
Message-Id: <cu4rti$lkr$1@sparta.btinternet.com>

John Bokma wrote:
> Rasto Levrinc wrote:
> 
> 
>>John Bokma wrote:
>>
>>
>>>there. Like another example I posted last week somewhere else:
>>>
>>>(pseudocode)
>>>
>>>i = 0
>>>while (true) {
>>>
>>>
>>>         i++;
>>>         last if i >= 10;
>>>}
>>>
>>>I consider >= 10 misleading if the previous statement is the only one
>>>that modifies i. It can't get > 10 , so why test for it?
>>
>>The reason for that is, that if there is some obscure bug in the code,
>>it is less likely, that the program will run in endless loop.
> 
> 
> And more likely to move on silently. IMNSHO this is wrong.
> 

Since I was raised on FORTRAN, it is deeply ingrained in me that one 
should never test floating point numbers for equality. So I tend to feel 
more comfortable writing "x >= 10" than "x = 10" where x is being 
incremented in some fashion. Unfortunately this aversion also applies 
inappropriately to integer comparisons.

Perhaps one should write
  last if i == 10;
  die "Too many impossible things before breakfast." if i > 10;

;-)

#!perl
use strict;
use warnings;
my $x = 0.0001;
foreach (qw(tum te tum te tum ti tum foo bar baz qux etc)) {
   $x++;
   last if $x == 10;
}
print "x=",$x;
----
12.0001


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

Date: Sun, 06 Feb 2005 03:06:35 +0100
From: Rene Schickbauer <cavac@grumpfzotz.org>
Subject: Re: perl telnet (not www) bbs?
Message-Id: <3452289.VlIdJ4QmQF@gandalf.grumpfzotz.org>

gargoyle wrote:

> Do they exist?  Google isn't very helpful.  I found something called
> Fusion GS, but the links are all broken.

I didn't find any, either.

A friend gave me a cool tip which seems to work out quite well: Just code
all the stuff with Curses::UI (leaving out the network part) and test on
your *nix-console. When everything is working, install your telnetd using
your perl-script as lgin-command (your telnetd should have an option to
specify it).

That way, telnetd does all that its nifty terminal-emulation thingies and
you can concentrate on your software.

Before actually starting to code you should try with one of the examples
that come with the Curses::UI package (try one of the color-demos to check
if color-telnet works, too).

LLAP & LG
Rene


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

Date: Sun, 06 Feb 2005 02:59:44 -0500
From: perldude@nospam.com
Subject: Problem with binary numbers
Message-Id: <jeib01dejbalviog3pqsgpgss79chucc56@4ax.com>

A third-party module that I'm using has a couple of binary constants defined:

GENERIC_READ=10000000000000000000000000000000
GENERIC_EXECUTE=100000000000000000000000000000

The binary value for GENERIC_READ|GENERIC_EXECUTE would be:
10100000000000000000000000000000

I'm trying to check if a field in an object created by the module equals
GENERIC_READ|GENERIC_EXECUTE, but I'm running into a problem.  If I print out
the value for a field that I know equals GENERIC_READ|GENERIC_EXECUTE, then it
prints out -1610612736.  
But when I have the statement "print GENERIC_READ|GENERIC_EXECUTE", it prints
out 2684354560.

The following statements both print out 10100000000000000000000000000000:
printf("%0b\n", 2684354560);
printf("%0b\n", -1610612736);

So the binary representation for GENERIC_READ|GENERIC_EXECUTE has 2 different
decimal representations, a positive one and a negative one.  Why does the
field in the object created by the third-party module have a negative decimal
representation, while my own code has a positive decimal representation?



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

Date: Sat, 05 Feb 2005 18:36:51 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <Ks-dnTfVPK0OxZjfRVn-iA@comcast.com>

Abigail wrote:

> Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMMCLXXVI
> September MCMXCIII in <URL:news:cu2vqg$9m5$1@mamenchi.zrz.TU-Berlin.DE>:
> ..
> ..  A general recommendation is to make old code warnings-clean, but not
> to
> ..  bother with strict "vars" (the hard part of strict).  As you have
> observed,
> ..  it takes a lot of time, and you don't gain very much with a program
> that
> ..  was written without a view to lexical scope.  Variables simply won't
> *have*
> ..  the small scope they could have, and changing that is far from
> trivial.
> 
> 
> Well, using strictness doesn't do anything with reducing the scope of
> variables. Declaring your variables at the top of the file with 'my'
> make strict very very happy - but you still have variables with a broad
> scope - and global if you don't use other modules.
> 
> 
But even so, it helps; catches every time you've misspelled a variable
name, if nothing else.

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: 06 Feb 2005 00:15:36 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <slrnd0aod8.g2.abigail@alexandra.abigail.nl>

Chris Mattern (matternc@comcast.net) wrote on MMMMCLXXVI September
MCMXCIII in <URL:news:Ks-dnTfVPK0OxZjfRVn-iA@comcast.com>:
`'  Abigail wrote:
`'  
`' > Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMMMCLXXVI
`' > September MCMXCIII in <URL:news:cu2vqg$9m5$1@mamenchi.zrz.TU-Berlin.DE>:
`' > ..
`' > ..  A general recommendation is to make old code warnings-clean, but not
`' > to
`' > ..  bother with strict "vars" (the hard part of strict).  As you have
`' > observed,
`' > ..  it takes a lot of time, and you don't gain very much with a program
`' > that
`' > ..  was written without a view to lexical scope.  Variables simply won't
`' > *have*
`' > ..  the small scope they could have, and changing that is far from
`' > trivial.
`' > 
`' > 
`' > Well, using strictness doesn't do anything with reducing the scope of
`' > variables. Declaring your variables at the top of the file with 'my'
`' > make strict very very happy - but you still have variables with a broad
`' > scope - and global if you don't use other modules.
`' > 
`' > 
`'  But even so, it helps; catches every time you've misspelled a variable
`'  name, if nothing else.


Oh, yes, I didn't say that it doesn't help. I said that strictness in 
itself doesn't do anything to help reducing variable scopes.

Note also that 'use warnings' goes a long way to help catch misspelled
variable names. And that neither strictness nor warnings helps if your
misspelled variable name happens to be a name of another variable.



Abigail
-- 
perl -wle'print"Êõóô áîïôèåò Ðåòì Èáãëåò"^"\x80"x24'


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

Date: Sun, 06 Feb 2005 04:40:54 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <qdhNd.149302$K7.92892@news-server.bigpond.net.au>

"John Bokma" <postmaster@castleamber.com> wrote in message 
news:Xns95F48FE711B99castleamber@130.133.1.4...
: Peter Wyzl wrote:
:
: > "John Bokma" <postmaster@castleamber.com> wrote in message
: > news:Xns95F3F20B3A2F9castleamber@130.133.1.4...
: > : Chris Mattern wrote:

<snip>

: > First thing I do when looking at someone else's code is turn them both
: > on, and look at the resultant errors/warnings.
: >
: > A recent example is a publicly available 'blogging' script that does
: > use 'my' declarations, but inappropriately (ie, declares the same
: > variable name three times in the same scope - 'declaraton masks
: > earlier in same scope'). That gives some idea about the types of
: > problems to be encountered elsewhere.  Gives you some idea of what the
: > original programmer does or doesn't know.
:
: You aren't talking about GreyMatter are you ? (Yikes)

No. Bloxsom.  No doubt there are others as bad or worse.

Some of the concepts in these programs are 'non scalable' at best.  For 
example, reading in all the entries, formatting them and printing them out 
dynamically for every hit, instead of converting them to static pages and 
only updating for new entries.  The unnecessary server load for busy 
blogging servers is rather huge. :(

P
-- 
print "Just another Perl Hacker";




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

Date: Sun, 6 Feb 2005 01:05:44 -0500
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <4uiNd.73$0T3.18@fe12.lga>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de>
--snip--
> A general recommendation is to make old code warnings-clean, but not
to
> bother with strict "vars" (the hard part of strict).  As you have
observed,
> it takes a lot of time, and you don't gain very much with a program
that
> was written without a view to lexical scope.  Variables simply won't
*have*
> the small scope they could have, and changing that is far from
trivial.
>
> Of course, if the code has a long future ahead it may pay to do the
> necessary partial re-write.

--snip--


I agree.  Blindly declaring every
variable with "my" just to make
old code "strict" compliant has
little advantage.  Using the
warnings to find 'every' variable
retains spelling errors in the
original code.

Changing to lexical variables may
introduce errors because there
are a few constructs which
require package variables. New
warning will probably be
generated.

Properly scoping all variables
can be a huge task, especially if
the code uses formats.


Bill




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

Date: Sun, 06 Feb 2005 00:29:07 -0800
From: DJO <d@adelphia.net>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <ltadncQuENLjSJjfRVn-hw@adelphia.com>

Chris Richmond - MD6-FDC ~ wrote:
> Seems to me that nobody will support help requests until warnings
> are turned on, let alone maybe strict.  Why isn't it turned on
> by default?  Its a good idea 99.99% of the time.  Then the
> .01% when it isn't, make the user shut it off.
> 
> Chris
> 
Because strict and warnings pragmas were not built in to early Perl 
versions.  Generally, Perl version updates strive to not break existing 
code.  Defaulting to strictures and warnings being "on" would definately 
break older code that didn't count on them being there.


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

Date: Sun, 6 Feb 2005 10:08:40 +0000 (UTC)
From: RedGrittyBrick <Red.Grittybrick@SpamWeary.Foo>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <cu4qb8$q84$1@hercules.btinternet.com>

Chris Mattern wrote:
> mjl69 wrote:
> 
> 
>>>Seems to me that nobody will support help requests until warnings
>>>are turned on, let alone maybe strict.  Why isn't it turned on
>>>by default?  Its a good idea 99.99% of the time.  Then the
>>>.01% when it isn't, make the user shut it off.
>>
>>When your program works and it is ready for real world use, you can turn
>>it off. When posting here, it's like you're in school.
>>
> 
> I don't think you understand his question.  He's not complaining about
> having to use warnings, he's wondering about why it isn't *on* by
> default if it's that universally useful.
> 
> Basically, mjl, it's the cause of probably 90% of the evils in
> software design: backwards compatibility.  -w (the precursor of
> use warnings) as we know it today and the restrictions it puts 
> on your code are relatively recent (of course, in this case 
> "relatively recent" still means over ten years ago...).  Since
> there's a lot of old perl code out there written before this,
> if you made use warnings the default, that code which had been
> running perfectly fine would suddenly start emitting warnings.
> This would make a lot of people unhappy...
> 

Hmm, maybe perl (the interpreter) could check the date on the file of 
Perl statements and adjust its behaviour accordingly?

e.g.
foo.pl has last modified date < 1/1/2006 : strict & warnings *off* 
unless specifically turned on.
foo.pl has last modified date >= 1/1/2006 : strict & warnings *on* 
unless specifically turned off.




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

Date: Sun, 06 Feb 2005 10:18:10 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: Why aren't 'warnings' on by default?
Message-Id: <C9mNd.149958$K7.139392@news-server.bigpond.net.au>

"RedGrittyBrick" <Red.Grittybrick@SpamWeary.Foo> wrote in message 
news:cu4qb8$q84$1@hercules.btinternet.com...
: Chris Mattern wrote:
: > mjl69 wrote:

<snip>

:
: Hmm, maybe perl (the interpreter) could check the date on the file of
: Perl statements and adjust its behaviour accordingly?
:
: e.g.
: foo.pl has last modified date < 1/1/2006 : strict & warnings *off*
: unless specifically turned on.
: foo.pl has last modified date >= 1/1/2006 : strict & warnings *on*
: unless specifically turned off.


So if I do a minor edit on an old program suddenly everything gets broken 
with no obvious reason?  If the interpreter/compiler changes behaviour based 
on the file date, imagine the difficulty in troubleshooting.  "All I did was 
copy the file from one place to another and now it has all these errors!"

P
-- 
print "Just another Perl Hacker"; 




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

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 7743
***************************************


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