is there //= operator?

2011-08-02 Thread terry peng
I have forgot that, is there a //= operator in Perl? which should do the same stuff as: unless (defined($foo) ) { $foo = ...; } Thanks.

how to validate the string is Chinese only?

2011-03-09 Thread terry peng
Hello, I got the form value from web client, and I want to validate the value string include Chinese words only. How to do this? Thanks in advance. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Regular expression to delete from a string unseen characters

2011-03-07 Thread terry peng
> > I have a data that contain unseen characters that I want to delete. > The unseen characters can be ^L, ^N and other sign that I cannot copy but I > see them in my data. > > Is someone know which regular can help me. May you try the "dos2unix" command? -- To unsubscribe, e-mail: beg

Re: Auto correction of typos

2011-03-06 Thread terry peng
Sat, 5 Mar 2011 12:23:49 +0530 письмо от Ramprasad Prasad : > I have a web form where people sign up for updates by filling in their email > address > > A lot of users end up not receiving the confirmation mailer because of typos > in the email id > Like yhaoo.com or hotmaill.com > MaxMind

Re: How does the function loading works in Perl

2011-03-02 Thread terry peng
2011/3/3 Parag Kalra : > Hi, > > I have this basic question from a long time now, so thought of asking. > > A Perl script may have many functions. When we execute the script via Perl > Interpreter, does all the functions are loaded into memory? > Though there is a stuff called "AUTOLOAD", but I th

Re: How to list all Linux machines info with perl ?

2011-02-28 Thread terry peng
Try again with Net::SNMP. 2011/3/1 sync : >  Hi, all : > > > I have many linux machines connected in a network. > Now I want ot create a perl script which will list all the machines info  in > a network. > > > Like the following : > - > Host:  xxx > OS:  xxx > Kernel :xxx >

Re: Threads and garbage collection

2011-02-23 Thread terry peng
2011/2/24 Shlomi Fish : > On Wednesday 23 Feb 2011 18:52:30 siegfr...@heintze.com wrote: >> I apologize if this appears multiple times. When I did not see it >> appear, I posted again. >> >> >> Does perl have a feature like C# and Java where memory is reclaimed and >> defragmented? >> >> >> I just

about perl -wl

2011-02-22 Thread terry peng
Hi, when I put this line in a script say a.pl: #!/usr/bin/perl -wl ... And later I run it from the command line: perl a.pl so, does this make perl ignore the "wl" switch in the script? Thanks. -- Free SmartDNS Hosting: http://DNSbed.com/ -- To unsubscribe, e-mail: beginners-unsubscr...@per

Re: Calling a PHP function from a Perl script.

2011-02-18 Thread terry peng
Fri, 18 Feb 2011 11:53:02 -0600 письмо от "Mike Blezien" : > Hello, > > this is kinda of a crossover to PHP which I'm not that fimilar with. > > I have a Perl script that needs to call up a specific function from a PHP > script, Entry.php calls "Social_preformPost()" function. I simply need

return ()

2011-02-10 Thread terry peng
does "return ()" mean return an empty list, or just mean "return" since "()" is optional in Perl? thanks!

Re[2]: about return

2011-02-10 Thread terry peng
Thu, 10 Feb 2011 10:04:55 +0200 письмо от Shlomi Fish : > > In List context it will return an empty list. You may have meant in scalar > context in which case: > > Sorry , my typo. I did mean the scalar context. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional com

Re[2]: about return

2011-02-09 Thread terry peng
Wed, 9 Feb 2011 22:44:10 -0800 (PST) письмо от "C.DeRykus" : > On Feb 9, 10:07 pm, terry.p...@mail.ru (terry peng) wrote: > > hello, > > > > when in the case "return undef" I prefer just "return" coz in list context > it will return

Re[2]: about return

2011-02-09 Thread terry peng
> > return 1 if $exists ; > return ; > > then it is easy to see what conditions will return what values. no need > for if/else blocks or noisy ?: ops. > That's a good solution. Thanks much. :) -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginner

about return

2011-02-09 Thread terry peng
hello, when in the case "return undef" I prefer just "return" coz in list context it will return an empty list. my $exist = ... if ($exist) { return 1; } else { return; } the code above can work, but having many lines. So I want: return $exist ? 1 : (...); what should be put in (...)

text encoding

2011-02-08 Thread terry peng
Hello, How to know that the given text is with which encoding method? for example, is it ISO-8859-1, UTF-8, KOI8-U, or others? Thanks.

Re: config file modules confusion

2011-02-07 Thread terry peng
Mon, 7 Feb 2011 18:11:01 -0800 (PST) письмо от Jim Green : > Hello > I searched cpan and was overwhelmed by the number of modules > available. > > I want a config module that can do updates well, preserving formats of > original file, preserving blank lines, comments, etc. which one should >

Re[2]: perl's threads

2011-02-07 Thread terry peng
Thanks Shlomi. Your statement is a great guide to perl threads to me. I'm checking the AnyEvent module which looks wonderful. Thanks again. Mon, 7 Feb 2011 12:30:32 +0200 письмо от Shlomi Fish : > > Well, let me quote the perlbot ( on Freenode's #perl ) factoid: > > [quote] > >Before

Re[2]: Attachment in Excel format?

2011-02-06 Thread terry peng
Sun, 06 Feb 2011 18:18:09 -0800 письмо от David Newman : > > This is a multi-part message in MIME format. > > --_--=_1297044547631150 > Content-Disposition: inline > Content-Transfer-Encoding: 8bit > Content-Type: text/plain > > Here's the GIF file you wanted > --_--=_1297044

Re[2]: perl's threads

2011-02-06 Thread terry peng
Sun, 06 Feb 2011 16:21:58 +0100 письмо от "Dr.Ruud" : > On 2011-02-06 12:12, terry peng wrote: > > > What's the suggested module for perl's threads? > > I have been using Perl 5.12 under linux. > > Stay away from threads. Design and develop in a

Re: Attachment in Excel format?

2011-02-06 Thread terry peng
what's the message header you got in thunderbird? Have you set the "Disposition" option to "attachment" rather than the default "inline"? Regards. Sun, 06 Feb 2011 15:38:44 -0800 письмо от David Newman : > Greetings. I'm looking for a way to run a query against a SQL database, > save the resu

Re[2]: perl's threads

2011-02-06 Thread terry peng
Sun, 06 Feb 2011 08:54:50 -0500 письмо от Shawn H Corey : > On 11-02-06 07:10 AM, Octavian Rasnita wrote: > > From: "terry peng" > >> What's the suggested module for perl's threads? > >> I have been using Perl 5.12 under linux. > >> &

perl's threads

2011-02-06 Thread terry peng
What's the suggested module for perl's threads? I have been using Perl 5.12 under linux. Thanks.