Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks , Can someone insight into this error.
Thanks

Line 15
my $data_holder = "$writer :: $title :: $text";

ERROR:
Use of uninitialized value in concatenation (.) or string at reflectio +ns.cgi line 15 (#1) (W uninitialized) An undefined value was used as +if it were already defined. It was interpreted as a "" or a 0, but ma +ybe it was a mistake. To suppress this warning assign a defined value + to your variables. To help you figure out what was undefined, perl t +ells you what operation you used the undefined value in. Note, howeve +r, that perl optimizes your program and the operation displayed in th +e warning may not necessarily appear literally in your program. For e +xample, "that $foo" is usually optimized into "that " . $foo, and the + warning will refer to the concatenation (.) operator, even though th +ere is no . in your program.

Replies are listed 'Best First'.
Re: need help with error
by BrowserUk (Patriarch) on Nov 21, 2002 at 04:09 UTC

    It simply means that one of the three variables $writer, $title or $text has no value. Try printing those three variables out individually just before line 15 and that will tell you which one(s) have no value. You should then be able to track down why it is so.


    Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
    Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
    Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
    Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

      Thanks, This is what I got
      $writer is Jim Ciarico
      $title is Consistency
      $text is Why is it so important

        Hmmm. Can I suggest you post the complete program if its not to big. Either the line you indicate is not line 15 or there is something else affecting the results. Given the error message and the line you posted. The only explaination is that one of those three variables is undefined.


        Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
        Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
        Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
        Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

Re: need help with error
by pg (Canon) on Nov 21, 2002 at 05:15 UTC
    Did you spell all your variables correctly? Did you specify use strict to help?
Re: need help with error
by dingus (Friar) on Nov 21, 2002 at 10:24 UTC
    try
    my $data_holder = $writer.' :: '.$title.' :: '.$text;

    Dingus


    Enter any 47-digit prime number to continue.