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

L

Liora

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
 
P

Paul Lalli

Liora said:
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
 
J

J. Gleixner

Liora said:
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
 
L

Liora

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
 
T

Tad McClellan

Liora said:
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?



Probably because it is not a function.



Did you try that?



Or that?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top