473,657 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with mysqlpp and a perl script

4 New Member
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 1828
gwigg
4 New Member
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 Recognized Expert Contributor
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
2200
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 minutes. It is enough of a difference that unless I can figure out what I did wrong or a better way of doing it I might not be able to use python (since most of what I do is parsing various logs). The main reason to try python is I had to look at...
1
1956
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 into a textarea box. Below this box there are two buttons ... one that is labelled "Save & Exit" and other that is labelled "Save and Preview" On submit of either button, the form data is sent to the same perl script. What I need to have happen is...
3
6544
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 should run on a Unix box I have. Both scripts run ok, except for the part when Windows try's to call out the Unix script. I have it set up where the Unix is mapped through a drive letter and can drop stuff into the Unix box. It is going through another...
1
4677
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 of which platform I use to access the directory.) Platform 1: perl is installed in /tps/bin/perl. CPAN modules are available Perl is also installed in /usr/bin/perl Platform 1, but the modules are not accessible with this version. Platform...
3
15277
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 have a perl script that runs on my webserver, which is supposed to login to the gameserver and download the log. The problem is that when it gets to the part where it needs to download the file, it aborts. The gameserver FTP requires I use port 24...
1
1897
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) works well: mysqlpp::Connection con("information_schema", "localhost","root","pass",3306); //creating new database works properly too
1
2517
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 met when running my scripts. Could somebody pay attention to look into the below details to give some help? Really appreciate!!!!! Let me give deatail info: OS: HP 3000 MPE/iX.
2
1719
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 which would take in as input the state code, of the 50 states belonging to the Unites States of America. After the user enters the two letter code and presses the "GO" button, a *.xsd file is parsed to retrieve information about the entire state...
3
2335
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 the interpreter manually...look what it says: i've tried with /web/cgi-bin/php "$HOME/html/path/to/my/script.php as command and it doesn't work. if i run the script in browser it works...what should i introduce as a command..and do i have...
0
8402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8508
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.