Damian Conway wrote:

>    > Could a way be found to control the flow so that the next case (not always
>    > the one next in the order of the statment) could be executed? For example
>    > you have cases 1-10. You want all odd cases to also execute case 9 and the
>    > even cases to also execute case 10. So in case 3 you would say something
>    > like: pergo(9);
>
> Not necessary.
>
>         switch ($val) {
>                 case 3          { print "three"; goto odds }
>                 case 4          { print "three"; goto evens }
>
>           odds: case __%2!=0    { print "that's odd" }
>          evens: case __%2==0    { print "that's even" }
>         }

Does "goto odds" mean start evaluating all cases after the "odds:" label?  Meaning
that the below is equivalent to the above?  I think this is what the original
poster was asking; if not, I'd like to ask it!

     switch ($val) {
                case 3          { print "three"; goto morecases }
                case 4          { print "three"; goto morecases }

         morecases:
                 case __%2!=0    { print "that's odd" }
                 case __%2==0    { print "that's even" }
        }
--
Glenn
=====
There  are two kinds of people, those
who finish  what they start,  and  so
on...                 -- Robert Byrne


_______________________________________________
Why pay for something you could get for free?
NetZero provides FREE Internet Access and Email
http://www.netzero.net/download/index.html

Reply via email to