Konrad Borowski wrote: >I checked. For some reason, subroutine or `do` block ending with `while` block >or `for` block always returns empty string The standard false value is an empty string. The last thing evaluated by a while statement is the condition that comes up false to cause termination of the loop. The return value is normally the actual false value used: $ perl -lwe 'print do { while($_) {} } // "undef" for 0, undef' 0 undef but it wasn't always thus when constant folding got involved: $ perl5.16.3 -lwe 'print do { while(0) {} } // "undef"' undef $ perl5.18.1 -lwe 'print do { while(0) {} } // "undef"' 0 -zeframThread Previous | Thread Next