Posts tagged ‘amusing’

When you use perl or similar scripting language, and use variable to store command-line parameter, and then test that variable to check if parameter was passed or not, beware of

if ($param) {
    ... #param was passed
}

Think what happens if $param is “0″ string. And use if (defined($param)) instead.

That happened to be the reason why dpkg-buildpackage ignored -v0 flag. And when you discover that through pdebuild that does not process --debbuildopts “-sa -v0″ properly, you will first think that pdebuild once again has issues with passing multiple arguments to underlying tools, and spend your time looking in wrong direction…