Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://980522]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-05-20 20:01 GMT
Find Nodes?
    Voting Booth?