in reply to RE question...yup, another one ;)

Okay... well, since you don't want a direct answer, I will give you an answer in a black box that you don't have to read, and then I will give you a clue.

A regex is *way* too big a tool for this job.

print $_ % 10, "\n" for 0..300;

Here's your hint: think of a mathematical operator that might do what you want here. It's in perlop, under Multiplicative Operators.

Replies are listed 'Best First'.
Re: Re: RE question...yup, another one ;)
by Anonymous Monk on May 27, 2001 at 00:31 UTC
    For the solution above, btrott, I believe you have it wrong. What happens when you get to 300? It prints 3000. Not the desired result; but I think I see where you are going with this. . . so here goes a quick attempt.
    print $_ . "-->" . $_ % 10 for 0..300
      It doesn't print 3000 when I run the program. Your solution that you posted looks exactly the same as mine, except you print out the $_ and the '-->'. What is the difference?

      What version of perl are you running where it prints 3000?

        My mistake. In the black box your % looked like *.
      3000? doh!

      "Argument is futile - you will be ignorralated!"