Loading ...
Sorry, an error occurred while loading the content.
 

Réf. : Re: [PBML] case/switch?

Expand Messages
  • Olivier-Bernard RICHARD
    ... And IMHO far from being as easily readable as a clear and tabulated list of if elsif else =) #!ozh
    Message 1 of 1 , Sep 27, 2000
      >Perl has no switch or case statement per se, but see p. 103 of
      >Programming Perl, 2nd edition (the camel book) for several examples of
      >simulating a switch statement. Eg.,
      >
      > SWITCH: {
      > /^abc/ && do {
      > $abc = 1;
      > last SWITCH;
      > };
      > /^def/ && do {
      > $def = 1;
      > last SWITCH;
      > };
      > /^xyz/ && do {
      > $xyz = 1;
      > last SWITCH;
      > };
      > $nothing = 1;
      > }
      >
      >hth...
      >Tom

      And IMHO far from being as easily readable as a clear and tabulated list of "if elsif else" =)


      #!ozh
    Your message has been successfully submitted and would be delivered to recipients shortly.