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. | [reply] [d/l] |
Apart from the code errors and all this stuff ... please do be more careful with your spelling! I know some people will jump at me for telling this, pointing out that you are not a native speaker (guess what, I'm not either), that you might suffer from a dyslexia or dysgraphia, but I don't think either is a valid excuse. If you know you can't spell, you should be double careful when writing something. Use a spellcheck if you need, but please it's "what" not "wat", "you" not "u", "have" not "hav", "your scalars" not "you scalars", "will" not "wil", "because" not "becoz", "just" not "jus" and "in order to" not "inorder to". (I wonder why Indians do tend to have such a terrible spelling.)
And by the way, "house without a roof" (why all those capital letters?) might very well be fairly safe, rarely does the sky throw things that could hurt you if there was not a roof protecting you. It's not gonna be warm in that house though.
Jenda
|
XML sucks. Badly. SOAP on the other hand is the most powerfull vacuum pump ever invented. |
| [reply] |