Testing Perl Code – Suppressing Warnings

A lot of developers I have worked with have been amazed to see that I expand a suite of tests they developed by a factor of four. This is almost always because I am stressing error handling which is often not tested at all. Unfortunately, these tests will often cause many warnings. Sometimes I want to verify the exact warning. Other times it just clutters the output being sent to the screen. This can be very dangerous – it may lead someone running the test to believe there is a newly introduced bug.

Luckily, perl has a well defined mechanism for overriding the warn behavior. If you want to suppress warnings from being displayed in a section of tests do the following:

    • Scope the section of code where you want to suppress the warnings:
      { ... }
      Define your own warning handler inside the scoped code:

      {
           local $SIG{__WARN__}=sub{}; #Temporarily suppress warnings

           # Insert test code here
      }

  • Once the scoping ends, whatever warning handler was in effect before will be active again.

     

    VMWorld 2008 Call for Papers

    One of the best conferences I have ever attended was the 2007 VMWorld conference held in San Francisco. Part of this was probably because I was new to VMWare. The quantity and quality of the information shared was uniformly high. For a vendor sponsored conference, this is saying a lot.

    However, most of the sessions I attended were presented by VMWare employees. I would like to see more user based presentations. In particular, VMWare experiences outside of the standard server consolidation usage pattern. With this being said, VMWare has issued a Call for Papers for the 2008 VMWorld to be held in Las Vegas on September 15-18, 2008.

     

    Job Candidates and HTML Validation

    I review a lot of resumes. In the majority of the cases there is a web site mentioned on the resume. I don’t look at the website unless I am going to interview the person (phone or in person). In most cases, the website has not been updated for quite some time and I wonder why the person included it on their resume. In some cases, the web site is of a strictly personal nature and once again I wonder why they want a propspective employer to look at it. Then there are the cases where the website is relevant to the person’s professional interests and is current.

    One of these resume/websites came across my desk recently. It was a rather plain looking site but had good, relevant content. The person stated clearly his belief in web standards. He even included the W3C button that allows the pages HTML to be validated against whatever HTML version is specified in the DOCTYPE tag. I click on the button – the page fails validation. Not a good impression to set with a prospective employer.

    Hint to job seekers – If you have a HTML validation link on a page, make sure the page passes validation.