SPUG: Slice of an arrary within a hash?

Christopher Maujean ChrisM at courtlink.com
Fri May 5 20:10:07 CDT 2000


On the other hand, I always use 
-w 
and 
use strict;

I code to fit them both and have far fewer problems 
than I used to. There are (very very) few and far 
between cases where I explicitly need to turn off 
strict ref's or subs, etc for a small block of code, 
but I make sure I have a very good reason, I heavily 
document that reason in the code and turn full strict 
back on immediatly after that block.

If a module can't pass strict and -w  I won't be using it 
in production code. I try to write every program as if it were 
to be used by paying customers who will judge me by it. 

--Christopher Maujean 
***NOT representing Courtlink or Data West Corporation in any way shape or
form.***


-----Original Message-----
From: Joel [mailto:largest at largest.org]
Sent: Friday, May 05, 2000 4:56 PM
To: spug-list at pm.org
Subject: Re: SPUG: Slice of an arrary within a hash?


> ced at carios2.ca.boeing.com wrote
>
> #!/usr/bin/perl -w
>                 ^^^^^^
>                 ^^^^^^
>    # enable warnings above. See -w 
>    # in action below: 


<$0.02>

-w is a great tool, but I don't put it in the shebang line of my perl
scripts.  This is because it turns on warnings for *all* Perl involved in
the script, which includes all use'd modules and all modules the use'd
modules use, and so on.  Also, it will sometimes warn me about things that
I know are okay.

You can turn off the warnings temporarily by local'izing the $^W variable
around code you know might generate a warning.  But at work there are some
older modules that are crufty and generate lots of (allowable) warnings.  
So I get tired of reading a page of warnings I already know about every
time I run the script.  (yes I realize someone should go fix the old
modules :-)

My solution?  When I'm stumped on a debug or want to verify my code before
checking into production, I run

 perl -cw myscript

which shows me the warnings.

</$0.02>

Joel


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe
           Email to majordomo at pm.org: "action" spug-list your_address


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe
           Email to majordomo at pm.org: "action" spug-list your_address





More information about the spug-list mailing list