473,388 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Help with mysqlpp and a perl script

4
Hi, am am having a problem with extracting all the data I want using a perl script the data being in a mysql database. The script works fine until row 59101 is reached in the 1st table, anyone aware of any limitations? The database is an ip geo laction database to be found at www.hostip.info. I am using active perl, the db is on my local xp laptop

thanks
Guy

Here is the script:
Expand|Select|Wrap|Line Numbers
  1. #!/usr/local/bin/perl
  2. use strict;
  3. use warnings;
  4. use DBI;
  5.  
  6. my $num=226;
  7.  
  8. my $dbh = DBI->connect("dbi:mysqlPP:database=iplocation:host=localhost","root","*********",{'RaiseError' =>1});
  9. my @ranges = $dbh -> tables;
  10. open(my $out, ">", "output.txt") or die "Can't open output.txt: $!";
  11. for(my $i=2; $i<(@ranges); $i++)
  12.     { 
  13.      my $sth = $dbh -> prepare (qq{select * from $ranges[$i] where country = $num});
  14.     $sth -> execute ();
  15.     print "checking table $ranges[$i]\n";
  16.     while (my $ref = $sth->fetchrow_arrayref())
  17.         {
  18.         print $out "IP address is $ranges[$i].$ref->[0].$ref->[1]\n";
  19.         $sth->finish();   
  20.         }
  21.     }
  22. close $out or die "$out: $!";
  23.  
  24. $dbh->disconnect ();
  25.  
_______________
Here is the last entry in output.txt where the code hangs:

$ tail output.txt
IP address is ip4_0.255.212
IP address is ip4_0.255.213
IP address is ip4_0.255.214
IP address is ip4_0.255.215
IP address is ip4_0.255.216
IP address is ip4_0.255.217
IP address is ip4_0.255.218
IP address is ip4_0.255.219
IP address is ip4_0.255.220
IP ad


What is strange is that it doesn't complete the print of IP address is

thanks
Guy
Feb 18 '08 #1
2 1784
gwigg
4
The version of Active perl I am running is:

This is perl, v5.10.0 built for MSWin32-x86-multi-thread
(with 1 registered patch, see perl -V for more detail)

and the version of mysql is Server version: 5.0.45-community-nt MySQL Community Edition (GPL)
Feb 19 '08 #2
eWish
971 Expert 512MB
I don't know of any limitations and I don't think it is a Perl issue. I would suggest asking the MySQL forum and/or check the docs at Mysql to see if there are any limitations.

--Kevin
Feb 19 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Dennis Roberts | last post by:
I have a script to parse a dns querylog and generate some statistics. For a 750MB file a perl script using the same methods (splits) can parse the file in 3 minutes. My python script takes 25...
1
by: Robert V | last post by:
Hi all, I could use some help programming on of my Perl script to handle different submit buttons within the same form. Here is what I have so far. A user goes to a Web form and inputs some data...
3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
1
by: Julia Bell | last post by:
I would like to run the same script on two different platforms. The directory in which the script(s) will be stored is common to the two platforms. (I see the same directory contents regardless...
3
by: FLOTServer | last post by:
Here's my problem: I run a gameserver that runs the game "Medal of Honor". On the game server is log file which contains all of the data from the players for that day (kills, deaths, etc...). I...
1
by: jaccurek | last post by:
Hello all! I've a problem with mysql++-2.1.1 examples. Compiler compiles properly but when I create Query object program crashes (when it is running). This constructor (creating connection)...
1
by: roadbai | last post by:
Hi all, This is the first time to post question here, hopefully experts of perl here can give me a hand, to be honest, I am kind of new to perl, and I am struggling with the "Out of memory" issue I...
2
by: MK | last post by:
Hello, I am new to XML and PERL and I have a few questions the answers to which I need to complete a project. All your time and effort would be highly appreciated. I have to make a small HTML page...
3
by: uzzi | last post by:
I don't know how to make a php script to work via cron...I want to make it run daily...My server API is CGI/Fast CGI.I have hosting from godaddy and in the help section i found that i have to specify...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.