Thread: case statements

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    112
    Rep Power
    15
    is it possible to write case statements in Perl ??

    if so do you know the syntax ?

    ie

    case (x)
    do y
    case (z)
    do A

    etc,

    similar to a switch statement in PHP

    thanks in advance

    Waseem
  2. #2
  3. No Profile Picture
    RyanP
    Guest
    Devshed Newbie (0 - 499 posts)
    i don't think the switch conditional exists in perl, just have to use if/else
  4. #3
  5. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    yea ,you can't use case statements in perl..
    you should use 'if ...elsif' for conditions....


    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."

IMN logo majestic logo threadwatch logo seochat tools logo