In order to tell you why I downvoted you (as per danmcb's request), in the hopes that you don't do this again, I'm responding to this. I also see I'm not the first to downvote this nonsense.

vishi83, please, please, please - test your code before you post it. Someone has already posted a working response, which disagrees with yours on a fundamental level: syntax. TMTOWTDI, perhaps, but if it's a WTDI, it needs to be syntactically correct for the problem at hand.

#!/usr/bin/perl -w use strict; use warnings; my $IpInfo = [ [ qw(20 74 6 55 56) ] ]; my ( $id, $area, $cpu, $ip, $ip2 ) = @$IpInfo[0]; print "$id, $area, $cpu, $ip, $ip2\n";
And the output:
$ perl ./x.pl
Use of uninitialized value in concatenation (.) or string at ./x.pl line 10.
Use of uninitialized value in concatenation (.) or string at ./x.pl line 10.
Use of uninitialized value in concatenation (.) or string at ./x.pl line 10.
Use of uninitialized value in concatenation (.) or string at ./x.pl line 10.
ARRAY(0x813bf00), , , ,
In other words, you didn't solve any problem. You just changed the syntax of the OP, and came out with the same output. Which would have been completely trivial to test prior to posting, and thus the reason for the downvotes.

If you think that the saints Curates and above don't test their code before they post, I have news for you - they generally do, and, when they don't, they usually tell everyone "Warning: untested code" or something to that effect. That's how they got to the level they're at: by posting answers that testably work. (And sometimes they get points for testing things that don't work, and posting that - and asking why it doesn't work. But at least no one is led astray by using something that doesn't work, and then getting confused as to why they were told to do something and it not working for them.)

Please, please, please. Test your code before posting. It'll even save you a few XP.


In reply to Re^2: Getting Specific List Elements Out of an Array Reference by Tanktalus
in thread Getting Specific List Elements Out of an Array Reference by awohld

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.