how to avoid process die when can't create mysql dbh

2005-10-25 Thread Jeff Pan
hi, Because of network problem,my script can't create Mysql dbh sometime when running,then it died.I have written code like this: my $mysql_dbh=DBI-connect(dbi:mysql:$mysql_db:$mysql_host,$mysql_user,$mysql_passwd, {PrintError = 1,RaiseError = 0}); I want to

difference between 'subroutine()' and 'subroutine()'

2005-10-12 Thread Jeff Pan
HI, I want to know what's the difference when I call a subroutine with '' or without ''. such as: subroutine(); sub subroutine{ .. } or subroutine(); sub subroutine{ .. } Can anyone tell me?thanks a lot. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

compare two files

2005-10-11 Thread Jeff Pan
hi, Is there a best way to find some lines which exists in both two files? Someone has show me a method but it seems a little low efficiency. The code is as below: open (T1,1.txt) or die $!; open (T2,2.txt) or die $!; while(my $line=T2){ chomp $line; print $line,\n unless diff($line); }

Re: compare two files

2005-10-11 Thread Jeff Pan
Your code logic says that you want to find lines in '2.txt' that are NOT in '1.txt'. thanks for all answerers. yeah,I have put less attention on that code,and have made a fatal logic error. but the way mentioned by John, putting file's all contents to a hash, maybe somewhat less efficiency when

Re: Redirecting STDERR

2005-10-07 Thread Jeff Pan
hi, maybe u should redefined the __DIE__ handle for the reason of safety. such as: $SIG{__DIE__}=\log_die; sub log_die { open (HDW,,$err_log); select HDW;$|=1;select STDOUT; print HDW @_; close HDW; die @_; } 2005/10/8, Timothy Johnson [EMAIL PROTECTED]: It partly depends

move applications from traditional CGI to mod_perl

2005-09-23 Thread Jeff Pan
hi,everyone, I want to move my web applications which written by traditional CGI to mod_perl.Is there any risk or difficulty here? The applications are something about webmail.Which module under mod_perl is suited for me? Any advise or reference to me should be appreciated.TKS. -- Jeff Pan

about sleep: is it a bug?

2005-09-20 Thread Jeff Pan
; } close HD; `cat /dev/null $log`; disable(\%total); } } -- -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - Choose from over 50 domains or use your own -- To unsubscribe, e-mail: [EMAIL

Re: keys of hash of hashes

2005-09-16 Thread Jeff Pan
Brent Clark -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - Same, same, but different� -- To unsubscribe, e-mail

about utf8

2005-09-14 Thread Jeff Pan
. -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - A no graphics, no pop-ups email service -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Regex - find chars between ()

2005-09-12 Thread Jeff Pan
)/; } } close(PWFILE); ...do something with $c[0] $c[1] $c[2] $c[3]... #EndCode Really appreciate some pointers. Regards, Greg -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again

Re: Regex - find chars between ()

2005-09-12 Thread Jeff Pan
Sorry,it should be: $_=~/\((\w+)\,\s*(\d+)\)\s+\((\w+)\,\s*(\d+)\)/; Didn't consider the blank space before. On Mon, 12 Sep 2005 14:54:56 +0800, Jeff Pan [EMAIL PROTECTED] said: Is this feasible? while() { next unless /$host/; $_=~/\((\w+)\,(\d+)\)\s+\((\w+)\,(\d+)\)/; my

RE: Regex - find chars between ()

2005-09-12 Thread Jeff Pan
+)\,\s*(\d+)\)/; #my @array=($1,$2,$3,$4); my @array=qw/$1 $2 $3 $4/; print join (:,@array),\n; } executing the script: $ perl t10.pl tt2.txt $1:$2:$3:$4 why this happen? On Mon, 12 Sep 2005 02:38:25 -0500, Charles K. Clarkson [EMAIL PROTECTED] said: Jeff Pan mailto:[EMAIL

Re: catching output from ping

2005-09-09 Thread Jeff Pan
-- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - Access all of your messages and folders wherever you are -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first

Re: Looping over an array of hashes problem

2005-09-08 Thread Jeff Pan
://learn.perl.org/ http://learn.perl.org/first-response -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - mmm... Fastmail... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: extract web pages from a web site

2005-09-08 Thread Jeff Pan
this task Thanks José Pinto -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - mmm... Fastmail... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: 2-way lookup

2005-09-08 Thread Jeff Pan
and I'm looking for suggestions. Thanks for your time. Greg Keenan Lucent Technologies * Level 1, 68 Waterloo Road North Ryde NSW 2113 Australia * +61 2 9491 6898 * [EMAIL PROTECTED] -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - The way an email service

Re: deciphering regular expressions

2005-09-07 Thread Jeff Pan
/first-response -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http

Re: naming subroutine reference parameter?

2005-09-06 Thread Jeff Pan
); sub_test(\%hash,[EMAIL PROTECTED]); sub sub_test{ my ($hash_ref,$array_ref)[EMAIL PROTECTED]; my %hash=%$hash_ref; my @[EMAIL PROTECTED]; do something... } -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - IMAP accessible web-mail -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: naming subroutine reference parameter?

2005-09-06 Thread Jeff Pan
and it only makes unnecessary overhead as keys/values are copied, so you immediately lost benefit by passing by reference. It's better to access them directly like, $hash_ref-{key} $array_ref-[0] do something... } This point is great,thank u. -- Jeff Pan [EMAIL PROTECTED] -- http

Re: parsing long strings

2005-09-02 Thread Jeff Pan
commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - Faster than the air-speed velocity of an unladen european swallow -- To unsubscribe, e-mail: [EMAIL

Re: Could u plz tell me how to remove white spacees present between delimiter

2005-09-02 Thread Jeff Pan
, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - I mean, what is it about a decent email service? -- To unsubscribe, e-mail: [EMAIL PROTECTED

Socket Problem

2005-09-01 Thread Jeff Pan
) { $listen_socket-close; writelog($connection); exit 0; } $connection-close; } thanks. -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - A fast, anti-spam email service. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: how to replace multiple whit space with , .

2005-08-30 Thread Jeff Pan
, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response -- Jeff Pan [EMAIL PROTECTED] -- http://www.fastmail.fm - Faster than the air-speed velocity of an unladen european swallow