Perl Version Issue?

J

Jason Crowther

I've stumbled across a little strangeness when we had to do an
emergency upgrade from perl 5.6.0 to perl 5.8.0.

I have some code that works fine under 5.6.0 but goes down in flames
in 5.8.0. the error I'm getting is "Can't find label...".

I can replicate this issue with two simple files:


test.pl:
#!/usr/bin/perl
print "test 1\n";
goto SKIP;
print "test 2\n";
SKIP:
print "test 3\n";
1;

caller.pl:
#!/usr/bin/perl
require 'test.pl';
exit 0;


here's what you get when you run these on 5.6.0:

$ ./test.pl
test 1
test 3
$ ./caller.pl
test 1
test 3

here's what happens on 5.8.0:

$ ./test.pl
test 1
test 3
$ ./caller.pl
test 1
Can't find label SKIP at test.pl line 5.
Compilation failed in require at ./caller.pl line 2.


I'm not sure what could be causing the problem. is this a bug or new
default perl behavior? I couldn't find any relavent previous posts.

thanks for any help!

ps. I know that goto's are evil to begin with! I'm slowly but surely
working the goto's out this historical code... ;-)
 
T

Tore Aursand

I've stumbled across a little strangeness when we had to do an emergency
upgrade from perl 5.6.0 to perl 5.8.0.
[...]

I had no problem running the code posted on Perl 5.8.2. Seems like it
must be a bug of some sort...?
 
K

Kirk Strauser

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
#!/usr/bin/perl

You forgot the "-w" and "use strict;". Add those and see if it gives you
additional warnings.
- --
Kirk Strauser
The Strauser Group
Open. Solutions. Simple.
http://www.strausergroup.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAcvam5sRg+Y0CpvERAlmBAJ9hCdjaM5y9dYxsWoIP4P0ZSKxk1wCdHhQB
mrfN09uRfxEU4wrqEvYca7s=
=TyVP
-----END PGP SIGNATURE-----
 
J

Joe Smith

Kirk said:
You forgot the "-w" and "use strict;". Add those and see if it gives you
additional warnings.

Absolutely no change.

Fails with 5.8.0, works with 5.8.3; bug fixed.
-Joe
 

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,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top