Click here to get back home

Re: very strange bug (in perl?)

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Re: very strange bug (in perl?) Ben Bullock 03-19-2008
Posted by Ben Bullock on March 19, 2008, 8:02 pm
Please log in for more thread options
On Wed, 19 Mar 2008 16:41:19 -0700, dummy wrote:

> Please don't sneer and laugh, but I think I've found a bug in perl
> itself.

I am using Perl on linux:

ben ~ 525 $ perl --version

This is perl, v5.10.0 built for i686-linux

I changed only the top line of your program to "#!/usr/bin/perl" and the
output was as follows:

ben ~ 524 $ ./bug.pl
Semicolon seems to be missing at ./bug.pl line 25.
"my" variable $q masks earlier declaration in same scope at ./bug.pl line
28.
"my" variable $q masks earlier declaration in same scope at ./bug.pl line
29.
"my" variable $q masks earlier declaration in same scope at ./bug.pl line
30.
"my" variable @in masks earlier declaration in same scope at ./bug.pl
line 32.
"my" variable @in masks earlier declaration in same scope at ./bug.pl
line 34.
"my" variable $q masks earlier declaration in same scope at ./bug.pl line
34.
"my" variable %ow masks earlier declaration in same scope at ./bug.pl
line 61.
"state" variable @_ masks earlier declaration in same scope at ./bug.pl
line 77.
syntax error at ./bug.pl line 26, near ") # works if i comment out this
line and put 'my' below -+
# print "old\n"; |
# display(); |
INPUT"
syntax error at ./bug.pl line 56, near "}"
Can't use global @_ in "my" at ./bug.pl line 68, near "= @_"
syntax error at ./bug.pl line 74, near "}"
Can't use global @_ in "my" at ./bug.pl line 77, near "= @_"
BEGIN not safe after errors--compilation aborted at ./bug.pl line 78.

I think some people might be tempted to laugh.

Posted by Gunnar Hjalmarsson on March 19, 2008, 8:37 pm
Please log in for more thread options
Ben Bullock wrote:
> I changed only the top line of your program to "#!/usr/bin/perl" and the
> output was as follows:
>
> ben ~ 524 $ ./bug.pl
> Semicolon seems to be missing at ./bug.pl line 25.
> "my" variable $q masks earlier declaration in same scope at ./bug.pl line
> 28.
> "my" variable $q masks earlier declaration in same scope at ./bug.pl line
> 29.
> "my" variable $q masks earlier declaration in same scope at ./bug.pl line
> 30.
> "my" variable @in masks earlier declaration in same scope at ./bug.pl
> line 32.
> "my" variable @in masks earlier declaration in same scope at ./bug.pl
> line 34.
> "my" variable $q masks earlier declaration in same scope at ./bug.pl line
> 34.
> "my" variable %ow masks earlier declaration in same scope at ./bug.pl
> line 61.
> "state" variable @_ masks earlier declaration in same scope at ./bug.pl
> line 77.
> syntax error at ./bug.pl line 26, near ") # works if i comment out this
> line and put 'my' below -+
> # print "old\n"; |
> # display(); |
> INPUT"
> syntax error at ./bug.pl line 56, near "}"
> Can't use global @_ in "my" at ./bug.pl line 68, near "= @_"
> syntax error at ./bug.pl line 74, near "}"
> Can't use global @_ in "my" at ./bug.pl line 77, near "= @_"
> BEGIN not safe after errors--compilation aborted at ./bug.pl line 78.
>
> I think some people might be tempted to laugh.

That's not fair. By just adding the missing semicolon, as the first
error message mentions, the code compiles.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Posted by dummy on March 19, 2008, 9:42 pm
Please log in for more thread options
On Thu, 20 Mar 2008 01:37:22 +0100, Gunnar Hjalmarsson

>Ben Bullock wrote:
>> I changed only the top line of your program to "#!/usr/bin/perl" and the
>> output was as follows:
>>
>> ben ~ 524 $ ./bug.pl
>> Semicolon seems to be missing at ./bug.pl line 25.
>> "my" variable $q masks earlier declaration in same scope at ./bug.pl line
>> 28.
>> "my" variable $q masks earlier declaration in same scope at ./bug.pl line
>> 29.
>> "my" variable $q masks earlier declaration in same scope at ./bug.pl line
>> 30.
>> "my" variable @in masks earlier declaration in same scope at ./bug.pl
>> line 32.
>> "my" variable @in masks earlier declaration in same scope at ./bug.pl
>> line 34.
>> "my" variable $q masks earlier declaration in same scope at ./bug.pl line
>> 34.
>> "my" variable %ow masks earlier declaration in same scope at ./bug.pl
>> line 61.
>> "state" variable @_ masks earlier declaration in same scope at ./bug.pl
>> line 77.
>> syntax error at ./bug.pl line 26, near ") # works if i comment out this
>> line and put 'my' below -+
>> # print "old\n"; |
>> # display(); |
>> INPUT"
>> syntax error at ./bug.pl line 56, near "}"
>> Can't use global @_ in "my" at ./bug.pl line 68, near "= @_"
>> syntax error at ./bug.pl line 74, near "}"
>> Can't use global @_ in "my" at ./bug.pl line 77, near "= @_"
>> BEGIN not safe after errors--compilation aborted at ./bug.pl line 78.
>>
>> I think some people might be tempted to laugh.
>
>That's not fair. By just adding the missing semicolon, as the first
>error message mentions, the code compiles.

Thank you, Gunnar.

Posted by dummy on March 19, 2008, 9:40 pm
Please log in for more thread options
On Thu, 20 Mar 2008 00:02:28 +0000 (UTC), Ben Bullock

>On Wed, 19 Mar 2008 16:41:19 -0700, dummy wrote:
>
>> Please don't sneer and laugh, but I think I've found a bug in perl
>> itself.
>
>I am using Perl on linux:
>
>ben ~ 525 $ perl --version
>
>This is perl, v5.10.0 built for i686-linux
>
>I changed only the top line of your program to "#!/usr/bin/perl" and the
>output was as follows:
>
>ben ~ 524 $ ./bug.pl
>Semicolon seems to be missing at ./bug.pl line 25.
>"my" variable $q masks earlier declaration in same scope at ./bug.pl line
>28.
>"my" variable $q masks earlier declaration in same scope at ./bug.pl line
>29.
>"my" variable $q masks earlier declaration in same scope at ./bug.pl line
>30.
>"my" variable @in masks earlier declaration in same scope at ./bug.pl
>line 32.
>"my" variable @in masks earlier declaration in same scope at ./bug.pl
>line 34.
>"my" variable $q masks earlier declaration in same scope at ./bug.pl line
>34.
>"my" variable %ow masks earlier declaration in same scope at ./bug.pl
>line 61.
>"state" variable @_ masks earlier declaration in same scope at ./bug.pl
>line 77.
>syntax error at ./bug.pl line 26, near ") # works if i comment out this
>line and put 'my' below -+
># print "old\n"; |
># display(); |
>INPUT"
>syntax error at ./bug.pl line 56, near "}"
>Can't use global @_ in "my" at ./bug.pl line 68, near "= @_"
>syntax error at ./bug.pl line 74, near "}"
>Can't use global @_ in "my" at ./bug.pl line 77, near "= @_"
>BEGIN not safe after errors--compilation aborted at ./bug.pl line 78.
>
>I think some people might be tempted to laugh.

Obviously a cut-and-paste typo. Otherwise I would have no output. Fix
the missing semicolon and try again. That is, if you want to do more
than ridicule.



Similar ThreadsPosted
Re: very strange bug (in perl?) March 19, 2008, 9:19 pm
strange output of pack in perl 5.8.0 September 9, 2004, 7:36 pm
strange trailing output in PERL September 21, 2004, 2:30 pm
Perl 64 bit solaris - Strange Errors September 28, 2006, 10:10 pm
New to Perl - strange behaviour with backticks September 13, 2007, 5:08 pm
Apache+Perl Net::SMTP Strange problem May 16, 2007, 2:07 am
Strange Perl line : Return the result of a function to a function October 24, 2006, 9:19 am
strange February 14, 2005, 4:28 pm
This is strange!!! What happens in here??? January 12, 2007, 6:11 am
Strange DBI error January 13, 2005, 12:31 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap