Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: How come undef eq '' ??

by tmharish (Friar)
on Jan 30, 2013 at 12:13 UTC ( #1016106=note: print w/replies, xml ) Need Help??

in reply to Re: How come undef eq '' ??
in thread How come undef eq '' ??

Guess the essence is:

Unless you really know how Perl works ... use strict; use warnings;

Thanks for the link

Replies are listed 'Best First'.
Re^3: How come undef eq '' ??
by uG (Scribe) on Jan 30, 2013 at 19:32 UTC
    I thought 'use warnings' was discouraged for published modules? I've always added it for development, but removed for distribution.

      perlmodlib begs to differ:

      Try to use warnings; (or use warnings qw(...); ). Remember that you can add no warnings qw(...); to individual blocks of code that need less warnings.

        Effective Perl Programming, Chapter 11 has a small section titled 'Warnings in production.'

        The reasoning seems to be as follows:

      • Run time warnings impose a small speed penalty
      • - Probably not a problem
      • Warnings are meant to be seen by developers, not users
      • - Seems reasonable
      • Warnings change between versions of perl
      • - Some might feel new warnings popping up is a 'good thing'

        I could have swore i've read similar arguments in another book, but I can't find it. Its interesting that perlmodlib suggests to always 'use warnings' as this conflicts with what i've read.

        Edit: Found it. Perl Best Practices says: "Note that it may still be appropriate to comment out the use warnings line when your application or module is deployed, especially if non-technical users will interact with it, or if it will run in a CGI or other embedded environment. Issuing warnings in these contexts can needlessly alarm users, or cause server errors."

        Edit2: And again. Mastering Perl says (footnote 34) In general, I recommend turning off warnings once a program is in production. Turn on warnings when you need to test or debug the program, but after that, you don't need them. The warnings will just fill up log files.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016106]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2018-09-25 13:44 GMT
Find Nodes?
    Voting Booth?
    Eventually, "covfefe" will come to mean:

    Results (199 votes). Check out past polls.

    • (Sep 10, 2018 at 18:53 UTC) Welcome new users!