Re: MySQL time

2005-03-15 Thread Octavian Rasnita
Hi, Yes I know that I can benchmark the perl script using (times)[0] but I am wondering if there is a method of getting the time returned by the MySQL server. Or that time shown by mysql client is not returned by MySQL server but by that client in the same way I can do it using (times)[0]?

DBI query

2005-03-15 Thread mike
Anyone got any any idea what is happening here $dbh=DBI-connect(dbi:Pg:dbname=data_cc,$user,$pw); $dump_dir='/home/data_cc/dump'; @names=$dbh-tables(); #$dbh-execute; #print @names; foreach $names(@names){ if (substr($names,0,9) eq public.tb) { $file1= $dump_dir\/$names; $dbh-prepare(COPY $names

DBI query

2005-03-15 Thread mike
Anyone got any any idea what is happening here $dbh=DBI-connect(dbi:Pg:dbname=data_cc,$user,$pw); $dump_dir='/home/data_cc/dump'; @names=$dbh-tables(); #$dbh-execute; #print @names; foreach $names(@names){ if (substr($names,0,9) eq public.tb) { $file1= $dump_dir\/$names; $dbh-prepare(COPY $names

Re: DBI query

2005-03-15 Thread John Doe
Hi mike Am Montag, 14. März 2005 18.38 schrieb mike: Anyone got any any idea what is happening here Apart from your actual problem, it happens that the coding below will give big chances to have undetected or hard to find errors. - use use strict; use warnings; at the top of the code -

Directory fastscan

2005-03-15 Thread Vladimir D Belousov
Hallo all! How should I fast check up if in the current directory ever one directory exists? I think this way is incorrect: sub is_node { my $cur_dir = shift; opendir(DIR, $cur_dir) || return 0; my @dirs = readdir(DIR); closedir(DIR); while(@dirs){ //Looking up directory until any

System o/p to a varaible

2005-03-15 Thread Anish Kumar K.
Hi This program I use to get the last line from the log file cipe.log. and then write the line onto a text file a.txt system(tail -1 cipe.log a.txt); open INPUT,a.txt; my $line=INPUT; then I open the text file and read the value from the file handle. This invloves cumbersome process. I need

Re: Directory fastscan

2005-03-15 Thread Vladimir D Belousov
Sorry, I mean sub is_node { my $cur_dir = shift; opendir(DIR, $cur_dir) || return 0; my @dirs = readdir(DIR); closedir(DIR); for(@dirs){ //Looking up directory until any [sub]directory found return 1 if (lstat)[2] 004 $_ !~ /^\.+/; } return 0; //No subdirs found. } Vladimir D Belousov

RE: Directory fastscan

2005-03-15 Thread Thomas Bätzler
Hi, Vladimir D Belousov [EMAIL PROTECTED] wrote; Sorry, I mean sub is_node { my $cur_dir = shift; opendir(DIR, $cur_dir) || return 0; my @dirs = readdir(DIR); closedir(DIR); for(@dirs){ //Looking up directory until any [sub]directory found return 1 if (lstat)[2] 004

RE: DBI query

2005-03-15 Thread Bob Showalter
mike wrote: Anyone got any any idea what is happening here $dbh=DBI-connect(dbi:Pg:dbname=data_cc,$user,$pw); $dump_dir='/home/data_cc/dump'; @names=$dbh-tables(); #$dbh-execute; #print @names; foreach $names(@names){ if (substr($names,0,9) eq public.tb) { $file1= $dump_dir\/$names;

Re: System o/p to a varaible

2005-03-15 Thread John Doe
Am Dienstag, 15. März 2005 01.33 schrieb Anish Kumar K.: Hi This program I use to get the last line from the log file cipe.log. and then write the line onto a text file a.txt system(tail -1 cipe.log a.txt); open INPUT,a.txt; my $line=INPUT; then I open the text file and read the value

Re: System o/p to a varaible

2005-03-15 Thread Chris Devers
On Tue, 15 Mar 2005, Anish Kumar K. wrote: This program I use to get the last line from the log file cipe.log. and then write the line onto a text file a.txt system(tail -1 cipe.log a.txt); open INPUT,a.txt; my $line=INPUT; then I open the text file and read the value from the file

RE: System o/p to a varaible

2005-03-15 Thread Bob Showalter
Anish Kumar K. wrote: Hi This program I use to get the last line from the log file cipe.log. and then write the line onto a text file a.txt system(tail -1 cipe.log a.txt); open INPUT,a.txt; my $line=INPUT; then I open the text file and read the value from the file handle. This

How to read and delete mail from a cron job

2005-03-15 Thread Moon, John
Can someone please give me some suggestions (or pointers) as to how to read and delete emails from a cron job. I will be receiving conformation email and need to process it once then delete it - not process it again. Thank you in advance, John Moon -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: System o/p to a varaible

2005-03-15 Thread Felix Geerinckx
[EMAIL PROTECTED] (Anish Kumar K.) wrote in news:[EMAIL PROTECTED]: system(tail -1 cipe.log a.txt); open INPUT,a.txt; my $line=INPUT; my $line = qx(tail -1 cipe.log); -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

configuring cpan

2005-03-15 Thread Octavian Rasnita
Hi all, I have a problem using the cpan command line for installing modules because I don't know for what reasons, some FTP sites are not accessible, but cpan doesn't give a short enough timeout, and I need to wait very much until those servers give a timeout and the 404 error. Is there a way to

Re: How to read and delete mail from a cron job

2005-03-15 Thread Chris Devers
On Tue, 15 Mar 2005, Moon, John wrote: Can someone please give me some suggestions (or pointers) as to how to read and delete emails from a cron job. I will be receiving conformation email and need to process it once then delete it - not process it again. Is procmail not an option? This

Re: Perl and quickbooks?

2005-03-15 Thread Wiggins d'Anconia
Chris wrote: Greetings, Has anybody done anything with perl and quickbooks? I simply need to export some data into quickbooks format where the user can take that exported quickbooks data and import it into quickbooks as a check. I have been looking around, but haven't found anything worthwhile.

Re: configuring cpan

2005-03-15 Thread Peter Scott
On Tue, 15 Mar 2005 15:54:54 +0200, Octavian Rasnita wrote: Hi all, I have a problem using the cpan command line for installing modules because I don't know for what reasons, some FTP sites are not accessible, but cpan doesn't give a short enough timeout, and I need to wait very much until

Re: z/OS unicode error.

2005-03-15 Thread Dave Gray
Are you running with strict and warnings turned on? Because I'm getting Malformed UTF-8 character messages running this: #!/usr/bin/perl use strict; use warnings; my $u = unpackU0U, \x8a\x73; print \$u: $u\n; my $p = pack(U0U, $u); print \$p: $p\n; And I can get rid

RE: Perl and quickbooks?

2005-03-15 Thread Siegfried Heintze
Chris, What are you trying to do? I would like to automate the creation of invoices with Quickbooks. Let me know how your project goes. Do you know how to apply QIF files? I know that Quick Books has an extensive COM interface which should be quite compatible with windows (ActiveState) perl. I

array of numbers with padded zeroes

2005-03-15 Thread Bryan R Harris
I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. But if my hash had 750 elements, I'd want it to go from 001 to 750. I thought

Re: Perl and quickbooks?

2005-03-15 Thread Chris
On Tuesday 15 March 2005 11:52 am, Siegfried Heintze wrote: Chris, What are you trying to do? I would like to automate the creation of invoices with Quickbooks. Let me know how your project goes. Do you know how to apply QIF files? I know that Quick Books has an extensive COM interface

RE: How to read and delete mail from a cron job

2005-03-15 Thread Moon, John
Chris, Thank you for the suggestion but when I say process I mean that I need to read the reply, grep for user id and a confirmation number, update my database to say that the email I send was replied to as requested, and that the email address I was given was correct... I am registering users

RE: array of numbers with padded zeroes

2005-03-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. The real question is what are you attempting

RE: array of numbers with padded zeroes

2005-03-15 Thread Bob Showalter
Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. But if my hash had 750 elements, I'd want it to go

Re: array of numbers with padded zeroes

2005-03-15 Thread Bryan R Harris
I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. The real question is what are you attempting to do? With the hash, you

Re: array of numbers with padded zeroes

2005-03-15 Thread Bryan R Harris
Thanks to everyone who replied! Your suggestions cleaned out a block in my mind, and I got it figured out. Here's what works, for those interested: @allkeys = ('0' x (length(keys(%data)) - 1) . '1' .. (keys(%data)) . ); - B ps. Is there an easy way to test this versus the solution below,

RE: array of numbers with padded zeroes

2005-03-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. The real question is what are you attempting to

RE: How to read and delete mail from a cron job

2005-03-15 Thread Felix Geerinckx
on di, 15 mrt 2005 17:07:10 GMT, John Moon wrote: Plus I am not an admin but a developer and procmail is not a product I believe I can use... (at least I can't find it on this UNIX box) Anyone else? http://search.cpan.org/~simon/Mail-Audit-2.1/ and a line in .forward perhaps? -- felix

Re: How to read and delete mail from a cron job

2005-03-15 Thread Wiggins d'Anconia
Because it's up-side down. Why is that? It makes replies harder to read. Why not? Please don't top-post. - Sherm Pendley, Mac OS X list Moon, John wrote: Chris, Thank you for the suggestion but when I say process I mean that I need to read the reply, grep for user id and a confirmation number,

Re: System o/p to a varaible

2005-03-15 Thread Jeff 'japhy' Pinyan
On Mar 15, Chris Devers said: system($command) or die Couldn't run command '$command': $!; That needs to be system($command) == 0 or die ...; -- Jeff japhy Pinyan % How can we ever be the sold short or RPI Acacia Brother #734 % the cheated, we who for every service

Re: System o/p to a varaible

2005-03-15 Thread Chris Devers
On Tue, 15 Mar 2005, Jeff 'japhy' Pinyan wrote: On Mar 15, Chris Devers said: system($command) or die Couldn't run command '$command': $!; That needs to be system($command) == 0 or die ...; ...which is all the more reason to avoid the system command :-) There's no

Re: Compare 2 database queries?!

2005-03-15 Thread SG Edwards
Thanks for that Chris, using your pseudocode (see below) I have tried the following code: (N.B. I have a table called uniprot_entry_tbl which contains the protein_ids in a column called primary_acc_no) #checks to see if any of the proteins are already in the DB my $question = 'P09466'; my

Re: System o/p to a varaible

2005-03-15 Thread John W. Krahn
Anish Kumar K. wrote: Hi Hello, This program I use to get the last line from the log file cipe.log. and then write the line onto a text file a.txt system(tail -1 cipe.log a.txt); open INPUT,a.txt; my $line=INPUT; then I open the text file and read the value from the file handle. This invloves

Re: array of numbers with padded zeroes

2005-03-15 Thread John W. Krahn
Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e. 01, 02, 03, 04, etc. But if my hash had 750 elements, I'd want it to go from 001 to

Re: Compare 2 database queries?!

2005-03-15 Thread Chris Devers
My response breaks the flow of your script for clarity, but don't take that as me suggesting to just randomly move things around :-) On Tue, 15 Mar 2005, SG Edwards wrote: if ($accession eq $result) { print the protein is already in the database\n; ... print the protein

Re: array of numbers with padded zeroes

2005-03-15 Thread John W. Krahn
Wagner, David --- Senior Programmer Analyst --- WGO wrote: John W. Krahn wrote: Bryan R Harris wrote: I'm having trouble with this, and I'm sure someone out there has a really clever solution-- I have a hash, %data, with, say, 32 elements. From that, I need an array going from 01 to 32, i.e.

input_record_separator is not supported on a per handle basis at ..file/linenum...?

2005-03-15 Thread tsimon
Hi all, Is someone able to explain why I am getting the following error, how I might correct it? Sorry I'm a bit of a newbie to Perl I have recently updated the Perl package I am working with to ActivePerl 5.8.6 and am now getting this error: input_record_separator is not supported on a

Re: input_record_separator is not supported on a per handle basis at ..file/linenum...?

2005-03-15 Thread John W. Krahn
[EMAIL PROTECTED] wrote: Hi all, Hello, Is someone able to explain why I am getting the following error, how I might correct it? Sorry I'm a bit of a newbie to Perl I have recently updated the Perl package I am working with to ActivePerl 5.8.6 and am now getting this error:

RE: System o/p to a varaible

2005-03-15 Thread Manav Mathur
-Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 16, 2005 12:06 AM To: Perl Beginners List Cc: Anish Kumar K. Subject: Re: System o/p to a varaible On Mar 15, Chris Devers said: system($command) or die Couldn't run command

Re: input_record_separator is not supported on a per handle basis at ..file/linenum...?

2005-03-15 Thread John W. Krahn
[EMAIL PROTECTED] wrote: John W. Krahn [EMAIL PROTECTED] 16/03/2005 11:47 AM [EMAIL PROTECTED] wrote: Is someone able to explain why I am getting the following error, how I might correct it? Sorry I'm a bit of a newbie to Perl I have recently updated the Perl package I am working with to