Re: Adding to a Hash

2004-11-26 Thread Paul Johnson
On Fri, Nov 26, 2004 at 06:19:28PM -0800, Graeme St. Clair wrote: > my %sname = qw { > COUNTRY_NAME Country > ... > }; > my %words2 = ( > "ORDER_NUMBER", "Order Number", > ... > ); > #%sname{keys %words2} = values %words2; > %sname = (%sname, %words2); > > I couldn't find a way to co

Adding to a Hash

2004-11-26 Thread Graeme St. Clair
I've inherited an application that issues several different SQL requests, lovingly creating different lists of user-friendly column names for each of the different database column names that might be returned. To cut down future maintenance requirements, I thought I would generalise the HTML-emitt

Re: 're'-redirecting STDOUT back to STDOUT after writing to a file

2004-11-26 Thread Matthias Kraatz
Thanks, I have learned something. My conception was that STD* descriptors where sort of system constants. Now I see that you can query, rename and store them into other variables. So storing old STDOUT and resetting when done with all the other stuff works perfect now. Thanks again, Matthias O

Re: 're'-redirecting STDOUT back to STDOUT after writing to a file

2004-11-26 Thread Octavian Rasnita
Use select() function. Read perldoc -f select Teddy - Original Message - From: "Matthias Kraatz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 27, 2004 12:20 AM Subject: 're'-redirecting STDOUT back to STDOUT after writing to a file Hi, this might be a reall

Re: 're'-redirecting STDOUT back to STDOUT after writing to a file

2004-11-26 Thread Gunnar Hjalmarsson
Matthias Kraatz wrote: in a cgi-script I wanted to prevent an executable that I call from within the script from dumping output directly to the webpage. This worked fine with 'open(STDOUT,">something-log.txt")'. But now I want to write to the webpage again. 'open(STDOUT,">&STDOUT")' does not only l

're'-redirecting STDOUT back to STDOUT after writing to a file

2004-11-26 Thread Matthias Kraatz
Hi, this might be a really stupid question. But, in a cgi-script I wanted to prevent an executable that I call from within the script from dumping output directly to the webpage. This worked fine with 'open(STDOUT,">something-log.txt")'. But now I want to write to the webpage again. 'open(STD

Re: how to send mail trough perl script

2004-11-26 Thread JupiterHost.Net
vishwas bhakit wrote: how to send mail through perl script I *love* Mail::Sender (Jenda rocks!) Lee.M - JupiterHost.Net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Scheduling a program

2004-11-26 Thread James W. Thompson, II
3 Times per minute I am not sure of but here is the syntax for once a minute with the given params: 15-59 10 * * 1-5 uid cmd * 11-14 * * 1-5 uid cmd 0-15 14 * * 1-5 uid cmd Substitute the user name or ID for 'uid' of the us

Re: how to send mail trough perl script

2004-11-26 Thread Chris Devers
On Fri, 26 Nov 2004, vishwas bhakit wrote: > how to send mail through perl script One way to send mail is with the Mail::Send CPAN module. Quoting from `perldoc Mail::Send`: require Mail::Send; $msg = new Mail::Send; $msg = new Mail::Send Subject=>'example subject', To=>'timbo';

[OT] Gmail Invites

2004-11-26 Thread James W. Thompson, II
I know this is off-topic but I have 5 Gmail invites I want rid of...if anyone really has a problem with me giving these away here just let me know and I won't in the future... https://gmail.google.com/gmail/a-5cb03dc1c9-48a327cb72-602bacc482 https://gmail.google.com/gmail/a-5cb03dc1c9-10e8411fef-

Scheduling a program

2004-11-26 Thread Octavian Rasnita
Hi all, I want to run a program 3 times per each minute, every day from Monday to Friday, from 10:15 until 14:15. Can I set this in a cron job, with so many restrictions, or do I have another choice? If I can do it in a cron job, can you help me with the syntax? Thank you very much! Teddy --

Re: how to send mail trough perl script

2004-11-26 Thread Chris Devers
On Fri, 26 Nov 2004, vishwas bhakit wrote: > how to send mail through perl script > > [thanks].. Try writing a program, I hear that's how all the kids do it these days. -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: email reading script

2004-11-26 Thread Chris Devers
On Fri, 26 Nov 2004, vishwas bhakit wrote: > i had tried the code from > http://forums.devshed.com/archive/t-56587 That's nice. Did it work? If not, what was the problem? How did you try to solve it? -- Chris Devers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

Re: a question about the return value of a subroutine

2004-11-26 Thread Jeff 'japhy' Pinyan
On Nov 25, Zeng Nan said: >>1 my @nums = (1..100); >>2 my $result = &total(@nums); >>3 >>4 print "$result\n"; >>5 >>6 sub total { >>7 my $sum; >>8 foreach(@_){ $sum += $_ } >>9 $sum; >>10 } > >My question is without line 9, the return value is nothing, while I >expect it will return the valu

how to send mail trough perl script

2004-11-26 Thread vishwas bhakit
how to send mail through perl script thnx.. Yahoo! India Matrimony: Find your life partneronline.

RE: Calling functions using variable (I mean symbolic refs)

2004-11-26 Thread kamal.gupta
Hey Paul, That's a clever way of achieving the task. Thanks for that. With Best regards, R. Kamal Raj Guptha. Ph: 91-80-28411990 Ext:1296 Mobile - 9880351218 >-Original Message- >From: Paul Johnson [mailto:[EMAIL PROTECTED] >Sent: Friday, November 26, 2004 5:32 PM >To: R. Kamal Raj Gu

Re: Calling functions using variable (I mean symbolic refs)

2004-11-26 Thread Paul Johnson
On Fri, Nov 26, 2004 at 12:15:12AM +0530, [EMAIL PROTECTED] wrote: > Hi all, > > May be this is a OLD topic of discussion. > > I have a Perl script with lot of functions. This Perl script accepts two > command line options (string values) where the concatenation of these > two strings will give

RE: how to get count in DBI

2004-11-26 Thread Charles K. Clarkson
Ing. Branislav Gerzo <[EMAIL PROTECTED]> wrote: : Charles K. Clarkson [CKC], on Friday, November 26, 2004 at : 04:32 (-0600) wrote these comments: : : : : my $rows = $dbh->selectall_arrayref( : : 'SELECT sessionid FROM session' : : ); : : my $row_count = @$rows; : :

Re: how to get count in DBI

2004-11-26 Thread Ing. Branislav Gerzo
Charles K. Clarkson [CKC], on Friday, November 26, 2004 at 04:32 (-0600) wrote these comments: CKC>my $rows = $dbh->>selectall_arrayref( CKC> 'SELECT sessionid FROM session' CKC> ); CKC> my $row_count = @$rows; isn't faster using SELECT COUNT(*) FROM session ? --

RE: Perl cant add up with sprintf ?

2004-11-26 Thread ext-Chetak.Sasalu
I have an 11 digit number. I want to add another number to it and format to 11 digits as well. my $amount1 = 14313562897; my $amount2 = 0013625; $amount = sprintf("%011d", $amount1 + $amount2); print $amount."\n"; The answer perl gives me is -01 How can this be ? --- When a nu

RE: how to get count in DBI

2004-11-26 Thread Charles K. Clarkson
Anish Kumar K. <[EMAIL PROTECTED]> wrote: : $rows=$dbh->selectall_arrayref("SELECT sessionid FROM session"); : : I want to get the count...For example if it returns : three rowsThen count should be three... : : How will I get the countAs soon after I want to : print the count in the star

how to get count in DBI

2004-11-26 Thread Anish Kumar K.
$rows=$dbh->selectall_arrayref("SELECT sessionid FROM session"); I want to get the count...For example if it returns three rowsThen count should be three... How will I get the countAs soon after I want to print the count in the start itself... Anish

RE: Calling functions using variable (I mean symbolic refs)

2004-11-26 Thread kamal.gupta
Thanks for your valuable information. Will try perlmonks now. With Best regards, R. Kamal Raj Guptha. Ph: 91-80-28411990 Ext:1296 Mobile - 9880351218 >-Original Message- >From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] >Sent: Friday, November 26, 2004 3:06 PM >To: [EMAIL PROTEC

RE: Calling functions using variable (I mean symbolic refs)

2004-11-26 Thread Charles K. Clarkson
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: : What I'm looking at: : : Obviously a good long term solution. The reason why I have : put up the question in the mailing list is because many of : you experts would have faced similar situations and would : have arrived at a bette

RE: Calling functions using variable (I mean symbolic refs)

2004-11-26 Thread kamal.gupta
>Show me the entire script or at least a better >idea of what is in it than the outline given below. The complete script is really t lengthy and that is the reson why I have exactly given an outline. Anyways again I'll explain what I'm looking for. If you have observed in that code, the

Re: email reading script

2004-11-26 Thread vishwas bhakit
i had tried the code from http://forums.devshed.com/archive/t-56587 Chris Devers <[EMAIL PROTECTED]> wrote: On Thu, 25 Nov 2004, vishwas bhakit wrote: > I am working [on a] email reading script in perl, > can anybody [please] tell me where can i get > help for this[question mark] > > [thanks].