http://www.perlmonks.org?node_id=980522


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