regex matching statements

2024-06-18 Thread Jeff Peng via beginners
Hello list, are these statements the same in perl? $ perl -le '$_="abc";if (!/\w+\d+/){print "not matched"}' not matched $ perl -le '$_="abc";if ($_ !~ /\w+\d+/){print "not matched"}' not matched or which is the better one? Thanks. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org Fo

Re: perl cookbook?

2012-02-29 Thread Jeff Peng
On Wed, 29 Feb 2012 16:16:30 +0200, Brent Clark wrote: Hiya Im looking to buy perl cookbook. I see the second edition was released 2003. Before I go off and buy it, does anyone know if perl cookbook 3rd edition, is ever going to be published? IIRC the book "Perl by examples" has the 5th e

Re: Rsync doesnot work

2012-02-13 Thread Jeff Peng
于 2012-2-14 13:14, Punit Jain 写道: This works manually if I run this script however under crontab it doesnot. Any clue what could be the issue ? How about the environment variables? For example, you maybe have setup the value of RSYNC_PASSWORD in the shell, but the value becomes not effective

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Jeff Peng
于 2012-2-9 15:21, Parag Kalra 写道: By data-structures being used, I mean the data structures that are actually *declared* in the script. And is it possible to find at least the data-structures stats of the current script that is getting executed if no parser is available. For example if I hav

Re: unexpected results

2012-02-08 Thread Jeff Peng
于 2012-2-9 14:10, lina 写道: On Thu, Feb 9, 2012 at 1:44 PM, Jeff Peng wrote: > 于 2012-2-9 12:44, lina 写道: > >> $string =~ m/(\S+)(and|or)(\S+)/; > > > $string =~ m/(\S+)\s+(and|or)\s+(\S+)/; Wow, thanks how does that one not work as expected, I am reading brian

Re: unexpected results

2012-02-08 Thread Jeff Peng
于 2012-2-9 12:44, lina 写道: $string =~ m/(\S+)(and|or)(\S+)/; $string =~ m/(\S+)\s+(and|or)\s+(\S+)/; HTH. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Jeff Peng
于 2012-2-9 10:15, Steve Bertrand 写道: I would suspect that this would be something that would have to run against the file itself, even prior to compile. Curious task. Might I ask what the purpose of your desire is? I am also not sure what's the special purpuse of the OP. Some modules on CP

Re: how to understand shift?

2012-02-07 Thread Jeff Peng
于 2012-2-7 15:45, lina 写道: I am sorry, still don't get. $year = shift part Try with this code: use strict; my $month = "December"; my $year = "2007" ; header($month,$year); sub header { print '@_ is: ' . "@_\n"; my $month = shift ; print '@_ is: ' . "@_\n";

Re: how to understand shift?

2012-02-06 Thread Jeff Peng
于 2012-2-7 15:07, lina 写道: my $month = shift ; my $year = shift ; here after shift the $year becomes null? http://perldoc.perl.org/functions/shift.html after shift the @_ becomes null. $year is 2007. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For addit

Re: The Perl Programming Language

2012-01-28 Thread Jeff Peng
On Sun, 22 Jan 2012 13:47:26 +, Lívio Cipriano wrote: Hi, I'm new to Perl but old in other programming languages. Is there a equivalent book in Perl as to the The C Programming Language? Regards Lívio Cipriano http://backpan.perl.org/authors/id/Q/QU/QUONG/perlin20.html A guide to Perl 5

Re: Schwartzian Transform

2012-01-17 Thread Jeff Peng
于 2012-1-18 11:31, Chris Stinemetz 写道: Would someone kindly advise me in sorting this array: my @array = qw(c r v vr tr re c.p[1] c.p[3] c.p[2] c.p[4] c.p[7] c.p[6] c.p[5] c.p[8] c.t[1] c.t[3] c.t[2]); I only want to sort the elements that have a numeric value inside the braces so that all the

Re: How to merge multiple array elements

2012-01-15 Thread Jeff Peng
于 2012-1-16 1:18, Pradeep Patra 写道: It works and displays 1-12. But I need something different because i dont know the value of "n" beforehand. So I decided to use a for loop. I tried push but it did not work. I would appreciate any help to merge multiple array elements preferably not using any l

Re: Inserting a new data structure in a bless reference

2012-01-13 Thread Jeff Peng
于 2012-1-14 11:25, Parag Kalra 写道: use FooBar; my $obj = FooBar->new; Do something ... $obj->{'new_key'} = 'some_value' Now I am not sure if that is the correct way of inserting a new data structure into an already bless reference I don't think you should modify the blessed obj

Re: comparing arrays

2012-01-11 Thread Jeff Peng
Just from the subject, for comparing arrays, I have been using Array::Diff which works always fine for me. I have a script where I have captured the value on the left side of the "=" as the header for my table. Now I want to take the value on the right side of the "=" sign and populate a new r

Re: perl process forking tutorial recommendation

2011-06-15 Thread Jeff Peng
And the book "Network programming with Perl" is a good book for Perl client/server development including the fork stuff. > -Original Message- > From: dery...@gmail.com > Sent: Wed, 15 Jun 2011 13:11:38 -0700 (PDT) > To: beginners@perl.org > Subject: Re: perl process forking tutorial recom

Re: remove duplicate elements from an array

2010-12-18 Thread Jeff Peng
Original-Nachricht > Datum: Fri, 17 Dec 2010 20:07:33 -0800 > Von: David Christensen > > You should buy the Perl Cookbook: > > http://oreilly.com/catalog/9781565922433 > > does the cookbook have a new edition? I remember I have read it several years ago. Jeff. -- Ne

Re: Real life usage

2010-12-18 Thread Jeff Peng
Original-Nachricht > Datum: Sat, 18 Dec 2010 17:30:38 +0100 > Von: Francesco Di Lorenzo > An: "beginners@perl.org" > Betreff: Real life usage > What role do Perl have in your work? In which particular projects you use > it? Do you use it for particular piece of your softwares'

Re: Linux Uptime

2010-12-16 Thread Jeff Peng
于 2010-12-17 11:29, Shawn H Corey 写道: Every "file" in it is a pipe that can be read using regular file handles. And I believe only Linux does this. Yep.Also the OP is asking exactly about linux. -- Jeff Peng jeffp...@gmx.net -- To unsubscribe, e-mail: beginners-unsubscr...@pe

Re: Linux Uptime

2010-12-16 Thread Jeff Peng
于 2010-12-17 9:32, Matt 写道: I have a perl script but I want to exit it if the uptime on the server is less then say an hour. Any idea how I would get uptime with perl? $ cat /proc/uptime 4205976.64 4017280.59 The first column is the host's uptime seconds. Jeff. -- To unsubscribe, e-mail: be

Re: install a package on windows

2010-12-15 Thread Jeff Peng
于 2010-12-16 7:06, Sisyphus 写道: ppm install MinGW I think that gives you both the MinGW port of the gcc compiler and dmake (which is the make utility you'll be using ... not gmake). If you find that dmake is not installed by running 'ppm install MinGW', then run: ppm install dmake Once MinGW a

install a package on windows

2010-12-15 Thread Jeff Peng
Hi, I have intalled activeperl 5.10 on windows and try to install a perl package. But I can't find the package in activeperl's "perl package manager" though this package does exist in CPAN. Also my windows doesn't have gcc/gmake installed. So how to install this kind of package? Thanks. Regards.

Re: Array Question

2010-12-15 Thread Jeff Peng
于 2010-12-15 1:38, Jim Gibson 写道: or the File::Find module to find files without resorting to the use of separate processes and shell commands. Me second. File::Find is your friend. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.o

Re: how to remove (^M ^G ) characters

2010-10-28 Thread Jeff Peng
form where i can find what these characters are and their ascii values?..any sugges would be really helpful You get the files from windows to un*x? try the command 'dos2unix'. -- Jeff Peng http://nsbeta.info -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional c

Re: Time Subroutine

2010-10-26 Thread Jeff Peng
ration system's uptime then it's much difference from the current time. -- Jeff Peng http://nsbeta.info -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Please suggest a good book on perl

2010-10-23 Thread Jeff Peng
> Hey All, > > Just finished reading 'intermediate perl' Enjoyed it as much as I > enjoyed the book 'learning perl' > > Thanks Randal, Tom & All > > Please now suggest another must read nook on perl. > why not "network programming with Perl"? This book will give you much more knowledge than perl i

Re: Object introspection + adding method

2010-10-23 Thread Jeff Peng
> On Sat, Oct 23, 2010 at 07:52:50PM +0200, Shlomi Fish wrote: > > Just be sure you know what you are doing. Adding a method to somone > else's > class can be considered rude. See the NOTE in perldoc perlmodlib. > He/she is maybe coming from other language like Ruby. In ruby it's free to add me

Re: MySQL database entry delta report

2010-10-17 Thread Jeff Peng
statistics from it. -- Jeff Peng http://nsbeta.info -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: perl real life exercise

2010-10-15 Thread Jeff Peng
于 2010-10-15 15:02, Agnello George 写道: HI Is there any site or any book other than "learning perl" where i would get real life exercises on perl scripting. Thanks perl cookbook. -- Jeff Peng http://nsbeta.info -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For

Re: help on perlform

2010-10-08 Thread Jeff Peng
于 2010-10-7 16:13, Shlomi Fish 写道: > > In case you haven't read the book "Perl Best Practices" (which you should), > you should know that http://search.cpan.org/dist/Perl6-Form/ would be > preferable over the built-in perlform which has horrible behaviour. > Ah OK, in fact I used neither of the

Re: perl module to search for misspellings

2010-10-06 Thread Jeff Peng
> Hi there List members, > > I have millions of SQL records that I searching with lots of poorly > entered data and I am trying to match these records based on matching > text. > A database with well designed tables should be processing the data much faster than perl IMO. -- To unsubscribe, e-

Re: help on perlform

2010-10-06 Thread Jeff Peng
> Hi folks, > Can anyone please explain what is "perlform" and its > usage.I used google but i was not able to crack. Try "perldoc perlform". Cheers! -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl

Re: Urgent Request

2010-10-05 Thread Jeff Peng
> The method mentioned is to get the output while u are running the perl > files > at the shell prompt not in the code.. > if u want to save the log details after the perl files are processed then > use this function > > sub file_write { > $_file = shift; > $_data = shift; > open FILE,"

Re: Urgent Request

2010-10-05 Thread Jeff Peng
> You could use filehandle to save the output outcome. > > use strict; > open OUT, ">outfile.txt"; ## at the beggining > > and for instance: > print OUT $seq->id(),"\n"; > or use Perl's "select". but that requires the OP to modify the source code, which is maybe not what he/she want. Regards. -

Re: Urgent Request

2010-10-05 Thread Jeff Peng
> Sorry doesnt work. > > Error is : > > Can't locate object method "perl" in 'filename'... > what's the content of the script? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Urgent Request

2010-10-05 Thread Jeff Peng
> Hello, > > Can anyone please tell me how to save output (what we get after running a > perl script) as an external file? > run it under a unix shell? try: perl a.pl > a.txt 2>&1 save all the output of a.pl to a.txt. 2>&1 means to capture the script's error output also. -- To unsubscribe, e

Re: perl or python

2010-10-05 Thread Jeff Peng
> Hi > > Is it better to learn Perl or Python since i can manage only writing > simple bash shell scripts. > > Please suggest/guide. > Since you are coming from shell, Perl is better for the beginning. from wikipedia (http://en.wikipedia.org/wiki/Perl): Perl borrows features from other programmi

Re: perl vs Python

2010-10-05 Thread Jeff Peng
> ( i did'nt know where to post this; perl forum or python forum ) > > I am a bit confused, i have been learning perl last 1.5 yrs .. then > suddenly in my new company they use python to do all their scripting work > , > so i would have to follow protocol :) and learn python > > So now just wan

Re: perl

2010-10-05 Thread Jeff Peng
>> On Mon, Oct 4, 2010 at 9:49 AM, sheikh numan iqbal > >wrote: >> >> > hi, >> > >> > i want to login and need help on perl... >> > In some nations "login" means "step into the door". So for learning perl you may go: http://learn.perl.org/ Good luck. -- To unsubscribe, e-mail: beginners-uns

Re: update bind via net::dns

2010-08-31 Thread Jeff Peng
.INT; >  secret mykeyishere; > }; > > inserted it into my script and run it. > I always get > "Update error code: REFUSED" > This is most likely a DNS updating problem rather than the perl problem. Please send the question to Bind's mailing list. https://lists.isc.org/mailma

Re: Perl modules

2010-08-19 Thread Jeff Peng
root/ local::lib is maybe what you want. -- Jeff Peng Web: http://home.arcor.de/pangj/ Blog: http://squidcn.spaces.live.com/ -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Opposite benchmark results between Linux and Windows

2010-08-14 Thread Jeff Peng
Perl_my_strftime in [util.c][0] if you want to check). > I ran your code against 5.12.1, 5.10.0, and 5.8.9 on OS X and got > Me also. Didn't get big difference among the three versions for that function. -- Jeff Peng Web: http://home.arcor.de/pangj/ Blog: http://squidcn.spaces.live.co

Re: Connecting to a socket

2010-03-31 Thread Jeff Peng
e got a script or can point me in the right direction? > Hi, Could you use Net::SMTP and enable the debug option to trace the process? -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: begi

Re: Ternary operator: Am I missing something?

2010-03-29 Thread Jeff Peng
On Mon, Mar 29, 2010 at 10:27 PM, Shlomi Fish wrote: >> >> No. ($foo == 1) is a list which always has a value of either 1 or 0 so >> it really return a true value in both cases. > > Not true: > > {{{ > shlomi:~$ perl -le '$foo = 0; print +($foo == 1) ? "Foo is 1" : "Foo is not > 1"' > Foo is not

Re: Ternary operator: Am I missing something?

2010-03-29 Thread Jeff Peng
   $bar = 0 : >        $bar = 1; > > These are logically equivalent, right? No. ($foo == 1) is a list which always has a value of either 1 or 0 so it really return a true value in both cases. -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-u

Re: help on a soap client

2010-03-29 Thread Jeff Peng
.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- 内部异常堆栈跟踪的结尾 --- 在 System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) 在 System.Xml.Serialization.XmlSerializer.Deserialize

Re: help on a soap client

2010-03-29 Thread Jeff Peng
Thanks Rob so much for the sample code. I will try it following your direction, thanks. On Mon, Mar 29, 2010 at 6:42 PM, Rob Coops wrote: > Got it, I for got to indicate the arrays there. The code below will produce > the following output. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.

Re: help on a soap client

2010-03-29 Thread Jeff Peng
On Mon, Mar 29, 2010 at 5:56 PM, Shlomi Fish wrote: >1. SOAP::Lite is no longer recommended. You should use SOAP::WSDL or >XML::Compile::SOAP instead. (According to the perlbot factoid on >irc.freenode.org ) Thanks Shlomi, let me check them. -- Jeff Peng Email: jeffp...@netzero.

Re: help on a soap client

2010-03-29 Thread Jeff Peng
s wrote: > > > On Mon, Mar 29, 2010 at 11:36 AM, Jeff Peng wrote: >> -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

help on a soap client

2010-03-29 Thread Jeff Peng
Hello, I want to post some data to a webservice which is .NET powered. The webservice's developer tell me the request should be: POST /Service/IndicatorsService.asmx HTTP/1.1 Host: 192.168.1.100 Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "http://tempuri.org/DataUpLo

Re: reutun undef

2010-03-25 Thread Jeff Peng
Thanks all. for "return ()", does it mean return an empty list, or return with no argument? -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

reutun undef

2010-03-24 Thread Jeff Peng
>>> "return" statement with explicit "undef" at line 185, column 9. See page >>> 199 of PBP. (Severity: 5) I got the cpan test report, it pointed out the one above. Is "return undef" not to be encouraged in current Perl? Thanks. -- Jeff Pen

Re: IOScalar with threads dose not work

2010-03-23 Thread Jeff Peng
2010/3/23 Shlomi Fish : > > 2. Don't use threads in Perl. They cause too many problems. > Does it still have many problems until now? I ask it just because I wrote many code with Perl threads in my work, they seem work nice. -- Jeff Peng Email: jeffp...@netzero.net Skype: compu

Re: why on while?

2010-03-11 Thread Jeff Peng
No. Even having just 0 in a line won't make the line lost without defined. $ perl -e 'print "1\n2\n3\n0"' > a.txt $ perl -e 'open FD,"a.txt"; while(my $line=) { print $line }' 1 2 3 0 -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperso

Re: why on while?

2010-03-08 Thread Jeff Peng
o how about while (my $line = ) instead of using $_? -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Copy files from one machine to another machine

2010-03-03 Thread Jeff Peng
t has already given the examples. http://search.cpan.org/~ivan/Net-SCP-0.08/SCP.pm -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: make an alias to function

2010-02-15 Thread Jeff Peng
same stuff. Now I got it. :) -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

make an alias to function

2010-02-15 Thread Jeff Peng
bj = abc->new; $obj->init_squid_for_reverseproxy; The error says: Can't locate object method "init_squid_for_reverseproxy" via package "abc" . Why? OK I simply updated the alias definition to: *init_squid_for_reverseproxy = \&init_reverseproxy; This works as I w

Re: PayPal API

2010-02-15 Thread Jeff Peng
it? > Hi MIke, I never used this module by myself. But the module's author was active on mod_perl's mailing list IIRC. You may repost the question to that list to expect an answer. -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsub

Re: How to keep script alive if my shell closes

2010-02-13 Thread Jeff Peng
RR to a file handle if doing it in the script. btw, Cheers Chinese New Year for all Chinese Perl users. -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Perl Hiding Username/Password

2010-02-10 Thread Jeff Peng
On Thu, Feb 11, 2010 at 7:04 AM, newbie01 perl wrote: > The worry is someone getting access to the script and then putting in some > print commands to expose the username and password information. Could take a look at: perldoc -q 'hide the source' -- Jeff Peng Email: jeff

Re: Perl CGI advise/feedback please ...

2010-02-10 Thread Jeff Peng
d to get the application secure. -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: prepare(SELECT ... FROM TABLE) error

2010-02-10 Thread Jeff Peng
On Thu, Feb 11, 2010 at 2:03 AM, Jay Savage wrote: > > $@ is also *guaranteed*--in the words of perlfunc--to be set > correctly. I believe that historically this may not have been the > case: $@ may have only been set on failure and not flushed on success, > but in recent Perls it should be reliab

Re: How to keep script alive if my shell closes

2010-02-10 Thread Jeff Peng
On Wed, Feb 10, 2010 at 2:40 AM, Ariel Casas wrote: > > My question is; how do I keep my perl script from dying if my shell > window accidentally closes while my perl script is paused at the > system function portion of my script? Hi, Make a daemon process for running in the script, or use nohu

Re: XML to RDF using O O Perl

2010-02-10 Thread Jeff Peng
On Thu, Feb 11, 2010 at 6:00 AM, Aravind Venkatesan wrote: > Hello, > > I am new to perl. I am trying write a Perl module to convert KGML (XML file) > to RDF format .  Could anybody suggest as to how to go about this (just to > give me a start). > Hi, You may pick a book for learning some base k

Re: variable scope

2010-02-06 Thread Jeff Peng
nother module and have them > visible in the main:: scope as local variables. > I once wrote a simple document for it, see: http://home.arcor.de/pangj/share_variables_between_perl_scripts.txt HTH. -- Jeff Peng Email: jeffp...@netzero.net Skype: compuperson -- To unsubscribe, e-m

Re: Archive::Zip library on Solaris

2010-01-25 Thread Jeff Peng
> I have a Perl Script that uses some of the Archive::Zip's methods for > reading zip entries. Works fine on Linux, BUT on Solaris, this lib is not > available in Solaris and I'm not allowed to install any lib in it. Is there > a way to load the archive::zip lib dinamically, without installing it

Re: Win32 version 0.27 required

2010-01-21 Thread Jeff Peng
> Hi, > > I'm running Perl on Windows XP, and have a script which I've run for > ages with no problems. However, I now have a message per below: > > "Win32 version 0.27 required--this is only version 0.24 at D:/Perl/lib/ > Cwd.pm line 663." > > .. .and the script quits on me. > You may want t

Re: how to convert perl file into binary

2010-01-20 Thread Jeff Peng
在 2010-01-21四的 10:51 +0530,V U Maheswara rao k写道: > Hi All, > > can I convert perl file into binary file? So that my code will be secure/. > perldoc -q 'hide the source' -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://

Re: Data file with records that span two lines

2010-01-18 Thread Jeff Peng
在 2010-01-19二的 00:09 -0500,Perl Noob写道: > I have a data file with thousands of records. The problem is that the > records in the data file span two lines for each record. I want to > write a perl script that makes each record a single line. The file > looks like this: > HI, If you are using a

Re: Geeky way to wish Happy Birthday through Perl

2010-01-17 Thread Jeff Peng
在 2010-01-17日的 23:34 +0530,Parag Kalra写道: > Hello All, > > I am looking for a geeky way to wish someone on his Birthday with the help > of Perl. > > Condition is - It should be one liner which I can directly execute from the > command line. > > EG: perl -e "print 'Happy Birthday Larry!!!'" > G

Re: Basic Domain and IP Info

2010-01-17 Thread Jeff Peng
在 2010-01-17日的 11:16 -0600,Mike Blezien写道: > Hello, > > I've been looking for some basic domain/IP info that we can generate for > domain/IP addresses entered from a form. I've been searching CPAN without > much > luck, but maybe looking in the wrong places. What I like to do is obtain the > f

Re: perl to flash

2010-01-08 Thread Jeff Peng
On 五, 2010-01-08 at 14:36 -0500, Uri Guttman wrote: > > i hate to be the police on questions here but recently we seem to have > been getting a fair number of them that are not beginner level. > Before stopping anyone from posting this "NON-Begin" questions, you must be able to define "what's a

Re: Regarding module Mail-Box, and accessing "subject" field of a MBOX message

2010-01-08 Thread Jeff Peng
On, 2010-01-07 at 11:24 -0800, Shankar wrote: > Hello, > > I'm using CPAN module, Mail-Box-2.093, to parse and process my MBOX > file on Unix. > > I have a message as follows. > I have an email, when I open in PINE on Unix, it shows the header as: > [utf-8] Recommendation Letter... > > When I tr

regex optimization

2010-01-04 Thread Jeff Peng
Hello, Can the code (specially the regex) below be optimized to run faster? #!/usr/bin/perl for ($i=0; $i<1000; $i+=1) { open HD,"index.html" or die $!; while() { print $1,"\n" if /href="http:\/\/(.*?)\/.*" target="_blank"/; } close HD; } The "index.html" is got from: wget http://www.265

Re: Script to create huge sample files

2010-01-03 Thread Jeff Peng
Parag Kalra: Hmmm - http://search.cpan.org/~dankogai/Encode-2.39/lib/Encode/Guess.pm It says right at the bottom that below method won't work to guess the encoding. :( Encode::Guess maybe work, but not so exactly. Because some Code Bits of an encoding are overlapped (for example,gb2312 and

Re: Script to create huge sample files

2010-01-03 Thread Jeff Peng
Parag Kalra: I am curious to know more on UTF and understand related issues that may creep in my algorithm. Could someone please shed some light on it. Can I use following: use Encode; while(<$sample_file_fh>){ # Encoding into utf data $utf_data = encode("utf8", $_); For the line a

Re: Clone an object

2009-12-28 Thread Jeff Peng
Uri Guttman: and i bet you really don't need this but you just think you do. why not? I did have used object clone, like a ruby one: > class Myclass > end => nil > x=Myclass.new => # > y=x.clone => # > x.object_id => -605921708 > y.object_id => -605931318 The object was cloned, they b

Re: force using the version of a module

2009-12-26 Thread Jeff Peng
Peter Scott : % perldoc -f use use Module VERSION LIST use Module VERSION [...] If the VERSION argument is present between Module and LIST, then the "use" will call the VERSION method in class Module with the given version as an argumen

force using the version of a module

2009-12-26 Thread Jeff Peng
Hello, The latest version of LWP::UserAgent (v5.834) has a method of "local_address", which is needed by my software. The lower version of this module (for example, v5.824) doesn't have that method. So how to force to use the latest version of LWP::UserAgent in the perl script? Thanks. Merry Ho

Re: HI

2009-09-29 Thread Jeff Peng
2009/9/30 Jyoti : > Thanks for reply Rajiv. Will go through.Also can you explain me what this > error means: > Odd number of elements in anonymous hash at > /usr/lib/cgi-bin/websubroutine.pl line 18. That may mean, you passed wrong arguments to the method in a class. The method expects a hash, sho

Re: Wants to migrate from one machine to another.

2009-09-29 Thread Jeff Peng
Since you know the scripts' names you may find what modules they are using: http://search.cpan.org/~elliotjs/Module-Used-v1.2.0/lib/Module/Used.pm 2009/9/29 Raheel Hassan : > Hello, > > We have one software which is installed at one machine. The software was > developed by many developers(student

Re: get list of files sorted by date

2009-09-29 Thread Jeff Peng
2009/9/29 Andreas Moroder : > Hello, > > according to the man glob can only sort by name. Is there a way to get a > list of files sorted by date ? > sure. first I will use unix's ls command like ls -ltr. in perl one of the ways: my @sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1]

Re: Hash of Hashes

2009-09-29 Thread Jeff Peng
2009/9/29 Shawn H Corey : > Soham Das wrote: >> >> How can I create a Hash of Hashes from two lists. Is it possible? >> >> I want the effective functionality to be served like this >> >> $ChildHash["Joe"]["21A"]="Sally" >> >> i.e Joe at 21A has a child called Sally. List1 here will be the name of >

Re: Help With Filtering Messages

2009-02-08 Thread Jeff Peng
hey are encoded. :-) use Encode; my @list = Encode->encodings(":all"); # get all encoding ways for my $encoding (@list) { print "decoded with $encoding:\n"; print encode("utf8",decode($encoding,$your_string) ); } -- Jeff Peng Office: +86-20-38350822 AIM: jeffpang www.dtonenetworks.com

Re: how to print % when using printf

2009-02-06 Thread Jeff Peng
2009/2/7 itshardtogetone : > Hi, > How do I print the % sign when using printf. use another % to escape it. -- Jeff Peng Office: +86-20-38350822 AIM: jeffpang www.dtonenetworks.com -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: begin

Re: Is there some IDE dedicated to perl?

2008-12-29 Thread Jeff Peng
2008/12/29 mobile.parmenides : > Hi, > > I am new to perl. Experience from the C programming tell my we can do > something well with an IDE. But, is there some IDE of perl, in which we can > do coding, debugging, etc? > for general scripts programming, VI/VIM is enough,:)

Re: about "print"

2008-12-29 Thread Jeff Peng
it will be v1 v2 v3 in the other case. The difference is one > is seperated by whitespace while the other is not. Welcome to the list. For your question, see: perldoc -q 'print an array' try to use perldoc, that's a good tool for learning Perl. -- Jeff Peng http://hom

Re: How to read email from Inbox

2008-12-23 Thread Jeff Peng
2008/12/23 sanket vaidya : > > > Hi all, > > > > How can we read mail from inbox without using mail client like outlook? > Using perl. i.e. Is it possible to read Inbox of your gmail account using > perl? I think it's possible. Search "Gmail" on CPAN a

Re: how do you do this in one step instead of two

2008-07-17 Thread Jeff Peng
On Fri, Jul 18, 2008 at 12:26 AM, Stewart Anderson <[EMAIL PROTECTED]> wrote: >> > > push @hh, [$direction, $source]; > > Is that creating an "anonymous reference" ? > I think it's an anonymous array, not an anonymous reference. -- Regards, Jeff. - [EMAIL PROTECTED] -- To unsubscribe,

Re: how do you do this in one step instead of two

2008-07-17 Thread Jeff Peng
On Fri, Jul 18, 2008 at 12:00 AM, Richard Lee <[EMAIL PROTECTED]> wrote: > is there way to do this in one step? > > push @array, ($direction, $source); > >push @hh, [EMAIL PROTECTED] > > > push @hh \($direction,$source) doesn't seem to work.. or not the samething > push @hh, [$directi

Re: how do you do this in one step instead of two

2008-07-17 Thread Jeff Peng
On Fri, Jul 18, 2008 at 12:00 AM, Richard Lee <[EMAIL PROTECTED]> wrote: > is there way to do this in one step? > > push @array, ($direction, $source); > >push @hh, [EMAIL PROTECTED] > > > push @hh \($direction,$source) doesn't seem to work.. or not the samething > push @hh, [$directi

Re: fetching encrypted passwords for oracle username in Perl !

2008-07-14 Thread Jeff Peng
On Mon, Jul 14, 2008 at 4:40 PM, Amit Saxena <[EMAIL PROTECTED]> wrote: > Hi > > Instead of hard-coded passwords in my source code or an input file, I would > like to enable some sort of encryption through some keys for all the > usernames in Oracle 10g. > > Please let me know how to do that with P

Re: uninstalling perl

2008-07-14 Thread Jeff Peng
On Mon, Jul 14, 2008 at 5:12 PM, Anirban Adhikary <[EMAIL PROTECTED]> wrote: > Dear list > > If I want to remove perl from my linux/unix machine then what is the > procedure for this? > Why do it? Without Perl many system functions can't run. -- Regards, Jeff. - [EMAIL PROTECTED] -- To unsubsc

Re: Um, do this for me, please...

2008-07-12 Thread Jeff Peng
Please read the FAQ item carefully below, thank you. (http://learn.perl.org/faq/beginners.html) 1.2 - How do I unsubscribe? Now, why would you want to do that? Send mail to <[EMAIL PROTECTED]>, and wait for a response. Once you reply to the response, you'll be unsubscribed. If that doesn't work,

Re: simplify a path

2008-07-02 Thread Jeff Peng
On Wed, Jul 2, 2008 at 9:33 PM, Chen Yue <[EMAIL PROTECTED]> wrote: > Hi > > I have a file containing UNIX-styled Path in each line. But the path is > simplified enough. Some of them has ".." and "." in the middle, such as > "/a/b/./c/../d". > Now I want to simplify each Path according to Unix trad

Re: about Zlib

2008-07-02 Thread Jeff Peng
On Wed, Jul 2, 2008 at 12:50 PM, Rajnikant <[EMAIL PROTECTED]> wrote: > I want to uncompress *.gz and *.tar on linux box. > > So is there any package which will do it for me? > Can we use Zlib to do same? Search and use a module from CPAN, that will make things fast. like: http://search.cpan.org/~

Re: DBI install

2008-07-01 Thread Jeff Peng
On Tue, Jul 1, 2008 at 8:39 PM, <[EMAIL PROTECTED]> wrote: > Can any one help me out in Installing DBI in a standalone box. There is no > internet connetion. I tried downloading DBI-1.48 module and tried using ppm > and makefile.PL its not working. I am doing it correct or missing something? >

Re: mailing list

2008-07-01 Thread Jeff Peng
On Tue, Jul 1, 2008 at 8:36 PM, Harry Bennett <[EMAIL PROTECTED]> wrote: > > I have not received a digest since 22 may. If I try to subscribe (again) I get > no reply either to confirm or inform me that I am already on the list. Try to check your system's antispam policy to see if you have filter

Re: looping

2008-06-30 Thread Jeff Peng
On Tue, Jul 1, 2008 at 11:04 AM, Akhil Srivastava <[EMAIL PROTECTED]> wrote: > Still I am not able to make it work. The problem is to read a file loop from > inside a top loop and exit the file loop when the top loop finishes. You maybe should post the code piece to the list, we may have the c

Re: Automation

2008-06-30 Thread Jeff Peng
On Mon, Jun 30, 2008 at 3:26 PM, Ram <[EMAIL PROTECTED]> wrote: > > I want it run without any GUI. it shoud run automatically at defined > time ? > Perl script is running without GUI normally unless you use TK. "crontab" or "at" commands under unix can do what you wanted. please man them for deta

  1   2   3   >