DelphiFAQ Home Search:
General :: Programming :: perl
General questions about perl.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

Temporarily turn off warnings in perl (older version)

Question:

How can I turn off warnings for a part of my perl code? I read about a pragma use warnings and no warnings but this is not available because I use an older version of perl.

Answer:

Pragma 'warning' was introduced with perl 5.6.0
You can use the code shown below instead:

{
   # we have to turn off warnings for this one call
   local $^W = 0;
 
   # ..
   # offensive code now
   # ..
 
   # automatically restore warning settings as you leave the block
 }
 

Generated 16:01:56 on Jun 20, 2018