in reply to Stringifying undefs
perl -e '$_=shift;print(defined$_?$_:0)' [download]
perl -e '$_=shift;print(/^$/?0:$_)' [download]