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
http://home.arcor.de/jeffp
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’?
Wh
'我' 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 Chin
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
I took a pictur
Check out
http://perldoc.perl.org/encoding.html
On 5/15/07, Jen mlists <[EMAIL PROTECTED]> wrote:
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.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional co
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.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Mike Blezien 写道:
Hello,
this one has been driving me nuts and I'm sure it's something very
simple I maybe overlooking. I need to assign a delimiter variable IE:
Pipe or Comma delimiter:
my $del = '|'; # use either a '|' or ','
my $dataline = "0|1|2|3|4|5|6|7|8|9";
my @data = spl
Dr.Ruud 写道:
Jeff,
Your messages get treated wrongly too.
The end up twice on the perl beginners list, with the same Message-ID,
and have a Newsgroups: header field with the groupname twice in it, just
like Chas's messages.
I don't know what happened.I've changed from my premium Earthlink to
Thank you Tom!
We realy have lots of ways to do everything. In this case, is easier to use
$^I functionality, and I did. Although, it is very nice to see this code
bellow.
Cheers!
""Tom Phoenix"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 5/15/07, Bruno Schroeder <[EMAIL
Are you attempting to recreate wget?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hashes!
Untested code:
while(<>){
chomp;
($id,$name)=split(/\|/,$_);
push( @($hash{$id}, $name) );
}
You can split the input file into chunks, or process one ID and then
let the variable go out of scope or whatever...
chomp;
($id,$name)=split(/\|/,$_);
$previous_id=$id;
Dear all,
I want to transform one2many like table to one2one table. Original table
looks as follows:
1|Michael
1|Alex
1|Bob
1|Pete
2|Bob
2|Andre
2|David
2|Alex
3|Pete
and the output should be similar to;
1|Michael Alex Bob Pete
2|Bob Andre David Alex
3|Pete
Table is large (4 GB), so I think t
On 5/15/07, perl pra <[EMAIL PROTECTED]> wrote:
Hello Gurus,
I have a html page which has hyper links only it does not have any images.
I have to read the html file get the names of the hyper link that is
displayed in the page ,create a directory structure and tar/gz the files.
( I have the di
On 5/15/07, perl pra <[EMAIL PROTECTED]> wrote:
If I could get the names of the hyperl inks that are displayed in the html
file as per directory structure then I could tar/.gz the files,. But I have
no idea of html parsing using perl.
Have you looked on CPAN?
http://search.cpan.org/
Maybe
Hello Gurus,
I have a html page which has hyper links only it does not have any images.
I have to read the html file get the names of the hyper link that is
displayed in the page ,create a directory structure and tar/gz the files.
( I have the directories in server with same names which are di
On 5/15/07, Tom Phoenix <[EMAIL PROTECTED]> wrote:
On 5/15/07, Jameson C. Burt <[EMAIL PROTECTED]> wrote:
> Letting my imagination loose,
> I ponder that qx() could have a fixed buffer size, which cannot be exceeded;
> or Unix takes in a block of size 2^16 but not of size 2^17.
> But I am prob
On 5/15/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
Jeff,
Your messages get treated wrongly too.
The end up twice on the perl beginners list, with the same Message-ID,
and have a Newsgroups: header field with the groupname twice in it, just
like Chas's messages.
Right, the problem has to be at la.
Jeff,
Your messages get treated wrongly too.
The end up twice on the perl beginners list, with the same Message-ID,
and have a Newsgroups: header field with the groupname twice in it, just
like Chas's messages.
Message-ID: <[EMAIL PROTECTED]>
The diff:
7c7
< Received: (qmail 12545 invoked from
On 5/15/07, Jameson C. Burt <[EMAIL PROTECTED]> wrote:
Letting my imagination loose,
I ponder that qx() could have a fixed buffer size, which cannot be exceeded;
or Unix takes in a block of size 2^16 but not of size 2^17.
But I am probably only cluttering my mind with possibilities,
when the p
On 5/15/07, Bruno Schroeder <[EMAIL PROTECTED]> wrote:
I tryed to use seek but it did not work. Can you help me on that, please? I
am using Windows XP. The following example writes at the end of the file.
use strict;
my $file = "teste_rw.txt";
open (FILE, "+<", $file) or die "Can not open $file
On Tue, May 15, 2007 at 09:36:12AM -0700, John W. Krahn wrote:
> Jameson C. Burt wrote:
> > Within Perl, I construct programs in other programming languages
> > and submit the result to a Unix (Linux or IBM AIX) operating system
> > with 2GB to 8GB memory.
> > I submit such a program to the operat
Ah, got it all figured out -- it works! Thanks Andrew and Chas for your
help!
- Bryan
>> On 5/15/07, Bryan R Harris <[EMAIL PROTECTED]> wrote:
>> snip
>>>
>>> It worked! Sort of...
>>>
>>> According to the camel book, "use lib" looks for "$dir/$archname/auto", but
>>> $archname isn't defi
> On 5/15/07, Bryan R Harris <[EMAIL PROTECTED]> wrote:
> snip
>>
>> It worked! Sort of...
>>
>> According to the camel book, "use lib" looks for "$dir/$archname/auto", but
>> $archname isn't defined and I don't know what it's supposed to be...
>>
>> How can I find out what it's supposed to b
For those of you interested. Here was the problem and solution.
the xconf (xml) file had a call to a dtd file at line 2 and that was causing
all my headaches. I removed that line
before parsing and all worked fine.
Thanks to all for the help.
Tony
> -Original Message-
> From: Tony Heal
On 5/15/07, Bryan R Harris <[EMAIL PROTECTED]> wrote:
snip
It worked! Sort of...
According to the camel book, "use lib" looks for "$dir/$archname/auto", but
$archname isn't defined and I don't know what it's supposed to be...
How can I find out what it's supposed to be?
You don't, you just
Hello Tom!
Hello All!
You helped a lot Tom. Still... I have some trouble.
For sure $^I is easier to use. Although in my case i would need to rewrite a
lot of code. I will do it, but it will take a while to test it. I found good
information on $^I at
http://perldoc.perl.org/perlfaq5.html#How-ca
That did the trick. I figured it had to be something simple. To my credit,
the book had it wrong too. Anyways, thanks for your help.
On 5/14/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 5/14/07, Kent Frazier <[EMAIL PROTECTED]> wrote:
snip
> Can someone with a more honed eye for this code te
On 5/15/07, Bryan R Harris <[EMAIL PROTECTED]> wrote:
> On 5/15/07, Bryan R Harris <[EMAIL PROTECTED]> wrote:
>>
>>
>> I'd love to use the Curses module for an upcoming script, but I don't have
>> root on the machines it will be used on. Is it possible to use the module
>> without installing it
> Bryan R Harris:
>>
>> I'd love to use the Curses module for an upcoming script, but I don't have
>> root on the machines it will be used on. Is it possible to use the module
>> without installing it?
>>
>
> From perldoc,
> How do I keep my own module/library directory?
>
>
On 5/15/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
Bryan R Harris 写道:
>
> I'd love to use the Curses module for an upcoming script, but I don't have
> root on the machines it will be used on. Is it possible to use the module
> without installing it?
>
From perldoc,
How do I keep my own m
Hello,
- Original Message -
From: "Xavier Noria" <[EMAIL PROTECTED]>
To: "Perl List"
Sent: Tuesday, May 15, 2007 11:49 AM
Subject: Re: Assign a delimiter variable
On May 15, 2007, at 6:42 PM, Mike Blezien wrote:
Hello,
this one has been driving me nuts and I'm sure it's something
On May 15, 2007, at 6:49 PM, Xavier Noria wrote:
To prevent this there's quotemeta(), which is available in literals
as \E:
Oh sorry, I meant \Q there.
-- fxn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On May 15, 2007, at 6:42 PM, Mike Blezien wrote:
Hello,
this one has been driving me nuts and I'm sure it's something very
simple I maybe overlooking. I need to assign a delimiter variable
IE: Pipe or Comma delimiter:
my $del = '|'; # use either a '|' or ','
my $dataline = "0|1|2
Hello,
this one has been driving me nuts and I'm sure it's something very simple I
maybe overlooking. I need to assign a delimiter variable IE: Pipe or Comma
delimiter:
my $del = '|'; # use either a '|' or ','
my $dataline = "0|1|2|3|4|5|6|7|8|9";
my @data = split(/$del/, $datali
Jameson C. Burt wrote:
> Within Perl, I construct programs in other programming languages
> and submit the result to a Unix (Linux or IBM AIX) operating system
> with 2GB to 8GB memory.
> I submit such a program to the operating system using Perl's
> qx()
> Unfortunately, giving qx() over 128,42
Bryan R Harris 写道:
I'd love to use the Curses module for an upcoming script, but I don't have
root on the machines it will be used on. Is it possible to use the module
without installing it?
From perldoc,
How do I keep my own module/library directory?
When you build modules, u
> On 5/15/07, Bryan R Harris <[EMAIL PROTECTED]> wrote:
>>
>>
>> I'd love to use the Curses module for an upcoming script, but I don't have
>> root on the machines it will be used on. Is it possible to use the module
>> without installing it?
>>
>> If so, how is it done?
> snip
>
> No, you mu
Within Perl, I construct programs in other programming languages
and submit the result to a Unix (Linux or IBM AIX) operating system
with 2GB to 8GB memory.
I submit such a program to the operating system using Perl's
qx()
Unfortunately, giving qx() over 128,420 characters (about and can vary
by
Ken Foskey 写道:
>
> Look to the code itself first, use real names and spell them in full. I
> have a production system where prefix is shortened to pfx, pref, prefx.
> It is a nightmare to maintain.
>
I personally agree with this.But for most programmers whose mother
language is not english,wrot
On 5/15/07, Bryan R Harris <[EMAIL PROTECTED]> wrote:
I'd love to use the Curses module for an upcoming script, but I don't have
root on the machines it will be used on. Is it possible to use the module
without installing it?
If so, how is it done?
snip
No, you must install a module to use
I'd love to use the Curses module for an upcoming script, but I don't have
root on the machines it will be used on. Is it possible to use the module
without installing it?
If so, how is it done?
TIA,
- B
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On 5/15/07, Ken Foskey <[EMAIL PROTECTED]> wrote:
snip
Look to the code itself first, use real names and spell them in full. I
have a production system where prefix is shortened to pfx, pref, prefx.
It is a nightmare to maintain.
snip
The problem here is not the shortening (which can be a good
On Mon, 2007-05-14 at 02:16 -0400, Mathew Snyder wrote:
> Is it possible to use too many comments? I'm looking at a script I wrote and
> think I may have made it less clear by trying to make it more clear.
Absolutely.
Commenting in a useful clear way I believe takes years to master.
Maintaining
On 5/15/07, Ken Foskey <[EMAIL PROTECTED]> wrote:
> It looks as if you're trying to edit a text file "in place". Although
> that's possible for some simple cases, it's generally easier to use
> Perl's $^I functionality.
>
What is $^I?
It is a special scalar variable that turns on/off in-place
> It looks as if you're trying to edit a text file "in place". Although
> that's possible for some simple cases, it's generally easier to use
> Perl's $^I functionality.
>
What is $^I?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn
On 5/15/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
Hello Chas,
All your replies are lately posted twice, and have a strange Newsgroups:
header line.
Newsgroups: perl.beginners,perl.beginners
snip
so nz-out-0506.google.com (which has 2 IP-nrs) hands it over twice, with
exactly 10 minutes in betw
On 5/15/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
snip
AFAIK, it is not that "Perl automagically uses the right directory
separator", but that the shell at hand understands both ways.
How does it work with MacOS9?
snip
I could have sworn that it was, but I just checked perldoc perlport
and my memo
John W. Krahn writes:
Tom Allison wrote:
How do I pull all the words from a line between the two words 'from' and
'by' when I have NO IDEA what's in there, but I know they are all in one
line.
To make it more difficult. 'by' is optional...
Like this:
from..by..
or
from..
Dharshana Eswaran wrote:
I need to create a GUI and integrate my perl script to it. I decided to get
the GUI using perl/Tk programming. I searched in the net and i am unable to
get a good tutorial or any document regarding the perl/Tk programming.
If anyone knows any links or have any documents,
Hi All,
I need to create a GUI and integrate my perl script to it. I decided to get
the GUI using perl/Tk programming. I searched in the net and i am unable to
get a good tutorial or any document regarding the perl/Tk programming.
If anyone knows any links or have any documents, can you please m
"Chas Owens" schreef:
> Tatiana Lloret Iglesias:
>> my $status = system("d:\\blast\\bin\\blastall -p blastn -i $file -d
>> $patDB -o $workdir\\blast_$blast_file_id.txt");
> snip
>
> Just an unrelated note to make your life a little easier, Perl
> automagically uses the right directory separator if
Hello Chas,
All your replies are lately posted twice, and have a strange Newsgroups:
header line.
Newsgroups: perl.beginners,perl.beginners
For example:
Message-ID:
<[EMAIL PROTECTED]>
A diff between the two messages (with the same Message-ID, but with
different SMTP ids) shows this:
7c7
<
52 matches
Mail list logo