Re: about utf8 translation

2005-11-29 Thread Jeff Pang
I have resolve this problem,as: $subject = encode("euc-cn", decode("utf8", $subject)); Sorry for bothering. 在 05-11-30,Jeff Pang<[EMAIL PROTECTED]> 写道: > Hi,lists, > > I have a file looking as below: > > <[EMAIL PROTECTED]> 145K179B 璧搴? > <[EMAIL PROTECTED]>

about utf8 translation

2005-11-29 Thread Jeff Pang
Hi,lists, I have a file looking as below: <[EMAIL PROTECTED]> 145K179B 璧搴? <[EMAIL PROTECTED]>171K122B ���璇� <[EMAIL PROTECTED]> 28K904B ���K60830 <[EMAIL PROTECTED]> 243K600B ��规�寮�? <[EMAIL PROT

Re: how to hide passwd from INPUT

2005-11-29 Thread Jennifer Garner
Thanks for John and all. On Tue, Nov 29, 2005 at 10:53 PM, John Doe wrote: Jennifer Garner am Dienstag, 29. November 2005 15.40: HI,Lists, Sorry, this time I can't login into my primary mailbox of 30gigs.So I change another email for this question. When I get something from input such as:

Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net
Charles K. Clarkson wrote: JupiterHost.Net wrote: : Thanks for catching my misstatement :) Thanks for finally making one. :) No I make mistakes all the time, no doubt :) : #!/usr/bin/perl : : use strict; : use warnings; : : open my $file1_fh, '<', 'fil

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
JupiterHost.Net wrote: : Thanks for catching my misstatement :) Thanks for finally making one. :) : #!/usr/bin/perl : : use strict; : use warnings; : : open my $file1_fh, '<', 'file1' or die "file1 open failed: $!"; : : open my $file2_fh, '<', 'file2' or die "

Re: the time a program runs

2005-11-29 Thread Scott R. Godin
Octavian Rasnita wrote: Hi, I have tried to find out the time a perl program runs, and I have used: #at the start of the program: my $begin = (times)[0]; my $begin_t = time(); ... The program follows # at the end of the program: my $end = (times)[0] - $begin; my $end_t = time() - $begin_t; pr

Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net
Charles K. Clarkson wrote: JupiterHost.Net wrote: : This will open both files and check each line of file2 against : each line of file1 (and it alerts you to any problems, is easier : to read, best pratice safe (hopefully ;p), ect etc): Sorry, but it won't. It

Re: formatting text

2005-11-29 Thread Brano Gerzo
Ing. Branislav Gerzo [IBG], on Tuesday, November 29, 2005 at 17:14 (+0100) wrote: IBG> And I'd like to print: IBG> |Name: Branislav | IBG> |Surname.: Gerzo | IBG> 26.^

Re: You've read the Llama, now what?

2005-11-29 Thread Randal L. Schwartz
> "Randal" == Randal L Schwartz writes: Randal> Randal L. Schwartz Perl's of Wisdom, from Apress. And I can't believe I just wrote "Perl's" instead of "Perls". :) "Caffiene! Work! Now!" -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 http://www.stonehenge.c

HTML::Parser Tutorial

2005-11-29 Thread Mandar Rahurkar
Hi, Is anyone familiar with a doos tutorial on HTML::Parser module ? Thanks, Mandar -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: You've read the Llama, now what?

2005-11-29 Thread Randal L. Schwartz
> "Tom" == Tom Yarrish <[EMAIL PROTECTED]> writes: Tom> No I haven't read that one yet. I actually forgot about that one Tom> until I heard your Perlcast interview over the weekend. ;) Tom> Speaking of which, during the interview you mentioned a book that Tom> contains all the articles you've

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
JupiterHost.Net wrote: : This will open both files and check each line of file2 against : each line of file1 (and it alerts you to any problems, is easier : to read, best pratice safe (hopefully ;p), ect etc): Sorry, but it won't. It will open both files and check t

Re: formatting text

2005-11-29 Thread Ing. Branislav Gerzo
Jeff 'japhy' Pinyan [JP], on Tuesday, November 29, 2005 at 09:12 (-0500 (EST)) wrote the following: Jeff, Perl6::Form is so powerful. But I can't find how to properly do this: I have values: ('Name','Branislav'); ('Surname','Gerzo'); And I'd like to print: |Name: Branislav

Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net
This will open both files and check each line of file2 against each line of file1 (and it alerts you to any problems, is easier to read, best pratice safe (hopefully ;p), ect etc): #!/usr/bin/perl use strict; use warnings; open my $file1_fh, '<', 'file1' or die "file1 open failed: $!"; open

Re: how to hide passwd from INPUT

2005-11-29 Thread John Doe
Jennifer Garner am Dienstag, 29. November 2005 15.40: > HI,Lists, > > Sorry, this time I can't login into my primary mailbox of 30gigs.So I > change another email for this question. > > When I get something from input such as: > > my $passwd=; > > the password typed on screen is clear plain text.Ho

Re: how to hide passwd from INPUT

2005-11-29 Thread Xavier Noria
On Nov 29, 2005, at 15:40, Jennifer Garner wrote: HI,Lists, Sorry, this time I can't login into my primary mailbox of 30gigs.So I change another email for this question. When I get something from input such as: my $passwd=; the password typed on screen is clear plain text.How can I get it

how to hide passwd from INPUT

2005-11-29 Thread Jennifer Garner
HI,Lists, Sorry, this time I can't login into my primary mailbox of 30gigs.So I change another email for this question. When I get something from input such as: my $passwd=; the password typed on screen is clear plain text.How can I get it input as hide type such as ***?Thanks. --- Jenn

Re: Matching a Scalar Variable

2005-11-29 Thread Dr.Ruud
Muthukumar: Always put these lines on top: use strict; use warnings; >$var=~chomp($var); perldoc -f chomp -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: formatting text

2005-11-29 Thread Ing. Branislav Gerzo
Jeff 'japhy' Pinyan [JP], on Tuesday, November 29, 2005 at 09:12 (-0500 (EST)) thoughtfully wrote the following: >> I'd like to know if there is module for following: JP> Yes, Perl6::Form. It's a Perl 5 implementation of Perl 6's formats. sometime is better ask, than DIY. Thanks a lot Japhy, thi

Re: formatting text

2005-11-29 Thread Jeff 'japhy' Pinyan
On Nov 29, Ing. Branislav Gerzo said: I'd like to know if there is module for following: Yes, Perl6::Form. It's a Perl 5 implementation of Perl 6's formats. 112 12345678901234567890 === OUT === | This is just | | small sentence | | about nothing. | === OUT === So, I

Re: Matching a Scalar Variable

2005-11-29 Thread JupiterHost.Net
Muthukumar wrote: On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: Sorry i am passing the OPEN as Open (FILE1," Use like this: No, like this: use strict; use warnings; Always do that, especially when posting code to this list. open FD, "< file1"; open FD1, "< file2"; Is it even open?

formatting text

2005-11-29 Thread Ing. Branislav Gerzo
Hello all, I'd like to know if there is module for following: We have text: === IN === This is just small sentence about nothing. === IN === And I like to format it as follows: 112 12345678901234567890 === OUT === | This is just | | small sentence | | about nothing. | ==

Re: Re: how to get file's creation time

2005-11-29 Thread Jennifer Garner
Thanks for Schwartz and Jay.I have known something from your words. On 28 Nov 2005 08:48:28 -0800, merlyn@stonehenge.com (Randal L. Schwartz) wrote: >> "Jay" == Jay Savage <[EMAIL PROTECTED]> writes: > > Jay> It depends on what you mean by "creation". stat() on POSIXish systems > Jay> return

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Charles K. Clarkson wrote: : : chomp( my @pix = <$fh ); Darn! chomp( my @pix = <$fh> ); Move along now. :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Muthukumar wrote: : May be it will work: : : : open FD, "< pixconfig.txt"; : open FD1, "< ip.log"; : : @arr=; We need to know more about file size and memory to make this determination. Assuming you are correct about the file and memory size, your algorithm looks fi

Re: Matching a Scalar Variable

2005-11-29 Thread Muthukumar
On 11/29/05, Charles K. Clarkson <[EMAIL PROTECTED]> wrote: > > Muthukumar wrote: > > >No, I don't think so. > >Let's test it. We'll assume that has 3 lines in it. > On the first pass of the outer loop we load the first value > from "file1." We then compare it to

Re: help about regex matching

2005-11-29 Thread Jeff Pang
oh,I see it finally.Thanks for everyone! 2005/11/29, John W. Krahn <[EMAIL PROTECTED]>: > Jeff Pang wrote: > > yes,John's code work well too.But I still don't know why this code > > can't run correctly: > > > > next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s; > > > > When I run it,I get these results:

Re: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Xavier Noria
On Nov 29, 2005, at 10:42, Bedanta Bordoloi, Gurgaon wrote: No, $log_entry[0] holds a string, and we are getting the error as ** is a part of that string. Interpolation in regexps is done before the regexp is interpreted as such. For instance, if $foo is "*" and we have /.*$foo/ fir

RE: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Bedanta Bordoloi, Gurgaon
Thanks, John for that, it works fine now... Bedanta -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 3:25 PM To: Perl Beginners Subject: Re: Error : Nested quantifiers before HERE mark in regex Bedanta Bordoloi, Gurgaon wrote: > Hi All,

Re: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread John W. Krahn
Bedanta Bordoloi, Gurgaon wrote: > Hi All, Hello, > I'm using the following regex in my code with processes a log file > > $str =~ s/(^$log_entry[0]\s)//i > > But I'm getting the following error on running the script: > > Nested quantifiers before HERE mark in regex m/(^img13.** <<

Re: help about regex matching

2005-11-29 Thread John W. Krahn
Jeff Pang wrote: > yes,John's code work well too.But I still don't know why this code > can't run correctly: > > next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s; > > When I run it,I get these results: > > 364 2.168.2.20 > 286.4 2.168.2.21 > 264.4 2.168.2.22 > 138 2.168.2.23 > 562.3 2.16

RE: help about regex matching

2005-11-29 Thread Charles K. Clarkson
Pant, Hridyesh wrote: : Why are u using this. : local $/ = "\n\n"; Because I'm cocky! :) $/ is a special perl variable which is used to define the input record separator. It is set to "\n" as a default. By resetting it to "\n\n", I was able to get two lines at

RE: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Bedanta Bordoloi, Gurgaon
No, $log_entry[0] holds a string, and we are getting the error as ** is a part of that string. Bedanta -Original Message- From: Xavier Noria [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 3:08 PM To: beginners perl Subject: Re: Error : Nested quantifiers before HERE mark in r

Re: Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Xavier Noria
On Nov 29, 2005, at 10:22, Bedanta Bordoloi, Gurgaon wrote: Hi All, I'm using the following regex in my code with processes a log file $str =~ s/(^$log_entry[0]\s)//i But I'm getting the following error on running the script: Nested quantifiers before HERE mark in regex m/(^i

RE: Matching a Scalar Variable

2005-11-29 Thread Charles K. Clarkson
Muthukumar wrote: No, I don't think so. Let's test it. We'll assume that has 3 lines in it. On the first pass of the outer loop we load the first value from "file1." We then compare it to each value in "file2." Fine so far. On the second pass of the oute

Re: Matching a Scalar Variable

2005-11-29 Thread Mazhar
Ok Muthu, See there is a file called as pixconfig.txt which has the entries such as *PIX-4-106023* *PIX-4-101123* *so on* and there is one more file called ip.log which has the entries below, Nov 29 10:03:24 10.20.1.2 Nov 29 2005 10:33:53: %*PIX-4-106023*: Deny tcp src inside:Blackbe

RE: help about regex matching

2005-11-29 Thread Pant, Hridyesh
Why are u using this. local $/ = "\n\n"; -Original Message- From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] Sent: 29 November 2005 13:43 To: 'Perl Beginners' Subject: RE: help about regex matching Jeff Pang wrote: : Thanks for Charles.That code can work

Error : Nested quantifiers before HERE mark in regex

2005-11-29 Thread Bedanta Bordoloi, Gurgaon
Hi All, I'm using the following regex in my code with processes a log file $str =~ s/(^$log_entry[0]\s)//i But I'm getting the following error on running the script: Nested quantifiers before HERE mark in regex m/(^img13.** << HERE **\s)/ Can the regex be written in some other

Re: help about regex matching

2005-11-29 Thread Jeff Pang
yes,John's code work well too.But I still don't know why this code can't run correctly: next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s; When I run it,I get these results: 364 2.168.2.20 286.4 2.168.2.21 264.4 2.168.2.22 138 2.168.2.23 562.3 2.168.2.24 80.72.168.2.25 355 2.168.2

Re: help about regex matching

2005-11-29 Thread John W. Krahn
Jeff Pang wrote: > hi,list, Hello, > I have a file looking as below: > > 356.5 > 192.168.2.20 > > [snip] > > 612 > 192.168.2.31 > > ... > > > I want to get this result: > > 356.5 192.168.2.20 > 283.3 192.168.2.21 > 261.9 192.168.2.22 > ... > > > and,I write this regex for matching: > >

Re: Matching a Scalar Variable

2005-11-29 Thread Mazhar
Thank You Every Body for the Help i am able to check the same. regards mazhar On 11/29/05, Muthukumar <[EMAIL PROTECTED]> wrote: > > > > On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > > > Sorry i am passing the OPEN as > > Open (FILE1," > Open (FILE," > > > Still the string is ot matching. H

Re: Matching a Scalar Variable

2005-11-29 Thread Muthukumar
On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > Sorry i am passing the OPEN as > Open (FILE1," Open (FILE," > Still the string is ot matching. Help me please Use like this: open FD, "< file1"; open FD1, "< file2"; while () { $line1=chomp($_); # chomp() Needed while () { $line =

Re: help about regex matching

2005-11-29 Thread Jeff Pang
It's ok now.Thanks very much. 2005/11/29, Charles K. Clarkson <[EMAIL PROTECTED]>: > Jeff Pang wrote: > > : Thanks for Charles.That code can work well,but I still want > : to know how to do it with regex expression. > > use strict; > use warnings; > > local $/ = "\n\n";

RE: help about regex matching

2005-11-29 Thread Charles K. Clarkson
Jeff Pang wrote: : Thanks for Charles.That code can work well,but I still want : to know how to do it with regex expression. use strict; use warnings; local $/ = "\n\n"; while ( ) { chomp; printf "%-5s% 15s\n", /(.+)\n(.+)/; } __END__ HTH, Charles K. Clark