in reply to Re: Any easy way to do this?
in thread Any easy way to do this?

Thanks Graf, i'll give this a try tonight or tomorrow.

Realistically, the user will likely specify thresholds between 1000 and 10,000 spaced by about 5000. So in all likelihood 1000, 5000 and 10000 are probably the only thresholds that this script will ever see, but I wanted to leave the user's options open.

You're probably right, and I should just hard-code a range of thresholds to be run by default and maybe provide an override to run the script using a single user-defined threshold.

Replies are listed 'Best First'.
Re^3: Any easy way to do this?
by graff (Chancellor) on Sep 16, 2011 at 00:17 UTC
    Note the correction to my code snippet -- if $i were lexically scoped in the "for" statement (as originally posted), it would be unavailable after exiting that loop.

      That must have been an ENOCOFFEE error! Consider:

      use strict; use warnings; my $i = "Nothing to see here, move along\n"; for $i (1 .. 3) { print "$i "; } print $i;

      Prints:

      1 2 3 Nothing to see here, move along

      The for loop variable is aliased to the elements in the for list. Any global (to the loop) variable that happens to have the same name is unaffected by the loop and, in particular, does not end up with the last contents of the loop variable!

      True laziness is hard work