exiting from do

Discussion in 'Perl Misc' started by chatiman, Feb 24, 2004.

  1. chatiman

    chatiman Guest

    Hello,

    According to the "perldoc -f last" page it is not possible to exit from a
    "do" loop with last.

    How can I do that so ?
     
    chatiman, Feb 24, 2004
    #1
    1. Advertising

  2. ----- Original Message -----
    From: "chatiman" <>
    Newsgroups: comp.lang.perl.misc
    Sent: Tuesday, February 24, 2004 10:36 AM
    Subject: exiting from do


    > Hello,
    >
    > According to the "perldoc -f last" page it is not possible to exit from a
    > "do" loop with last.
    >
    > How can I do that so ?
    >
    >


    LOOP: {
    do {
    last if $x = $y**2;
    # do something here
    } while $x++ <= $z;
    }

    emulates the "last" command.

    See "perldoc perlsyn" for more details.

    Regards,
    --
    Dave Cardwell
    http://dave.blubbernet.com
     
    Dave Cardwell, Feb 24, 2004
    #2
    1. Advertising

  3. chatiman

    Tore Aursand Guest

    On Tue, 24 Feb 2004 11:36:52 +0100, chatiman wrote:
    > According to the "perldoc -f last" page it is not possible to exit from a
    > "do" loop with last.
    >
    > How can I do that so ?


    According to the 'perldoc -f last' page, you can't. You said it yourself
    two line breaks ago, remember?

    Show us your code, and I'm sure we'll be able to rewrite it so that you it
    works as it should.


    --
    Tore Aursand <>
    "Out of missiles. Out of bullets. Down to harsh language." -- Unknown
     
    Tore Aursand, Feb 24, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jiten

    exiting from state machine

    jiten, Jun 22, 2005, in forum: VHDL
    Replies:
    3
    Views:
    492
  2. Anne
    Replies:
    0
    Views:
    366
  3. =?Utf-8?B?Qm9uag==?=

    problem with aspnet exiting

    =?Utf-8?B?Qm9uag==?=, Nov 11, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    345
  4. =?Utf-8?B?YmJkb2J1ZGR5?=

    Exiting an ASP.net application

    =?Utf-8?B?YmJkb2J1ZGR5?=, Jun 24, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    531
    samitha
    Sep 21, 2006
  5. BrainC
    Replies:
    8
    Views:
    2,212
    JustSomeGuy
    Sep 11, 2003
Loading...

Share This Page