Hi, @normal = (0,1,2,3,4,5,6,7,8,9); foreach (0..$#normal) { unshift @reverse, (shift @normal) };
this also works fine. Michel -----Message d'origine----- De: Paul Archer [mailto:[EMAIL PROTECTED] Date: mardi 26 août 2003 21:45 À: [EMAIL PROTECTED] Objet: reverse range (10..1) 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 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]