Re: Can't run PERL scripts on a shared server?

2008-05-11 Thread J. Peng
. If they don't permit running CGI, you most probably can't run the Perl scripts.Many web hosting providers have Perl/CGI enabled, you can try another one. But most providers disabled mod_perl, b/c it's so powerful that has the ability to harm the webservers. -- J. Peng - [EMAIL PROTECTED

question on unblocking the signals

2008-05-04 Thread J. Peng
(SIG_UNBLOCK,$signals); # statement 3 $listen_socket-close or die [EMERG] can't close listen socket\n; my $c = $sock; handle_the_content($c); $sock-close or die [EMERG] can't close established socket\n; exit 0; } } -- J. Peng - [EMAIL PROTECTED] Professional

Re: how to reun perl script on other pc without having to install perl

2008-05-03 Thread J. Peng
to compile perl scripts is always a bad idea. -- J. Peng - [EMAIL PROTECTED] Professional Chinese Squid supports http://SquidCN.spaces.live.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: perl module?

2008-05-02 Thread J. Peng
mydata3; my $d = mydata3-new; print $d-{key1}-[64]; -- J. Peng - [EMAIL PROTECTED] Professional Chinese Squid supports http://SquidCN.spaces.live.com/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: IDE for Perl in Linux

2008-05-02 Thread J. Peng
, but have to buy. Anybody knows a simple and good IDE Perl for Linux ? I believe, many Perl guys (including me) use VI/VIM under unix for their Perl editor. -- J. Peng - [EMAIL PROTECTED] Professional Chinese Squid supports http://SquidCN.spaces.live.com/ -- To unsubscribe, e-mail: [EMAIL

Re: perl module?

2008-05-02 Thread J. Peng
On Sat, May 3, 2008 at 1:26 AM, Levente Kovacs [EMAIL PROTECTED] wrote: The more language I learn, the more I think C(++) is the most flexible language. This is most probably you know C(++) better than others. For me I think Perl is flexible enough. -- J. Peng - [EMAIL PROTECTED

Re: IDE for Perl in Linux

2008-05-02 Thread J. Peng
On Sat, May 3, 2008 at 9:53 AM, Richard Lee [EMAIL PROTECTED] wrote: Can you tell me what extra benefit emacs will provide to perl programmar? I have sawn that: Emacs == Emacs Makes a Computer Slow :-) -- J. Peng - [EMAIL PROTECTED] Professional Chinese Squid supports http

Re: question on foreach loop

2008-05-01 Thread J. Peng
5 6 7 8 9 10 printing @data = 4 5 6 7 8 9 10 printing @data = 5 6 7 8 9 10 printing @data = 6 7 8 9 10 -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

Re: File Manipulation ??

2008-05-01 Thread J. Peng
/2000 755633040~04/26/1999 755763040~06/04/1998 -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: File Manipulation ??

2008-04-30 Thread J. Peng
255256040~04/29/1998 255293040~05/27/1999 255322040~12/09/1999 55322040~12/08/1999 755379040~04/30/1998 755383040~04/30/1998 755412040~01/19/1999 755612040~04/19/2000 755633040~04/26/1999 755763040~06/04/1998 -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe

Re: Creating PID file

2008-04-27 Thread J. Peng
) or die could not delete /var/run/$program; } As I have said (in fact it's said by Lincoln Stein), you should add a if statement here to avoid the childs delete the pid file when they're exiting. if ( $$ == $pid ) { # $pid is parent's pid unlink $pidfile or die $!; } -- J. Peng - QQMail

Re: Following links: What's wrong with me????

2008-04-27 Thread J. Peng
/WWW-Mechanize-1.34/lib/WWW/Mechanize/Examples.pod -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Getting error - Global signal requires explicit package name

2008-04-27 Thread J. Peng
back to ask us here. -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

the most pupular language - perl

2008-04-26 Thread J. Peng
I got it from my gmail newsletter, http://www.odinjobs.com/blogs/careers/entry/perl_php_python_and_ruby It seems perl is still the most popular language on internet.:-) -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Advice on how to approach character translation

2008-04-26 Thread J. Peng
; or: @signs = map { quotemeta } @signs; -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Advice on how to approach character translation

2008-04-26 Thread J. Peng
On Sat, Apr 26, 2008 at 7:54 PM, Dr.Ruud [EMAIL PROTECTED] wrote: J. Peng schreef: Dr.Ruud: Jenda Krynicky: @signs = map quotemeta($_) @signs; @signs = map quotemeta($_), @signs; (there was a comma missing) which you could even write as @signs = map quotemeta

Re: Creating PID file

2008-04-26 Thread J. Peng
$!; at the begin of the script. And at the END block of the script you should delete the pid file when script was exiting: END { unlink /path/program.pid if $$ = $pid; } -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Creating PID file

2008-04-26 Thread J. Peng
On Sun, Apr 27, 2008 at 9:50 AM, J. Peng [EMAIL PROTECTED] wrote: END { unlink /path/program.pid if $$ = $pid; sorry, it's == not =. unlink /path/program.pid if $$ == $pid; This avoid the child (if have) try to delete the pid file when it exits. } -- J. Peng - QQMail

Re: sql and perl

2008-04-26 Thread J. Peng
advice? -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Cannot get the simplest of SOAP servers running.

2008-04-25 Thread J. Peng
:13 AM, Philluminati [EMAIL PROTECTED] wrote: I am trying to follow this guide to make a perl based SOAP server: -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

Re: regex question

2008-04-25 Thread J. Peng
On Fri, Apr 25, 2008 at 12:47 AM, David Nicholas Kayal [EMAIL PROTECTED] wrote: why is the first one true? check 'perldoc perlre' : The following standard quantifiers are recognized: * Match 0 or more times \d* means 0 or more numbers. -- J. Peng - QQMail

Re: Properly displaying items from hash

2008-04-24 Thread J. Peng
; } close $hd; for (sort keys %hash) { print $hash{$_}, =, $hash2{$_}, \n; } __END__ Hope this helps. -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

Re: Perl-GD module installation

2008-04-23 Thread J. Peng
./configure --enable-shared To get both shared and static libraries, say ./configure --enable-shared --enable-static Generally you need the --enable-shared. Good luck with it. -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail

Re: Deletion of lines in file using perl

2008-04-23 Thread J. Peng
On Wed, Apr 23, 2008 at 8:56 PM, [EMAIL PROTECTED] wrote: Hi All, I need to delete some lines in file using Perl. The requirement is that I have one file which contains following lines. Please submit your question to [EMAIL PROTECTED]. -- J. Peng - QQMail Operation Team eMail

wrote-only language?

2008-04-23 Thread J. Peng
Someone said Perl is a wrote-only language, what does this mean? -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: help in reg. exp.

2008-04-21 Thread J. Peng
: if string is : OMS.FD.08.03.000.0 then regular expression should give OMS.FD.08.03.000 try: $str =~ s/\.0$//; -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http

a declaring

2008-04-21 Thread J. Peng
I'm not sure, but why this can work? use strict; use warnings; use Data::Dumper; my $y=0; my @x =(1,2,3) if $y; print Dumper [EMAIL PROTECTED]; Since $y is false, it seems @x shouldn't be declared. But why the last print can work? -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED

Re: a declaring

2008-04-21 Thread J. Peng
? my $y=0; my @x =(1,2,3) if $y; print Dumper [EMAIL PROTECTED]; Thanks! -- J. Peng - QQMail Operation Team eMail: [EMAIL PROTECTED] AIM: JeffHua -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Please let me know where can I find practice exercises

2008-04-10 Thread J. Peng
Learning Perl has exercises after each charpter. On 4/10/08, hemanth [EMAIL PROTECTED] wrote: Hi, I am currently learning perl programming. Please help me by giving some practice exercises or direct me to the site where i can find them. Thanks in Advance! Hemanth -- To unsubscribe,

Re: find files created/accessed in last n hours

2008-04-09 Thread J. Peng
use File::Find can do that. or use the unix 'find' command: find /path -type f -mmin -240 On 4/10/08, nag [EMAIL PROTECTED] wrote: hi, please help me to get all the files present in a directory which are created/accessed in last 4 hours . thanks Nagesh -- Thanks Nagesh -- To

Re: rsync perl script

2008-03-21 Thread J. Peng
when running rsync with -v argument and when it get failed on executing, it will report the errors by itself. you could say my @info = `rsync -av ` in your perl scripts and check the executed results in the @info. On Fri, Mar 21, 2008 at 3:07 PM, Kaushal Shriyan [EMAIL PROTECTED] wrote: Hi

Re: contributing to perl

2008-03-21 Thread J. Peng
You can contribute it to CPAN as a single perl script. See this guide: http://www.cpan.org/misc/cpan-faq.html#How_contribute_scripts On Fri, Mar 21, 2008 at 2:23 PM, Sharan Basappa [EMAIL PROTECTED] wrote: Hi, I was thinking of contributing a utility function to perl. Want to know what is

Re: how to get in depth Directory statistics

2008-03-21 Thread J. Peng
On Fri, Mar 21, 2008 at 5:01 PM, jeevs [EMAIL PROTECTED] wrote: My question is.. Is there already a perl module which will be able to parse the directory structure and give me the required output. sure.like Filesys::Tree module on cpan. For example, the code below, use Filesys::Tree

Re: contributing to perl

2008-03-21 Thread J. Peng
On Fri, Mar 21, 2008 at 5:55 PM, Sharan Basappa [EMAIL PROTECTED] wrote: Thanks, I will take a look. But going by the webpage, it seems to me that the changes will to the language itself and chnages to compiler. But what I want to contribute is a subroutine? Is this the right way to go?

Re: create multiple hash

2008-03-21 Thread J. Peng
creating a multiple hash is the same as you create a common hash. you can do, my %value; $value{'172.16.1.45'} = {'google' = 34}; $value{'172.15.2.34'} = {'yahoo' = 45}; etc. to show the hash structure, use Data::Dumper: use Data::Dumper; print Dumper \%hash; to print the hash, use a for loop:

Re: contributing to perl

2008-03-21 Thread J. Peng
am writing might fit perfectly in math module. On Fri, Mar 21, 2008 at 3:31 PM, Sharan Basappa [EMAIL PROTECTED] wrote: ok. That clarifies ... On Fri, Mar 21, 2008 at 3:29 PM, J. Peng [EMAIL PROTECTED] wrote: On Fri, Mar 21, 2008 at 5:55 PM, Sharan Basappa [EMAIL

Re: perl on win32

2008-03-21 Thread J. Peng
On Fri, Mar 21, 2008 at 6:43 PM, sanozuke [EMAIL PROTECTED] wrote: but what do i need to make Perl run in windows and in Visual studio C++ express edition? Perl can run on windows well, but not under VC++ software. Check the ActiveState Perl tools for you, http://www.activestate.com/ -- To

Re: rsync perl script

2008-03-21 Thread J. Peng
On Sat, Mar 22, 2008 at 12:28 AM, Kaushal Shriyan [EMAIL PROTECTED] wrote: my @info = rsync -av /var/lib/mysql [EMAIL PROTECTED]:/var/lib/ ; It should be: my @info = `rsync -av /var/lib/mysql [EMAIL PROTECTED]:/var/lib/`; -- Jeff (Joy) Peng Tencent QQMail Dept. -- To unsubscribe, e-mail:

Re: extracting values from split without using an array

2008-03-10 Thread J. Peng
On Mon, Mar 10, 2008 at 1:37 PM, igotux igotux [EMAIL PROTECTED] wrote: I tried split(/\s+/,$var)[1] which is not working as i expected. You may be moving from python,:) In perl you should say, (split /\s+/,$var)[1]; because split /\s+/$var returns a list, use () to enclose the list's scope.

Re: address translation

2008-02-21 Thread J. Peng
On Thu, Feb 21, 2008 at 4:03 PM, John W. Krahn [EMAIL PROTECTED] wrote: So 0x would indicate a network with no hosts on it and thus it is not a valid netmask. yup, but sometime we need a 255.255.255.255 netmask to forbit the host don't reply to any ARP requests. for example, you

Re: address translation

2008-02-21 Thread J. Peng
On Thu, Feb 21, 2008 at 4:11 PM, J. Peng [EMAIL PROTECTED] wrote: On Thu, Feb 21, 2008 at 4:03 PM, John W. Krahn [EMAIL PROTECTED] wrote: So 0x would indicate a network with no hosts on it and thus it is not a valid netmask. yup, but sometime we need a 255.255.255.255

address translation

2008-02-20 Thread J. Peng
how to translate this mask to clear text form with perl? netmask 0x thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: address translation

2008-02-20 Thread J. Peng
On Thu, Feb 21, 2008 at 3:29 PM, John W. Krahn [EMAIL PROTECTED] wrote: J. Peng wrote: how to translate this mask to clear text form with perl? netmask 0x If you mean an IP address netmask then 0x is an invalid netmask because all the bits are 1. John, all 1 means

Re: Hash values as array indexes inside Arrays

2008-02-16 Thread J. Peng
On Feb 16, 2008 1:57 PM, [EMAIL PROTECTED] wrote: @data = ( { crc = $crcerrs[$i], overrun = $overrunerrs[$i], inputerrs = $inputerrs[$i] } ); }; This overide the array each time. You need a 'push' at each loop: push @data, { }; good luck. -- To unsubscribe, e-mail: [EMAIL

useragent to support javascript

2008-02-01 Thread J. Peng
Hello, I wrote a script using WWW::Mechanize, when I run it I got bad results, it said my browser has no javascript supported. Do you know how to fake the header declaring my useranget has enabled javascript? Thanks! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

WWW::Mechanize's JS plugin

2008-02-01 Thread J. Peng
I found this module on cpan: http://search.cpan.org/~sprout/WWW-Mechanize-Plugin-JavaScript-0.002/lib/WWW/Mechanize/Plugin/JavaScript.pm#PREREQUISITES But it says, To load the plugin, just use WWW::Mechanize's use_plugin method (note that the current stable release of that module doesn't

Re: A way to comment out a block of code

2008-01-15 Thread J. Peng
you may consider to use a pod section for commenting out a code block. I have used these ways, maybe not good, but they can be used.:) 1) put the code block in a subroutine,and never call that routine. sub no_use { code block } 2) assign the code block to a variable, and never use that

Re: export variables

2007-12-29 Thread J. Peng
On Dec 29, 2007 8:32 PM, [EMAIL PROTECTED] wrote: Hello, Could someone tell me if this is possible and if it is how I do it. I have the following two file; file1.pl --- print $testvar\n; --- file2.pl --- my $testvar = 37; use file1.pl; --- If I run file2.pl (perl file2.pl) I will