Perl 5.00404 - Label not found for "next " , next() function

Discussion in 'Perl Misc' started by Liora, Jan 11, 2007.

  1. Liora

    Liora Guest

    I am running a perl sript that has the next() function, but some of my
    systems can not find the function next() :

    this is the error

    Label not found for "next "

    I checked the list of functions for 5.00404, and next() is build in.

    Any idea why perl can not see this function?

    Thanks,
    Liora
     
    Liora, Jan 11, 2007
    #1
    1. Advertising

  2. Liora

    Paul Lalli Guest

    Liora wrote:
    > I am running a perl sript that has the next() function


    next is not a function. It's a control loop modifier.

    >, but some of my systems can not find the function next() :


    Yes they can.

    > this is the error
    >
    > Label not found for "next "


    Uh-huh. And what makes you think that means it can't find next? It
    very specifically says that it's the label that can't be found.

    > I checked the list of functions for 5.00404, and next() is build in.


    Is there any particular reason you're using such an ancient version of
    Perl?

    > Any idea why perl can not see this function?


    Please read the built in Perl documentation for all the error messages,
    `perldoc perldiag`. Or simply add the line:
    use diagnostics;
    to the beginning of your program. You will see the following text
    printed out:

    Label not found for "next %s"
    (F) You named a loop to continue, but you're not
    currently in a loop of that name, not even if you count
    where you were called from. See "last" in perlfunc.

    So clearly you're doing something wrong. Unfortunately, you haven't
    shown any code that would let us help you fix it.

    Paul Lalli
     
    Paul Lalli, Jan 11, 2007
    #2
    1. Advertising

  3. Liora

    J. Gleixner Guest

    Liora wrote:
    > I am running a perl sript that has the next() function, but some of my
    > systems can not find the function next() :
    >
    > this is the error
    >
    > Label not found for "next "
    >
    > I checked the list of functions for 5.00404, and next() is build in.
    >
    > Any idea why perl can not see this function?


    Post an example. Also, it's 'next;', not 'next();'.

    perldoc -f next
     
    J. Gleixner, Jan 11, 2007
    #3
  4. Liora

    Liora Guest

    Paul,

    Thanks for your reaply, I am new at posting.
    this is a script, I did not write, but it is running on most systems I
    installed it on.

    Here is the code:

    open (NETFILE, "$NETSTAT |") ;

    while (<NETFILE>) {

    chomp $_ ;
    $LINE = $_ ;

    if (( $LINE =~ /Name/ ) || ( $LINE =~ /^$/ )) {
    next() ;
    }
    else {
    @DevLine = split (/\s+/, $LINE) ;
    }

    $Intf = $DevLine[0] ;
    $Mtu = $DevLine[1] ;
    $NetDest = $DevLine[2] ;
    $NetDest =~ s/\..*//g ;
    $Address = $DevLine[3] ;
    $Address =~ s/\..*//g ;
    $Ipkts = $DevLine[4] ;
    $Ierrs = $DevLine[5] ;
    $Opkts = $DevLine[6] ;
    $Oerrs = $DevLine[7] ;
    $Colls = $DevLine[8] ;

    ## print "$Intf $Mtu $NetDest $NetDest $Ipkts $Ierrs $Opkts
    $Oerrs $Colls
    0\n" ;
    printf "%-6s%-6s%-20s%-20s%-12s%-12s%-12s%-6s%-8s%-5s\n", $Intf, $Mtu,
    $NetDest,
    $NetDest, $Ipkts, $Ierrs, $Opkts, $Oerrs, $Colls, 0 ;

    }

    Thanks,
    Liora

    Paul Lalli wrote:
    > Liora wrote:
    > > I am running a perl sript that has the next() function

    >
    > next is not a function. It's a control loop modifier.
    >
    > >, but some of my systems can not find the function next() :

    >
    > Yes they can.
    >
    > > this is the error
    > >
    > > Label not found for "next "

    >
    > Uh-huh. And what makes you think that means it can't find next? It
    > very specifically says that it's the label that can't be found.
    >
    > > I checked the list of functions for 5.00404, and next() is build in.

    >
    > Is there any particular reason you're using such an ancient version of
    > Perl?
    >
    > > Any idea why perl can not see this function?

    >
    > Please read the built in Perl documentation for all the error messages,
    > `perldoc perldiag`. Or simply add the line:
    > use diagnostics;
    > to the beginning of your program. You will see the following text
    > printed out:
    >
    > Label not found for "next %s"
    > (F) You named a loop to continue, but you're not
    > currently in a loop of that name, not even if you count
    > where you were called from. See "last" in perlfunc.
    >
    > So clearly you're doing something wrong. Unfortunately, you haven't
    > shown any code that would let us help you fix it.
    >
    > Paul Lalli
     
    Liora, Jan 11, 2007
    #4
  5. Liora

    Liora Guest

    J.

    Do I have any environment variables set before I run perl?

    Thanks,
    Liora

    J. Gleixner wrote:
    > Liora wrote:
    > > I am running a perl sript that has the next() function, but some of my
    > > systems can not find the function next() :
    > >
    > > this is the error
    > >
    > > Label not found for "next "
    > >
    > > I checked the list of functions for 5.00404, and next() is build in.
    > >
    > > Any idea why perl can not see this function?

    >
    > Post an example. Also, it's 'next;', not 'next();'.
    >
    > perldoc -f next
     
    Liora, Jan 11, 2007
    #5
  6. Liora <> wrote:

    > Do I have any environment variables set before I run perl?



    We do not have access to your environment.

    You do have access to your environment.

    Who do you suppose has a better chance of knowing what is
    in your environment?


    >> > Any idea why perl can not see this function?



    Probably because it is not a function.


    >> Also, it's 'next;', not 'next();'.



    Did you try that?


    >> perldoc -f next



    Or that?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Jan 12, 2007
    #6
    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. William Parker
    Replies:
    1
    Views:
    3,107
    Martin
    Jun 27, 2004
  2. Deniz Bahar
    Replies:
    2
    Views:
    490
    Andrey Tarasevich
    Mar 9, 2005
  3. Tad McClellan
    Replies:
    3
    Views:
    160
    Edward Wijaya
    May 13, 2004
  4. usaims

    or, || not working with next LABEL

    usaims, Aug 9, 2007, in forum: Perl Misc
    Replies:
    1
    Views:
    99
    Martijn Lievaart
    Aug 10, 2007
  5. Knut Krueger
    Replies:
    8
    Views:
    293
    Knut Krueger
    Aug 20, 2013
Loading...

Share This Page