Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
strict in TPL
System
Maybe I'm just a crapy coder but use strict seems to help me find a lot of issues in my code. It drives me nuts that putting use strict in a presentation template makes me see all the bugs in Interwoven's code. Is there anyway to use strict/warnings only for my code and subroutines but have it ignore all of the bugs in Interwoven's code?
Find more posts tagged with
Comments
gzevin
I was told Jon **** had to bend some rules - hence no strict for you!
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Migrateduser
I really don't think that's acceptable. I try to follow best programming practices (hard as it may be in Perl). I think Interwoven should clean the code.
gzevin
try to raise a FR for it
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Migrateduser
I think Interwoven should clean up the documentation, too. Pass me some of that crack you're smoking, John...
Dave Smith
Sr. Software Engineer
Nike, Inc.
(503) 671-4238
DavidH.Smith@nike.com
gzevin
I think we'll all need that crack with the release of 6.1 .. John, keep it coming
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Migrateduser
Hmmm, over 1,000 enterprise customers passing hundreds of MB of data through a rickety piece of code that generates compiler warnings/errors, and I'm on crack for hoping a company that supposedly has millions of dollars cash might fix it? I am in the wrong business. It's surely a good think Interwoven doesn't build controllers for nuclear reactors, hospital equipment, etc.!
nipper
While I appreciate the humor in this thread, it is rather painful here as well.
We have a couple triggers & daemons that run so the errors get pushed to /var/adm/logs (or something like that). I got
smacked down by a sys admin type since we were filling it up with warnings. This was code written by an IW
consultant & he put the use strict in there. I had to take it out. One would think IW consultants would know better
than that.
but then Smitty was a consultant so maybe not.....
Andy
gzevin
the humour lets you forget the pain and smile while you are being operated on
Greg Zevin, Ph.D. Comp. Sc.
Independent Interwoven Consultant/Architect
Sydney, AU
Adam Stoller
You could try using the pragma
no warnings
perhaps with something like this:
eval ("{ no warnings; use some_module; }");
I think that will allow you to turn off warnings for any of the code within the use'd module.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
Migrateduser
I'm not sure I follow. It's not my modules that throw the warnings, it's modules that are provided by Interwoven that appear to be included (or sometimes inline'd!) before my TPL code is every called. If I include a second use of these modules (not sure how I would know which ones) with warnings disabled, will that override any warning configuration already defined for those modules?
Adam Stoller
I don't think that will help - no. I wasn't thinking about behind-the-scenes inclusion of modules with regard to that directive, sorry.
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com
laj1
Is there anyway to use strict/warnings only for my code and subroutines but have it ignore all of the bugs in Interwoven's code?
Yes. Try this.
use strict; # turns on strictness
my wonderful clean non-warning-generating code;
no strict; # turns of strictness
their dodgy bits;
use strict;
my code again;
no strict;
more hazerai and dreck;
Len.
Len Jaffe
LenJaffe@JaffeSystems.com
My Heart Is A Flower
Adam Stoller
FYI - when you get to TS6.1, which uses Perl 5.8.2 (yee ha!) change your code from using the '
-w
' on the shebang line to using the pragma:
use warnings
I recently picked up a new [to me] Addison/Wesley book called
Perl Medic - Transforming Legacy Code
by
Peter J. Scott
and it has a lot of interesting information in it (
at least to me
) - in this case, from p. 118:
5.4.1
use warnings
vs. Modules
Because of the lexical scoping,
use warnings
will not propagate its effect to modules you use (whereas
-w
does). In your own modules, add
use warnings
near the top. Other people's modules may or may not be so enlightened. Now, it's really the module author's business and responsibility to make their code warnings-safe, but sometimes the author of a module you are using may not have put a
use warnings
statement in it.
however a bit further down it does say
Therfore,
for maximum safety when using third-party modules, add the
-w
flag to your shebang line.
As regressive as this may sound, it will ensure that you see every warning that you can.
My take on this is that you should
use warnings
in modules you write and then use the
-w
flag in scripts until/unless you find it generating warnings from code you have no control over (and where the warnings are not a reflection of improper usage on your part) - and then switch your script to
use warnings
to restrict the veribage to your own code.
Something to think about...
--fish
Senior Consultant, Quotient Inc.
http://www.quotient-inc.com