in reply to Re^5: printing unitialized value of the 'do BLOCK'
in thread printing unitialized value of the 'do BLOCK'

Thanks, now I understand the difference: in the first case '()' wanted in scalar context which was forced by 'if' (so it becomes an undefined value).

Added:
An 'if' forces scalar context as 'and' do, so it may be that these two are internally implemented the same.
  • Comment on Re^6: printing unitialized value of the 'do BLOCK'