ferrency has asked for the wisdom of the Perl Monks concerning the following question:
First, some stats:
The contents of file test.pl:
The contents of file test.pm:#!/usr/local/bin/perl use test;
@A = (); %B = (); sub
This code is obviously wrong, but I'd expect the compiler to tell me that, not to crash:
% ./test.pl
zsh: segmentation fault ./test.pl
% perl -c test.pl
zsh: segmentation fault perl -c test.pl
%
I get the same behavior with various names for the files and variables. It doesn't seem to matter whether the variables are lexical or global, or whether they're hashes or arrays, but you have to have two assignments of an empty list into a non-scalar variable. And you have to do it in a "use"'d module.
Is this an undocumented feature? A known bug, or unknown? Most of my typical debugging tools aren't available to me, since it crashes during compilation.
(In my actual code, the problem ended up being relatively easy to find and fix: I accidentally left an extra sub with no code block before the final 1; in my module. I'm still curious why this happens though...)
Thanks!
Alan
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bug in perl 5.6.0?
by Chmrr (Vicar) on Dec 20, 2001 at 01:50 UTC | |
|
Re: Bug in perl 5.6.0?
by VSarkiss (Monsignor) on Dec 20, 2001 at 01:43 UTC | |
by ar0n (Priest) on Dec 20, 2001 at 05:30 UTC |