in reply to Uninitialized value

 print 1 + ($junk && ($junk != 0) ? $junk : 0); Does that do what you want?