Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default goto command

    Does perl have a goto command. For example if you tell scrip to do
    something and it returns a 1 then it should go to a block of code that
    does something else.

    Thanks,
    Thomas Browner



    Thomas Browner Guest

  2. Similar Questions and Discussions

    1. play next 5 frames and then GoTo
      Hi there I have a button, which when clicked I want to continue playing the movie for an additional 5 frames, then go to the desired location. I...
    2. goto frame in another scene
      Hi, What am I doing wrong this time? I try to load a movie into a placeholder and goto the first frame of the second scene. var layout =...
    3. LoadMovie vs goto Scene
      Hi, all. I'm pretty new to Flash, using MX. Please help me understand loading movies as opposed to loading scenes. I understand that they are...
    4. goto net page [Please Help]
      Sure, Lingo doesn't do that. The gotoNetPage() function only allows for two arguments, the URL and the target. Further, you'll probably find that...
    5. what is the command for goto marker?
      just a quick one, I am very tired and have forgotten the command for goto marker on mouseUp goto "quit" -- or am i really asleep end I...
  3. #2

    Default RE: goto command

    Sub dothissubroutine {
    Do something
    If return this
    Else return this
    }

    My $result = &dothissubroutine
    If $result = this
    }elsif
    This
    }else{
    This
    }



    Paul Kraus
    -----------------------
    PEL Supply Company
    Network Administrator
    > -----Original Message-----
    > From: Thomas Browner [mailto:thomas.browner@digidyne.com]
    > Sent: Thursday, January 29, 2004 12:46 PM
    > To: [email]beginners@perl.org[/email]
    > Subject: goto command
    >
    > Does perl have a goto command. For example if you tell scrip to do
    > something and it returns a 1 then it should go to a block of code that
    > does something else.
    >
    > Thanks,
    > Thomas Browner
    >
    >
    >
    >
    > --
    > To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
    > For additional commands, e-mail: [email]beginners-help@perl.org[/email]
    > <http://learn.perl.org/> <http://learn.perl.org/first-response>

    Paul Kraus Guest

  4. #3

    Default Re: goto command

    Thomas Browner wrote:
    >
    > Does perl have a goto command. For example if you tell scrip to do
    > something and it returns a 1 then it should go to a block of code that
    > does something else.
    Yes. But I've never seen a case where I think it should be used.

    Perl isn't a scripting language. (Although it can be, just like
    it can be most things.)

    If you want help, then please explain what you're trying to do. Then
    we will explain how.

    Rob


    Rob Dixon Guest

  5. #4

    Default Re: goto command

    For Quality purpouses, Thomas Browner 's mail on Thursday 29 January 2004
    18:46 may have been monitored or recorded as:
    > Does perl have a goto command. For example if you tell scrip to do
    > something and it returns a 1 then it should go to a block of code that
    > does something else.
    Not talking about style (but in the TIMTOWTDI spirit):

    from perldoc -f goto:

    goto LABEL
    goto EXPR
    goto &NAME
    The "goto-LABEL" form finds the statement labeled
    with LABEL and resumes execution there. It may
    not be used to go into any construct that requires
    initialization, such as a subroutine or a "fore-
    ach" loop. It also can't be used to go into a
    construct that is optimized away, or to get out of
    a block or subroutine given to "sort". It can be
    used to go almost anywhere else within the dynamic
    scope, including out of subroutines, but it's usu-
    ally better to use some other construct such as
    "last" or "die". The author of Perl has never
    felt the need to use this form of "goto" (in Perl,
    that is--C is another matter). (The difference
    being that C does not offer named loops combined
    with loop control. Perl does, and this replaces
    most structured uses of "goto" in other lan-
    guages.)

    hth, wolf

    Wolf Blaum Guest

  6. #5

    Default Re: goto command

    The reason why the goto command is not generally used in perl (and other
    languages) is that it does not force the developer to have a theoretical
    framework for the program. It creates 'spagetti code' where a person working
    on the code or trying to understand what the developer has done has to
    follow a rabbit tunnel of goto directions. A direct alternative is using sub
    procedures which not only perform the same goto like movement, but can use
    parameters and return values as well.

    "Thomas Browner" <thomas.browner@digidyne.com> wrote in message
    news:002501c3e68f$cde84910$080a19ac@digidyne.com.. .
    > Does perl have a goto command. For example if you tell scrip to do
    > something and it returns a 1 then it should go to a block of code that
    > does something else.
    >
    > Thanks,
    > Thomas Browner
    >
    >
    >

    Noah Ganter Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139