Re: Chinese word problem

2007-05-16 Thread Thomas Yan
'我' takes 2 bytes '\0' takes 1 byte , so 我“ takes 3 Every chinese charecter takes 2 bytes - Original Message - From: Neil To: beginners@perl.org Sent: Wednesday, May 16, 2007 1:57 PM Subject: Chinese word problem Dear All: Question: How come the length of

RE: Chinese word problem

2007-05-16 Thread Neil
Thanks for your reply. Excuse me for Further question: What’s the ‘\0’ use for? I got the result of 21 when I put in more Chinese character like: $str=”我 們一起看雲去”; There are 7 Chinese words in the string, Does it mean every single Chinese word have to come with a single ‘\0’?

Re: Chinese word problem

2007-05-16 Thread Jeff Pang
Thomas Yan 写道: '我' takes 2 bytes '\0' takes 1 byte , so 我“ takes 3 Not right.This was not like C's char str[] form. I think the origin ppl's words are in some encoding form like base64. For me I got exactly 2 bytes.like, perl -le 'print length(我)' 2 -- Jeff Pang

RE: Chinese word problem

2007-05-16 Thread Neil
It's wired! I did the same thing and got the result of 3 perl -le 'print length(我)' 3 Pls see the attachment Thank you. -Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 16, 2007 2:40 PM To: Thomas Yan Cc: Neil; beginners@perl.org Subject: Re: Chinese

Re: Chinese word problem

2007-05-16 Thread Mug
Neil wrote: Dear All: Question: How come the length of Chinese word I print shows “ 3 “. Isn’t it supposed to 2 bytes? Program: --- $str=”我”; $str_len = length($str); Print $str_len, “\n\n”; The result is 3

Re: output with utf8

2007-05-16 Thread Jeff Pang
Jen mlists 写道: Hello, I need to output contents with utf8 encoding in CGI scripts. Can you tell me how to open STDOUT with utf8 support?Thanks you. Hello, Just do, binmode(STDOUT, :utf8); see perldoc perluniintro for more details. -- Jeff Pang http://home.arcor.de/jeffpang/ -- To

Re: Chinese word problem

2007-05-16 Thread Jeff Pang
Neil 写道: It's wired! I did the same thing and got the result of 3 perl -le 'print length(我)' 3 Pls see the attachment How about your shell environment? For me something are: SHELL=/bin/bash LC_ALL=C LANG=en_US.en -- Jeff Pang http://home.arcor.de/jeffpang/ -- To unsubscribe, e-mail:

Re: Chinese word problem

2007-05-16 Thread Mumia W.
On 05/16/2007 12:57 AM, Neil wrote: Dear All: Question: How come the length of Chinese word I print shows “ 3 “. Isn’t it supposed to 2 bytes? Program: --- $str=”我”; $str_len = length($str); Print $str_len, “\n\n”; The

Re: output with utf8

2007-05-16 Thread Jen mlists
Hello, Does thie mean when I say, binmode(STDOUT, :utf8); The characters would be translated to utf8 for output automatically? (Would I need to translate them to utf8 firstly before output?) Thanks again. 2007/5/16, Jeff Pang [EMAIL PROTECTED]: Jen mlists 写道: Hello, I need to output

Re: Delete a particular line from file

2007-05-16 Thread sivasakthi
Suppose i have checked the group of I/P addresses for deleting opting then what should i do?? Is there any inbuilt function there for that requirement?? On Tue, 2007-05-15 at 12:25 +0800, Jeff Pang wrote: sivasakthi 写道: Hi, I have used the file in perl, file contains like that,

Re: Delete a particular line from file

2007-05-16 Thread Jeff Pang
sivasakthi 写道: Suppose i have checked the group of I/P addresses for deleting opting then what should i do?? We don't know what you should do.Only you yourself could konw what you should do.Can you describe the questions more clearly? -- Jeff Pang http://home.arcor.de/jeffpang/ -- To

applying a regular expression on the continuous output of ping command

2007-05-16 Thread Srinivas
Hi, ping geekcrossing.net|perl -le m/time=(\d+)/;print $1; Can some one help me with the above command -srini -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Net::Telnet --help required

2007-05-16 Thread a b
Hello, I am trying to telnet to all m/c for which i haven't set password(only root is a valid user) any body can telnet using root user But when i try to access through perl it snip use warnings; use Net::Telnet; my $t = new Net::Telnet (Timeout = 10,Prompt = '/bash\$ $/'); my @line;

missing something from regex ...

2007-05-16 Thread Gregory Machin
Hi i have the following string I need to break down into usable data ... CLIENT_LIST,tsc-odi.vpn.ct-net.org,165.146.60.29:11134,10.1.0.46,1959761,218729,Wed May 16 11:24:37 2007,1179307477 and I dont want Wed May 16 11:24:37 2007 cause the number at the end is the same thing .. this is the

YARQ: Yet Another Regex Question

2007-05-16 Thread Mathew Snyder
I have a trouble ticket application that uses a regex to find a piece of information in an incoming email and auto populate a field if it is found. The line it will be looking for is CUSTOMER ENVIRONMENT customer_name where customer_name will never have a space making it one word. If I just want

Re: YARQ: Yet Another Regex Question

2007-05-16 Thread Chas Owens
On 5/16/07, Mathew Snyder [EMAIL PROTECTED] wrote: I have a trouble ticket application that uses a regex to find a piece of information in an incoming email and auto populate a field if it is found. The line it will be looking for is CUSTOMER ENVIRONMENT customer_name where customer_name will

Re: missing something from regex ...

2007-05-16 Thread Chas Owens
On 5/16/07, Gregory Machin [EMAIL PROTECTED] wrote: Hi i have the following string I need to break down into usable data ... CLIENT_LIST,tsc-odi.vpn.ct-net.org,165.146.60.29:11134,10.1.0.46,1959761,218729,Wed May 16 11:24:37 2007,1179307477 snip Right, you have delimited data and it looks

Re: missing something from regex ...

2007-05-16 Thread Matthew J. Avitable
Gregory Machin wrote: $row = CLIENT_LIST,tsc-odi.vpn.ct-net.org,165.146.60.29:11134,10.1.0.46,1959761,218729,Wed May 16 11:24:37 2007,1179307477 $row = ~/(\w+)\,(\w+)\,(\d+\.\d+\.\d+\.\d+\:\d+)\,(\d+\.\d+\.\d+\.\d+)\,(\d+)\,(\d+)\,\,(\d+)/ print info $1 \n; print hostname $2 \n; print

Re: applying a regular expression on the continuous output of ping command

2007-05-16 Thread Chas Owens
On 5/16/07, Srinivainputs [EMAIL PROTECTED] wrote: Hi, ping geekcrossing.net|perl -le m/time=(\d+)/;print $1; Can some one help me with the above command Add an n to the perl arguments to get it loop over stdin and use single quotes to prevent shell from trying to interpolate $1. ping

Re: Delete a particular line from file

2007-05-16 Thread Chas Owens
On 5/16/07, sivasakthi [EMAIL PROTECTED] wrote: Suppose i have checked the group of I/P addresses for deleting opting then what should i do?? Is there any inbuilt function there for that requirement?? snip while(FILE) { my ($time,$lport,$ip,$stats,$rport) = split; next if $ip eq

Re: transform one2many table

2007-05-16 Thread Chas Owens
On 5/15/07, yitzle [EMAIL PROTECTED] wrote: snip You can split the input file into chunks, or process one ID and then let the variable go out of scope or whatever... snip Or, since the solution involves hashes, you could use a dbm file tie'd to a hash to keep the data on disk instead of RAM.

Re: Net::Telnet --help required

2007-05-16 Thread Jay Savage
On 5/16/07, a b [EMAIL PROTECTED] wrote: Hello, I am trying to telnet to all m/c for which i haven't set password(only root is a valid user) any body can telnet using root user But when i try to access through perl it snip use warnings; use Net::Telnet; my $t = new Net::Telnet (Timeout =

Re: Can't sort error out; strict refs

2007-05-16 Thread Mathew
Rob Dixon wrote: Mathew Snyder wrote: I'm passing two hash references into a subroutine. One hash is in the format of $dept{$env}{$user}. This contains an amount of time spent by each user on a customer ($env). The second hash is in the format of $ticCount{$env}{$user}{$ticID}. This

Re: YARQ: Yet Another Regex Question

2007-05-16 Thread Mathew
Chas Owens wrote: On 5/16/07, Mathew Snyder [EMAIL PROTECTED] wrote: I have a trouble ticket application that uses a regex to find a piece of information in an incoming email and auto populate a field if it is found. The line it will be looking for is CUSTOMER ENVIRONMENT customer_name

Re: YARQ: Yet Another Regex Question

2007-05-16 Thread Chas Owens
On 5/16/07, Mathew [EMAIL PROTECTED] wrote: snip What does gr() do? Mathew qr not gr. It is the quote regex operator. from perldoc perlop qr/STRING/imosx This operator quotes (and possibly compiles) its STRING as a regular expression. STRING is

Re: YARQ: Yet Another Regex Question

2007-05-16 Thread Jeff Pang
Mathew 写道: What does gr() do? It's qr not gr. See perldoc perlop and look for qr/STRING/imosx. -- http://home.arcor.de/jeffpang/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: YARQ: Yet Another Regex Question

2007-05-16 Thread Mathew
Chas Owens wrote: On 5/16/07, Mathew [EMAIL PROTECTED] wrote: snip What does gr() do? Mathew qr not gr. It is the quote regex operator. from perldoc perlop qr/STRING/imosx This operator quotes (and possibly compiles) its STRING as a regular

Net::Ping Bug found?

2007-05-16 Thread Angerstein
Hi there! I am using Net::Ping on AIX (here 5.2) and I noticed a strange behaviour concerning the ICMP Payload Data Field. If I do a typical default ping with $p = new Net::Ping('icmp', $ping_timeout); I will get a EthernetII-IP-ICMP-Package (so far so good), but this package does not contain a

Re: xterm fonts

2007-05-16 Thread Mumia W..
On 05/15/2007 04:38 PM, Deboo ^ wrote: I installed a minimal X sysetm with fluxbox and xterm and two other terminal emulators: eterm and mrxvt. But all three of them give very small fonts. WIth xterm, I was able to get a reasonable font with the HUGE option in the right-click menu but I need

Re: Net::Ping Bug found?

2007-05-16 Thread Tom Phoenix
On 5/16/07, Angerstein [EMAIL PROTECTED] wrote: So Please: Could somebody verify this on her/his own System? I'm sure that many people will be glad to help you. Could you please supply a small program that testers could run and send you the output? Good luck with your project! --Tom Phoenix

Re: applying a regular expression on the continuous output of ping command

2007-05-16 Thread Goran
Something like this: ping geekcrossing.net | perl -nle 'print $1 if /time=(\d+\.\d+)/' HTH Goran -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

AW: Net::Ping Bug found?

2007-05-16 Thread Angerstein
I can hand my Routine to you people. Use: Start iptrace with iptrace -i en1 -S 1500 -P ICMP /tmp/trace.bin (when you kill iptrace use kill -15 important!!!) Use this code # use Net::Ping; my $p; # Ping Objekt my $r = 127.0.0.1; # Give any IP address

Re: xterm fonts

2007-05-16 Thread Mumia W.
On 05/15/2007 07:04 PM, Mumia W.. wrote: On 05/15/2007 04:38 PM, Deboo ^ wrote: I installed a minimal X sysetm with fluxbox and xterm and two other [...] Sorry, wrong list :-( -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Net::Ping Bug found?

2007-05-16 Thread Tom Phoenix
On 5/16/07, Angerstein [EMAIL PROTECTED] wrote: Start iptrace with Machine #1: Doesn't have iptrace. OpenBSD 4.0 system. Machine #2: Doesn't have iptrace. MacOS X 10.4.9. I hope that other testers have better results for you! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe,

Inconsistent results from file test (-X) operators

2007-05-16 Thread R (Chandra) Chandrasekhar
Dear Folks, I have encountered inconsistent behaviour with the file test (-X) operators. I am using perl, v5.8.8 built for i486-linux-gnu-thread-multi on a Kubuntu Feisty system. I show below my minimal test file: --- Minimal Test File --- #!/usr/bin/perl -w use diagnostics;

Re: Inconsistent results from file test (-X) operators

2007-05-16 Thread Chas Owens
On 5/16/07, R (Chandra) Chandrasekhar [EMAIL PROTECTED] wrote: snip Can anyone please tell me why I get this inconsistent behaviour and how to overcome it? snip It is not inconsistent, you are using file names without the proper path. If a file or directory exists in the current directory

Re: Inconsistent results from file test (-X) operators

2007-05-16 Thread John W. Krahn
R (Chandra) Chandrasekhar wrote: Dear Folks, Hello, I have encountered inconsistent behaviour with the file test (-X) operators. I am using perl, v5.8.8 built for i486-linux-gnu-thread-multi on a Kubuntu Feisty system. I show below my minimal test file: --- Minimal Test File

RE: Chinese word problem

2007-05-16 Thread Neil
I did check the environment, And set the same settings like your's, But the result still got 3 Some thing different is that there are some warring from perl, And I have no clue how to deal with it. Thanks [EMAIL PROTECTED]

Re: Chinese word problem

2007-05-16 Thread Jeff Pang
Neil 写道: I did check the environment, And set the same settings like your's, But the result still got 3 Some thing different is that there are some warring from perl, And I have no clue how to deal with it. Thanks [EMAIL