develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [ID 20000330.052] Use of uninitialized value in concatenation (.)

Thread Previous
From:
Tom Christiansen
Date:
March 30, 2000 20:04
Subject:
Re: [ID 20000330.052] Use of uninitialized value in concatenation (.)
Message ID:
4468.954475442@chthon
> > % perl -MO=Deparse,-q -e '@scalar = @array = (1..10); print "this $sc<SNIP>
> > @scalar = (@array = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
> > print 'this ' . $scalar . ' and that ' . join($", @array) . "\n";

>I assumed as much, but I still don't think it's reasonable to expect
>the user to know that.

Here's the code:

Perl_report_uninit(pTHX)
{
    if (PL_op)
        Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit,
                    " in ", PL_op_desc[PL_op->op_type]);
    else
        Perl_warner(aTHX_ WARN_UNINITIALIZED, PL_warn_uninit, "", "");
}

And here's how you go there:

Breakpoint 1, Perl_report_uninit () at sv.c:221
221         if (PL_op)
(gdb) bt
#0  Perl_report_uninit () at sv.c:221
#1  0x73c92 in Perl_sv_2pv (sv=0x101c24, lp=0xdfbfd91c) at sv.c:2157
#2  0x65e21 in Perl_pp_concat () at pp_hot.c:151
#3  0x6521b in Perl_runops_debug () at run.c:56
#4  0x577d in S_run_body (oldscope=1) at perl.c:1395
#5  0x5382 in perl_run (my_perl=0xf5030) at perl.c:1319
#6  0x177f in main (argc=3, argv=0xdfbfd9d0, env=0xdfbfd9e0) at perlmain.c:52
(gdb) p *PL_op
$3 = {op_next = 0x103080, op_sibling = 0x1030c0, 
  op_ppaddr = 0x65c88 <Perl_pp_concat>, op_targ = 1, op_type = 66, op_seq = 6, 
  op_flags = 6 '\006', op_private = 2 '\002'}

That sure looks like a concat op to me.  Do you have a suggested
code patch?  Shall we just stop telling them things they don't
understand?  I happen to appreciate knowing what opcode was unhappy
with me, but if it's too much for folks, I guess we should delete this
feature.

--tom

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About