Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://980522]
help
Chatterbox?
[Corion]: perldigious: That seems to be more the export and likely it's the recipients of that export that like the titles changes
[Corion]: ... "changed"
[Corion]: I usually expect fixed header names, but am sometimes lenient in the order of columns. But changing the report titles often sounds to me as if you are not the sole consument of the export ;)
[shmem]: perldigious: as always - if it ain't broke, don't fix it. Ther must be a very compelling reason for changing column names in a database. Those are rare.
[Corion]: If you have whitespace in the column names in the database, whap the DBAs ;)

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2017-05-25 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?