Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: For Loop with Geo::IPFree

by jethro (Monsignor)
on Jul 07, 2012 at 21:50 UTC ( #980522=note: print w/ replies, xml ) Need Help??


in reply to For Loop with Geo::IPFree

Error messages are there to tell you something. Read them carefully and they will give you valuable hints. They also give us valuable hints, so it is advisable to tell us what error message you get. So we don't have to (download any module you use and) execute your script just to find out what error message you got

I can see that you have lines like @code= [0];. Probably you want @code=(0); instead. () is for lists while [] is for references aka pointers to lists. Not that it changes anything, it seems the value is overwritten anyway. So @code=(); to clear the array would work as well

Also $geo->LookUp(@a[i]); should be $geo->LookUp($a[i]);. Your syntax probably still works because this is how array slices are specified, but it could lead to hard to find bugs


Comment on Re: For Loop with Geo::IPFree
Select or Download Code
Re^2: For Loop with Geo::IPFree
by maheshkumar (Sexton) on Jul 07, 2012 at 22:11 UTC

    Well i got the error i did not write $i, instead i was just using i.... That was the problem. LOL The error message was too too long and gave some problem regarding the module and all

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://980522]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2014-10-25 23:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls