Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8394967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:11:05+00:00 2026-06-09T20:11:05+00:00

I have written some code, and I am not sure what the error is.

  • 0

I have written some code, and I am not sure what the error is. I am getting the error:

Use of uninitialized value in concatenation (.) or string at mksmksmks.pl line 63

My code is as follows:

for(my $j = 0; $j < $num2; $j++) {
  print {$out} "$destination[$j]|$IP_one_1[$j]|$IP_one_2[$j]|$reached[$j]|$IP_two_1[$j]|$IP_two_2[$j]\n";`
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:11:06+00:00Added an answer on June 9, 2026 at 8:11 pm

    What it means is that one of the elements of either @destination, @IP_one_1, @IP_one_2, or @reached has not been defined (has not been assigned a value), or has been assigned a value of undef. You either need to detect (and prevent) undefined values at the source, or expect and deal with them later on. Since you have warnings enabled (which is a good thing), Perl is reminding you that your code is trying to concatenate a string where one of the values being concatenated is undefined.

    Consider the following example:

    perl -wE 'my @x = (); $x[0] = "Hello "; $x[2] = "world!";  say "@x"'
    

    In this example, $x[0] has a value, and $x[2] has a value, but $x[1] does not. When we interpolate @x into a double-quoted construct, it is expanded as [element 0 (Hello )]<space>[element 1 (undef)]<space>[element 2 (world!)]. The undef elements interpolates as an empty string, and spews a warning. And of course by default array interpolation injects a space character between each element. So in the above example we see Hello <interpolation-space>(undef upgrades to empty string here)<interpolation-space>world!

    An example of where you might investigate is one or more of the arrays is of a different total size than the others. For example, if @IP_one_2 has fewer elements than the others, or if $num2 is a value greater than the number of elements in any of the arrays.

    Place the following near the top of your script and run it again:

    use diagnostics;
    

    When I run the following one-liner under warnings and diagnostics:

    $ perl -wMdiagnostics -e '$a=$a; print "$a\n"'
    

    I get the following output, and you will get something similar if you add use diagnostics;… a very helpful tool when you’re first learning Perl’s warnings.

    Use of uninitialized value $a in concatenation (.) or string at -e
    line 1 (#1)

    (W uninitialized) An undefined value was used as if it were already
    defined. It was interpreted as a “” or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.

    To help you figure out what was undefined, perl will try to tell you
    the name of the variable (if any) that was undefined. In some cases
    it cannot do this, so it also tells you what operation you used the
    undefined value in. Note, however, that perl optimizes your program
    anid the operation displayed in the warning may not necessarily appear
    literally in your program. For example, “that $foo” is usually
    optimized into “that ” . $foo, and the warning will refer to the
    concatenation (.) operator, even though there is no . in
    your program.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using some not optimal code written by me... :-| I have following code:
I have written some code that loads an XML document using an XmlDocument object
I have written some code for displaying a drop down list, but the code
I have written some code in JSP to download .docx files which is hosted
I have written some code for playing a .wav through my application. Now I
I have written some code to ensure that items on an order are all
I have written some code to look at properties using reflection. I have retrieved
I have written some code to display a YouTube video on my page but
I have written some WebGL code, actually I am playing with the examples that
I have written some jQuery ajax code where I am sending a request to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.