4:09pm, Ramprasad A Padmanabhan wrote:

> Paul Archer wrote:
> > Is there any (quick and easy) way to get a reverse range, like (10..1),
> > rather than a standard (1..10)? The catch is to *not* use 'reverse'.
> > I'm teaching Sun's perl course this week (DTP-250), and we were talking
> > about working on arrays. The book had an exercise that had the student
> > reverse an array by using pop (or shift, I don't remember). That section is
> > before we talk about 'reverse', and I thought you'd be able to do it like:
> > @array[0 .. $#array] = @array[$#array .. 0]
> > ...but of course, having the range count down doesn't work.
> >
> > Paul
>
> IMHO this list is not for solving puzzles or doing school homework , It
> is for people learning perl who are getting stuck due to pure perl problems
> If I wanted a range (10..1) I will use reverse and why not. If you have
> a better way tell me so that I can learn it
>

Actually, the description for this mailing list says "A list for beginning
Perl programmers to ask questions in a *friendly atmosphere*." (emphasis
added) I don't see anything about "No schoolwork", or "No puzzles"...

And the problem is not simply a puzzle, nor is it homework. If you had read
my post more carefully, you would see that I am 1) *teaching* the class, and
2) want to be able to show off one concept (the range operator) before we
have talked about another concept (the 'reverse' statement).

IM"H"O, if you want to be on a list that is "...for people learning perl who
are getting stuck due to pure perl problems..." then start one. I, on the
other hand, am staying here.

Paul

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to