Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how important is 'use warnings' ?

Status
Not open for further replies.

spookie

Programmer
May 30, 2001
655
IN
Hi,
As strict pragma is recommended and should be included in perl file, i am wondering if 'use warnings' is as recommended as strict.

Your opinion ?

--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
There are two methods of turning on warnings:
Code:
#!/usr/bin/perl -w
or
Code:
#!/usr/bin/perl
use warnings;
The second method allows you to temporarily turn off warnings if necessary for parts of your program (similar to the way you can temporarily disable strict checking too).

I always recommend using warnings just like using strict. Again it can require a little more effort in writing your programs to avoid throwing warnings but it does cause you to write better, more robust code as a result. I always enable it for everything other than one-liners.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top