Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl 5.00404 - Label not found for "next " , next() function

Reply
Thread Tools

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

 
 
Liora
Guest
Posts: n/a
 
      01-11-2007
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

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      01-11-2007
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

 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      01-11-2007
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
 
Reply With Quote
 
Liora
Guest
Posts: n/a
 
      01-11-2007
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


 
Reply With Quote
 
Liora
Guest
Posts: n/a
 
      01-11-2007
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


 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      01-12-2007
Liora <(E-Mail Removed)> 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
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dll config and web.config and Label Expressions (binding label text to dll config settings) CSharpner ASP .Net 0 04-09-2007 09:00 PM
How to get/read Hard disk label / drive label Praveen Python 1 11-05-2006 07:48 PM
install_driver(Oracle) failed: Can't load 'C:/Perl/site/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle: load_file:The specified procedure could not be found at C:/Perl/lib/DynaLoader.pm line 230. Feyruz Perl Misc 4 10-14-2005 06:47 PM
<label><div></div></label> allowed? Josef K. ASP .Net 3 05-22-2005 02:13 PM
label versus asp:label Question. Thanks. Shapper ASP .Net 2 05-07-2005 05:55 AM



Advertisments