in reply to Re: Can It Be Written In Base X With Only 1s And 0s
in thread Can It Be Written In Base X With Only 1s And 0s

What is interesting is that on line 17, $_ is 2 different entities:
for( 3 .. $N ) { ++$tests{ $_ } for gen( $_, $LIMIT ); }

-QM
--
Quantum Mechanics: The dreams stuff is made of

Replies are listed 'Best First'.
Re^3: Can It Be Written In Base X With Only 1s And 0s
by BrowserUk (Patriarch) on Jun 16, 2015 at 10:50 UTC
    What is interesting is that on line 17, $_ is 2 different entities:

    Yes, but both are distinct at their point of use.

    It's a trick -- if you want to call it that -- that I learned a long time ago from Merlyn. Same variable name but two different scopes in a single line.

    The value from the outer for loop is passed into gen() and that must be executed before the list is available to the inner for loop, so there is no conflict.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked