in reply to Re: Coredump error.
in thread Coredump error.

Thanks for the help
The perl code is as below
(@sortkey)=('0','1','2','3','4','5','6','7','8','9','10','11','12','1 +3','14','15 '); (@names)=("xyz","iop","abc","opop","qwer","kkkk","wwww","qqqq","wwpp", +"klkoo","p pii","mmmm","hhhh","yyyy","ssss","eee"); @sortkey = sort { lc($names[$sortkey[$a]]) cmp lc($names[$sortkey[$b]] +) } @sortk ey; foreach $i (0..$#names) { print "$names[$sortkey[$i]]\n"; }
the exact output is
=> perl try70.pl
Bus error(coredump)
the perl version is perl5.8.7 and running on HPUX
thanks,
Renu.

Replies are listed 'Best First'.
Re^3: Coredump error.
by Corion (Patriarch) on Jul 18, 2006 at 11:50 UTC
Re^3: Coredump error.
by gellyfish (Monsignor) on Jul 18, 2006 at 10:48 UTC

    Ah. Yes that does coredump with both 5.9.4 @ DEVEL28476 and 5.8.8 that I have here, but not with 5.8.1.

    Please can you use the perlbug program to submit a report including the offending code.

    /J\

      It gives a segmentation violation on Windows XP with ActiveState's Perl 5.8.8, build 817.

      I've entered an Active State bug for it, referencing the OP's post. I also gave the OP credit for finding it.

      emc

      e(π√−1) = −1
Re^3: Coredump error.
by Moron (Curate) on Jul 18, 2006 at 11:08 UTC
    I don't have all the required Perl versions to test here, but the "( @arr ) = ( listelement, ... )" construction looks suspiciously ambiguous. Have you tried dropping the brackets from the left hand side of the list-to-array assignments?

    -M

    Free your mind

      That doesn't make any difference, however making both @sortkey and @names lexicals does make a difference with 5.8.8 but not blead (they segfaulted in different places in the original code.)

      /J\