Help for this page

Select Code to Download


  1. or download this
            if     ($x == 1) { $abc = 1 }
            elsif ($x == 2) { $def = 1 }
            elsif ($x == 3) { $xyz = 1 }
            else                  { $nothing = 1 }
    
  2. or download this
        SWITCH: {
            if ($x == 1)    { $abc = 1; last SWITCH; };
    ...
            if ($x == 3)    { $xyz = 1; last SWITCH; };
            $nothing = 1;
        }
    
  3. or download this
        SWITCH: for ($x) {
            if (1)    { $abc = 1; last SWITCH; };
    ...
            if (3)    { $xyz = 1; last SWITCH; };
            $nothing = 1;
        }