Yitzchak Scott-Thoennes writes that the code below does not
work if CREATE TABLE is repeated within 50 lines:

    || perl -ne 'print if /CREATE TABLE/ .. (++$c > 50)' nine-megs.txt

"perldoc perlop" says the left operand of ".." is not
evaluated while the operator is in the "true" state.
So, the re-occurrence of "CREATE TABLE" within the 50 lines
should not change anything.

I tried a simple example which seems to confirm this:

    || % perl -le 'print grep {/b/ .. (++$c > 5)} qw(a b c d a B c d)'
    || bcdaBc
    || % perl -le 'print grep {/b/ .. (++$c > 5)} qw(a b c d a b c d)'
    || bcdabc
    || %

The output stops at the second 'c' irrespective of whether 'b'
is repeated in the list.

Please correct me if I am mistaken.

peace,                              || Rainwater Harvesting in Karnataka:
--{kr.pA}                           || http://makeashorterlink.com/?J21521932
--
GAAP, n.: the reason for the gaap between the balance sheet and reality.

Reply via email to