Re: database insert algorithm

2007-09-24 Thread Jenda Krynicky
From: Luke [EMAIL PROTECTED] Hello, I am looking for a proper, fastest and most reasonable way to insert data from pretty big file (~1,000,000 lines) to database. I am using Win32::ODBC (ActiveState Perl) module to connect with Access/MSSQL database and inserting line after line. I was

Re: database insert algorithm

2007-09-24 Thread Rob Coops
First of all, you should try and use the database native tools for loading tables this size... If it has to be perl which does happen sometimes, you should definetly switch of autocommit. Try doing a commit every 5 lines or even every 10 lines (ask your friendly DBA how big the

mod perl

2007-09-24 Thread George
Hello All, I'm having a problem with modperl and I can't figure out if it's my stupiditry or modperls'. I'd love somebody with some modperl foo to give me a hand. First, the config: rembox# cat /etc/redhat-release Red Hat Enterprise Linux ES release 4 (Nahant Update 4) rembox# rpm -qa |

Re: Process ID

2007-09-24 Thread Ken Foskey
On Mon, 2007-09-24 at 05:13 +0530, Somu wrote: Thanks for the help. I did it using system tasklist temp; open FH , temp ; statements.. unlink (temp); #EOF Consider this code snippet then, does this in one step. I am writing the output to a log only you can put all the logic into the

Mysql database not being updated

2007-09-24 Thread kapil.V
Hi, I used the code: sub set_min{ $host = shift; $date = shift; print The host is $host and the date is $date\nIn the function set_min\n; $host = SOX::get_db_host(); $user = SOX::get_db_user(); $passwd = SOX::get_db_passwd();

Re: database insert algorithm

2007-09-24 Thread Matthew Whipple
I haven't dealt with MS databases in several years but some of this stuff will likely still apply. First a couple notes on the underlying databases, if you're running Access be sure to compact the database after the insert particularly if this is going to be a repeated process, in addition to

Re: Process ID

2007-09-24 Thread John W. Krahn
Ken Foskey wrote: On Mon, 2007-09-24 at 05:13 +0530, Somu wrote: Thanks for the help. I did it using system tasklist temp; open FH , temp ; statements.. unlink (temp); #EOF Consider this code snippet then, does this in one step. I am writing the output to a log only you can put all the

Process ID

2007-09-24 Thread Somu
Great! Thanks.. How about using untie instead of close? Can i know , phat is the difference between the two? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

AFAIK

2007-09-24 Thread Somu
What does it mean? AFAIK? I have seeing it a lot.. Earlier i've been seeing the HTH, and a guess gave the answer.. But this one, AFAIK... Are there any more such short forms? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Mysql database not being updated

2007-09-24 Thread Matthew Whipple
You have two $host variables, the one passed as the parameter will be overwritten by the SOX function which returns the DB host name used for connection. In the Update query that would remain constant for whatever database you connected to. I'm guessing the problem is that you want separate

Re: Mysql database not being updated

2007-09-24 Thread Chas. Owens
On 9/24/07, kapil.V [EMAIL PROTECTED] wrote: snip my $insert_query = qq{ UPDATE hosts SET last_checked = '$date' WHERE hostname = '$host'; }; $sth = $db - prepare($insert_query) or die Could not prepare the statement: .$db - errstr;;

How to test for 0

2007-09-24 Thread Zachary Shay
Is there a way to test for values where zero is valid? For instance: %a_Hash; $a_hash{user_id} = 0; $a_hash{user_name} = root if ($a_hash{user_id}); print $a_hash{user_id} if ($a_hash{user_id}); print $a_hash{user_name} if ($a_hash{user_name}); Sometimes the user_id can be undef. As a result,

Re: mod perl

2007-09-24 Thread Matthew Whipple
It appears as though the user method only returns a value after successful authentication while you're trying to get it before. George wrote: Hello All, I'm having a problem with modperl and I can't figure out if it's my stupiditry or modperls'. I'd love somebody with some modperl foo to

Re: mod perl

2007-09-24 Thread George
Hi, I found the answer on another perl mongers list. I needed to swap the user and passwd. $r-user isn't available until after $r-get_basic_auth_pw has been called. Cheers! George Matthew Whipple wrote: It appears as though the user method only returns a value after successful

Re: Process ID

2007-09-24 Thread Matthew Whipple
untie or unlink? You had used unlink previously which closed and deleted a temporary file while close only closes the file which would be the proper way to terminate a pipe such as used in the solution. Somu wrote: Great! Thanks.. How about using untie instead of close? Can i know , phat is

RE: AFAIK

2007-09-24 Thread Wagner, David --- Senior Programmer Analyst --- WGO
-Original Message- From: Somu [mailto:[EMAIL PROTECTED] Sent: Monday, September 24, 2007 09:42 To: Beginners@perl.org Subject: AFAIK What does it mean? AFAIK? I have seeing it a lot.. Earlier i've been seeing the HTH, and a guess gave the answer.. But this one, AFAIK... Are

Re: AFAIK

2007-09-24 Thread Chas. Owens
On 9/24/07, Somu [EMAIL PROTECTED] wrote: What does it mean? AFAIK? I have seeing it a lot.. Earlier i've been seeing the HTH, and a guess gave the answer.. But this one, AFAIK... Are there any more such short forms? HTH -- hope that helps AFAIK -- as far as I know IIRC -- if I remember

file search containing string

2007-09-24 Thread Nishi Bhonsle
Hi: How can I use perl to do the following - --Look for a file on a filesystem containing a string such as Product Name 1.0.0.0.0 --Then get the disk location path of the file and store the path in a variable. --Pass the variable to an external java program. Thanks a lot! -- To unsubscribe,

Re: AFAIK

2007-09-24 Thread John W. Krahn
Somu wrote: What does it mean? AFAIK? As Far As I Know I have seeing it a lot.. Earlier i've been seeing the HTH, and a guess gave the answer.. But this one, AFAIK... Are there any more such short forms? http://www.geocities.com/eedd88/abbreviations.html?200724 John -- Perl isn't a

Re: mod perl

2007-09-24 Thread Dr.Ruud
George schreef: I'm having a problem with modperl and I can't figure out if it's my stupiditry or modperls'. I'd love somebody with some modperl foo to give me a hand. See http://london.pm.org/pipermail/london.pm/Week-of-Mon-20070924/010069.html -- Affijn, Ruud Gewoon is een tijger

Re: AFAIK

2007-09-24 Thread Gunnar Hjalmarsson
Somu wrote: What does it mean? AFAIK? I have seeing it a lot.. Earlier i've been seeing the HTH, and a guess gave the answer.. But this one, AFAIK... Are there any more such short forms? http://www.google.com/ -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To

Re: Mysql database not being updated

2007-09-24 Thread Paul Lalli
On Sep 24, 2:48 am, [EMAIL PROTECTED] (kapil.V) wrote: Hi, I used the code: sub set_min{ $host = shift; $date = shift; Here you set $host and $date to be two parameters passed into your set_min function. print The host is $host and the date is

Re: How to test for 0

2007-09-24 Thread Matthew Whipple
defined() Zachary Shay wrote: Is there a way to test for values where zero is valid? For instance: %a_Hash; $a_hash{user_id} = 0; $a_hash{user_name} = root if ($a_hash{user_id}); print $a_hash{user_id} if ($a_hash{user_id}); print $a_hash{user_name} if ($a_hash{user_name}); Sometimes

RE: How to test for 0

2007-09-24 Thread Wagner, David --- Senior Programmer Analyst --- WGO
-Original Message- From: Zachary Shay [mailto:[EMAIL PROTECTED] Sent: Monday, September 24, 2007 11:04 To: beginners@perl.org Subject: How to test for 0 Is there a way to test for values where zero is valid? For instance: %a_Hash; $a_hash{user_id} = 0; $a_hash{user_name} =

Re: How to test for 0

2007-09-24 Thread John W. Krahn
Zachary Shay wrote: Is there a way to test for values where zero is valid? For instance: %a_Hash; $a_hash{user_id} = 0; $a_hash{user_name} = root if ($a_hash{user_id}); print $a_hash{user_id} if ($a_hash{user_id}); print $a_hash{user_name} if ($a_hash{user_name}); Sometimes the user_id can

Re: How to test for 0

2007-09-24 Thread Chas. Owens
On 9/24/07, Zachary Shay [EMAIL PROTECTED] wrote: Is there a way to test for values where zero is valid? For instance: %a_Hash; $a_hash{user_id} = 0; $a_hash{user_name} = root if ($a_hash{user_id}); print $a_hash{user_id} if ($a_hash{user_id}); print $a_hash{user_name} if

Re: How to test for 0

2007-09-24 Thread Zachary Shay
Thanks for all the responses guys. I have rewritten my code with defined, and that appears to be exactly was I was looking for. Thanks, Zach way to test these values so that only undef will return as false? Thanks, Zach

Re: AFAIK

2007-09-24 Thread Martin Barth
Hi, AFAIK = as far as i know HTH = hope that helps HTH! ;) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to test for 0

2007-09-24 Thread Martin Barth
Hi you can test if something is defined with if( defined( $var ) ) ( in addition: for hashs there is also exists() ) HTH Martin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: AFAIK

2007-09-24 Thread Somu
I knew LOL from wap chatting.. IMHO, its a gud way to write things. TIMTOWTWI - there is more than one way to write it! TDH - That Definitely Helped! Thanks all.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: AFAIK

2007-09-24 Thread Jenda Krynicky
Date sent: Mon, 24 Sep 2007 22:11:44 +0530 From: Somu [EMAIL PROTECTED] Send reply to: [EMAIL PROTECTED] To: Beginners@perl.org Subject:AFAIK What does it mean? AFAIK? I have seeing it a lot.. Earlier i've been seeing

Process ID

2007-09-24 Thread Somu
I meant untie $process ; instead of the close function. In the docs, it says untie is better than close. Why is it so? I only use untie while closing perl database hashes.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to test for 0

2007-09-24 Thread yitzle
Inexplicit tests, eg `if ($var)`, will not differentiate between undef and 0. However, you should be able to explicitly test for either 0 or undef. for (0, undef, 1) { print [$_] is true\n if ($_); print [$_] is false\n if (not $_); print [$_] is 0\n if ($_ eq 0); print [$_] is undef\n if

Re: AFAIK

2007-09-24 Thread Isaac Good
As far as I know. Some links for you to explore: http://www.urbandictionary.com/ http://www.acronymfinder.com/ http://acronyms.thefreedictionary.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to test for 0

2007-09-24 Thread Rob Dixon
Zachary Shay wrote: Is there a way to test for values where zero is valid? For instance: %a_Hash; $a_hash{user_id} = 0; $a_hash{user_name} = root if ($a_hash{user_id}); print $a_hash{user_id} if ($a_hash{user_id}); print $a_hash{user_name} if ($a_hash{user_name}); Sometimes the user_id can

Re: Process ID

2007-09-24 Thread Matthew Whipple
perldoc -funtie or more thoroughly perldoc perltie untie is the way to go if you're dealing with a tied variable...if you're not then it won't do anything (or at least it shouldn't). The perltie doc will also hint at the greater range of tie'ing available above database hashes. Somu wrote: I