[31564] in Perl-Users-Digest
Perl-Users Digest, Issue: 2823 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 18 03:09:28 2010
Date: Thu, 18 Feb 2010 00:09:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 18 Feb 2010 Volume: 11 Number: 2823
Today's topics:
$^T is not working as expected from mod_perl <patrickh@gmail.com>
Re: $^T is not working as expected from mod_perl <patrickh@gmail.com>
Re: $^T is not working as expected from mod_perl <m@rtij.nl.invlalid>
Re: a defense of ad hoc software development <jurgenex@hotmail.com>
Re: Anyone willing to modify 3rd party perl code? <buck@private.mil>
Re: Anyone willing to modify 3rd party perl code? <buck@private.mil>
Re: Anyone willing to modify 3rd party perl code? <uri@StemSystems.com>
Re: Anyone willing to modify 3rd party perl code? <uri@StemSystems.com>
ExcelPrepHTML.pm <catebekensail@yahoo.com>
Re: ExcelPrepHTML.pm <john@castleamber.com>
File Position <mud_saisem@hotmail.com>
Re: File Position <tadmc@seesig.invalid>
Re: File Position <peter@makholm.net>
Re: File Position <mud_saisem@hotmail.com>
Re: File Position <jurgenex@hotmail.com>
Re: File Position <mud_saisem@hotmail.com>
Re: File Position <jurgenex@hotmail.com>
Re: How to get offset position from unpack()? <ben@morrow.me.uk>
Re: utf8, length and syswrite are killing me sln@netherlands.com
Re: utf8, length and syswrite are killing me <alexander.farber@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Feb 2010 17:53:41 -0800 (PST)
From: Patrick Hartman <patrickh@gmail.com>
Subject: $^T is not working as expected from mod_perl
Message-Id: <13751982-f7c7-47d0-8901-a048420a6a77@j27g2000yqn.googlegroups.com>
I was using this to calculate execution time at the bottom of a
script:
print time - $^T;
However I noticed that the time just got a little bit longer everytime
I ran it despite the apparent page load time not changing at all. I
changed it to this:
printf "BEG: $^T \n";
printf "END: ". time;
And the $^T was outputting the same start time for every execution;
every time I would load the page, the time just got longer and longer
since only the end time was updating.
This problem is only happening when I execute from mod_perl / Apache.
If I go to the command line and execute it through there it works
fine. I have Apache on my local computer, so both places are pointing
to the same installation of Perl.
Any ideas what would be causing this?
Thanks,
Patrick
------------------------------
Date: Wed, 17 Feb 2010 18:01:40 -0800 (PST)
From: Patrick Hartman <patrickh@gmail.com>
Subject: Re: $^T is not working as expected from mod_perl
Message-Id: <511bff68-47cd-4ee3-968b-912e7e94f2fc@c16g2000yqd.googlegroups.com>
On Feb 17, 7:53=A0pm, Patrick Hartman <patri...@gmail.com> wrote:
> I was using this to calculate execution time at the bottom of a
> script:
>
> print time - $^T;
>
> However I noticed that the time just got a little bit longer everytime
> I ran it despite the apparent page load time not changing at all. I
> changed it to this:
>
> printf "BEG: $^T \n";
> printf "END: ". time;
>
> And the $^T was outputting the same start time for every execution;
> every time I would load the page, the time just got longer and longer
> since only the end time was updating.
>
> This problem is only happening when I execute from mod_perl / Apache.
> If I go to the command line and execute it through there it works
> fine. I have Apache on my local computer, so both places are pointing
> to the same installation of Perl.
>
> Any ideas what would be causing this?
>
> Thanks,
> Patrick
Sorry, I should have searched Google first. I will post the solution I
found and beg for forgiveness :).
http://modperlbook.org/html/6-5-1-T-and-time.html
"Under mod_perl, processes don't quit after serving a single request.
Thus, $^T gets initialized to the server startup time and retains this
value throughout the process's life. Even if you don't use this
variable directly, it's important to know that Perl refers to the
value of $^T internally."
Patrick
------------------------------
Date: Thu, 18 Feb 2010 07:55:03 +0100
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: $^T is not working as expected from mod_perl
Message-Id: <7r4v47-nil.ln1@news.rtij.nl>
On Wed, 17 Feb 2010 17:53:41 -0800, Patrick Hartman wrote:
> I was using this to calculate execution time at the bottom of a script:
>
> print time - $^T;
>
> However I noticed that the time just got a little bit longer everytime I
> ran it despite the apparent page load time not changing at all. I
> changed it to this:
>
> printf "BEG: $^T \n";
> printf "END: ". time;
>
> And the $^T was outputting the same start time for every execution;
> every time I would load the page, the time just got longer and longer
> since only the end time was updating.
>
> This problem is only happening when I execute from mod_perl / Apache. If
> I go to the command line and execute it through there it works fine. I
> have Apache on my local computer, so both places are pointing to the
> same installation of Perl.
>
> Any ideas what would be causing this?
>
Mod_perl loads the interpreter only once. Just store the start time at
the top of your script and use that instead of ^T.
M4
------------------------------
Date: Wed, 17 Feb 2010 14:06:13 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: a defense of ad hoc software development
Message-Id: <jvpon5lbmbdk5tq50b1eu12963utarn7d9@4ax.com>
Ron Garret <rNOSPAMon@flownet.com> wrote:
>There are two fundamentally different kinds of specifications, those
>that specify WHAT the result should be,
Yes.
>and those that specify HOW the
>result is to be obtained.
That would be over-specified.
jue
------------------------------
Date: 18 Feb 2010 00:31:54 GMT
From: buck <buck@private.mil>
Subject: Re: Anyone willing to modify 3rd party perl code?
Message-Id: <hli1pq01fdv@news7.newsguy.com>
"Uri Guttman" <uri@StemSystems.com> wrote in
news:87iq9vycrt.fsf@quad.sysarch.com:
>>>>>> "b" == buck <buck@private.mil> writes:
> b> You are presuming something not true. I don't make an offer
> because I b> expect someone to read the comments in the file and
> suggest to me the b> amount of time and a rate. That's the kind
of
> person I want to deal b> with.
>
> then you are in the wrong place. the guidelines here say no jobs
> posting. go to jobs.perl.org if you want to hire a perl hacker. your
> original post didn't specify if you wanted to pay or get free work.
> that was a no-no too.
>
> uri
Thanks for the tip. I did read the rules and didn't see that. I
apologize.
--
buck
------------------------------
Date: 18 Feb 2010 00:33:07 GMT
From: buck <buck@private.mil>
Subject: Re: Anyone willing to modify 3rd party perl code?
Message-Id: <hli1s311fdv@news7.newsguy.com>
"Uri Guttman" <uri@StemSystems.com> wrote in
news:87zl37wx36.fsf@quad.sysarch.com:
>>>>>> "b" == buck <buck@private.mil> writes:
>
> b> "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote in
> b> news:slrnhnnuc7.num.hjp-usenet2@hrunkner.hjp.at:
>
> >> I would assume that Christian is willing to adapt the script to
> >> your needs at his usual hourly rate. You can find his company at
> >> http://www.coretec.at/.
> >>
> >> hp
>
> b> Assuming makes you an ass. Had you bothered to navigate to
> Mock's web b> site, you might have another thought - if you are
> capable of thought.
>
> oh, calling someone an ass in public makes you an ass! how do you
like
> them apples? you made the first mistake by posting a job here. the
> second mistake was not even claiming you would pay for it. now you
> compound it with an immediate asshat move. a triple play! now please
> go away and hire someone. but not here.
>
> uri
I replied in kind and make no apology for it.
--
buck
------------------------------
Date: Wed, 17 Feb 2010 21:35:01 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Anyone willing to modify 3rd party perl code?
Message-Id: <87iq9vp8yy.fsf@quad.sysarch.com>
>>>>> "b" == buck <buck@private.mil> writes:
b> "Uri Guttman" <uri@StemSystems.com> wrote in
b> news:87iq9vycrt.fsf@quad.sysarch.com:
>>>>>>> "b" == buck <buck@private.mil> writes:
b> You are presuming something not true. I don't make an offer
>> because I b> expect someone to read the comments in the file and
>> suggest to me the b> amount of time and a rate. That's the kind
b> of
>> person I want to deal b> with.
>>
>> then you are in the wrong place. the guidelines here say no jobs
>> posting. go to jobs.perl.org if you want to hire a perl hacker. your
>> original post didn't specify if you wanted to pay or get free work.
>> that was a no-no too.
>>
>> uri
b> Thanks for the tip. I did read the rules and didn't see that. I
b> apologize.
you should also apologize for calling someone an ass here. we get trolls
and douches all the time and they are not tolerated. you already entered
at least one killfile and possibly others.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 17 Feb 2010 21:35:50 -0500
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Anyone willing to modify 3rd party perl code?
Message-Id: <87eikjp8xl.fsf@quad.sysarch.com>
>>>>> "b" == buck <buck@private.mil> writes:
b> "Uri Guttman" <uri@StemSystems.com> wrote in
b> news:87zl37wx36.fsf@quad.sysarch.com:
>>>>>>> "b" == buck <buck@private.mil> writes:
>>
b> "Peter J. Holzer" <hjp-usenet2@hjp.at> wrote in
b> news:slrnhnnuc7.num.hjp-usenet2@hrunkner.hjp.at:
>>
>> >> I would assume that Christian is willing to adapt the script to
>> >> your needs at his usual hourly rate. You can find his company at
>> >> http://www.coretec.at/.
>> >>
>> >> hp
>>
b> Assuming makes you an ass. Had you bothered to navigate to
>> Mock's web b> site, you might have another thought - if you are
>> capable of thought.
>>
>> oh, calling someone an ass in public makes you an ass! how do you
b> like
>> them apples? you made the first mistake by posting a job here. the
>> second mistake was not even claiming you would pay for it. now you
>> compound it with an immediate asshat move. a triple play! now please
>> go away and hire someone. but not here.
>>
>> uri
b> I replied in kind and make no apology for it.
your loss as you won't get as good perl help as you want here as you
have been killfiled by at least one regular if not more.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Wed, 17 Feb 2010 16:43:31 -0800 (PST)
From: cate <catebekensail@yahoo.com>
Subject: ExcelPrepHTML.pm
Message-Id: <447b0e44-c0f1-4851-bb84-f0efa187f5b9@f29g2000yqa.googlegroups.com>
misc - this has got to be the place.
Sorry if this is outside the limits of a perl question, but has anyone
ever worked with HTML, preparing it for an Excel HTML import? We are
sending HTML to the client via
$Response->AddHeader("Content-Type","application/vnd.ms-excel");
$Response->AddHeader("Content-
Disposition","attachment;filename=Export2Excel_${filename}.xls");
$Response->BinaryWrite($postContent);
But the rendering in Excel is terrible. Is there a perl
ExcelPrepHTML.pm out there? I wish I knew more about the Excel import
rules, but I don't. Hoping someone else does; then stuck it all in a
module.
I see some code out there that use OLE to manipulate the workbook, but
this is strictly a hand off.
Thank you
------------------------------
Date: Wed, 17 Feb 2010 19:05:30 -0600
From: John Bokma <john@castleamber.com>
Subject: Re: ExcelPrepHTML.pm
Message-Id: <87vddvcq05.fsf@castleamber.com>
cate <catebekensail@yahoo.com> writes:
> misc - this has got to be the place.
>
> Sorry if this is outside the limits of a perl question, but has anyone
> ever worked with HTML, preparing it for an Excel HTML import? We are
> sending HTML to the client via
>
> $Response->AddHeader("Content-Type","application/vnd.ms-excel");
> $Response->AddHeader("Content-
> Disposition","attachment;filename=Export2Excel_${filename}.xls");
> $Response->BinaryWrite($postContent);
>
> But the rendering in Excel is terrible. Is there a perl
> ExcelPrepHTML.pm out there? I wish I knew more about the Excel import
> rules, but I don't. Hoping someone else does; then stuck it all in a
> module.
>
> I see some code out there that use OLE to manipulate the workbook, but
> this is strictly a hand off.
Does it have to be HTML?
--
John Bokma j3b
Hacking & Hiking in Mexico - http://johnbokma.com/
http://castleamber.com/ - Perl & Python Development
------------------------------
Date: Wed, 17 Feb 2010 20:21:19 -0800 (PST)
From: mud_saisem <mud_saisem@hotmail.com>
Subject: File Position
Message-Id: <5657cf59-1c84-4933-a5e2-2d07d980b71a@l24g2000prh.googlegroups.com>
Hi There,
Does anybody know how to read through a file searching for a word and
printing the file position of that word ?
Thanks.
------------------------------
Date: Wed, 17 Feb 2010 22:56:41 -0600
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: File Position
Message-Id: <slrnhnphtc.ql3.tadmc@tadbox.sbcglobal.net>
mud_saisem <mud_saisem@hotmail.com> wrote:
> Does anybody know how to read through a file searching for a word and
^^^^^^^^^
> printing the file position of that word ?
-----------------------
#!/usr/bin/perl
use warnings;
use strict;
my $pos;
while (<DATA>) {
if ( /(.*)searching/ ) {
print $pos + length $1, "\n";
exit;
}
$pos += length;
}
__DATA__
Hi There,
Does anybody know how to read through a file searching for a word and
printing the file position of that word ?
Thanks.
-----------------------
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
------------------------------
Date: Thu, 18 Feb 2010 06:22:51 +0100
From: Peter Makholm <peter@makholm.net>
Subject: Re: File Position
Message-Id: <87k4ub86dw.fsf@vps1.hacking.dk>
mud_saisem <mud_saisem@hotmail.com> writes:
> Does anybody know how to read through a file searching for a word and
> printing the file position of that word ?
If your file contains plain ascii, iso-8859, or another 8bit charset
it should be easy. The tell() function gives you the current location
in the file, pos() gives you the location of regexp match, and
index() directly gives you the location.
So this should work (untested though)
my $offset = 0;
while (<$fh>) {
if (/word/) {
say "Found 'word' at location ", $offset + pos();
}
$offset = tell $fh;
}
If you file contains a variable width uniode encoding (like utf-8) it
gets a lot harder.
//Makholm
------------------------------
Date: Wed, 17 Feb 2010 21:50:47 -0800 (PST)
From: mud_saisem <mud_saisem@hotmail.com>
Subject: Re: File Position
Message-Id: <0010e87a-c46a-4d02-babf-921c54c6031e@e19g2000prn.googlegroups.com>
On Feb 18, 4:22=A0pm, Peter Makholm <pe...@makholm.net> wrote:
> mud_saisem <mud_sai...@hotmail.com> writes:
> > Does anybody know how to read through a file searching for a word and
> > printing the file position of that word ?
>
> If your file contains plain ascii, iso-8859, or another 8bit charset
> it should be easy. The tell() function gives you the current location
> in the file, pos() gives you the location of regexp match, and
> index() directly gives you the location.
>
> So this should work (untested though)
>
> =A0 my $offset =3D 0;
> =A0 while (<$fh>) {
> =A0 =A0 =A0 if (/word/) {
> =A0 =A0 =A0 =A0 =A0 say "Found 'word' at location ", $offset + pos();
> =A0 =A0 =A0 }
> =A0 =A0 =A0 $offset =3D tell $fh;
> =A0 }
>
> If you file contains a variable width uniode encoding (like utf-8) it
> gets a lot harder.
>
> //Makholm
Very Nice, Thank for the help !
------------------------------
Date: Wed, 17 Feb 2010 21:56:22 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: File Position
Message-Id: <13lpn5de9btivse748rbsc3go39jujgp03@4ax.com>
mud_saisem <mud_saisem@hotmail.com> wrote:
>Does anybody know how to read through a file searching for a word and
>printing the file position of that word ?
Please define 'position': are you talking about characters or bytes?
Just slurp the whole file into a string and then use index() to get the
position of the desired word in that string.
This is very straight-forward and unless you are dealing with
exceptionally large files (GB size) or unusual distribution of your
'word' (almost always very early in the file) probably also faster than
any looping line by line or chunk by chunk.
jue
------------------------------
Date: Wed, 17 Feb 2010 22:12:13 -0800 (PST)
From: mud_saisem <mud_saisem@hotmail.com>
Subject: Re: File Position
Message-Id: <9d712262-8e76-49d0-a04c-f837a044c180@k2g2000pro.googlegroups.com>
On Feb 18, 4:56=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> mud_saisem <mud_sai...@hotmail.com> wrote:
> >Does anybody know how to read through a file searching for a word and
> >printing the file position of that word ?
>
> Please define 'position': are you talking about characters or bytes?
>
> Just slurp the whole file into a string and then use index() to get the
> position of the desired word in that string.
> This is very straight-forward and unless you are dealing with
> exceptionally large files (GB size) or unusual distribution of your
> 'word' (almost always very early in the file) probably also faster than
> any looping line by line or chunk by chunk.
>
> jue
The logs file that I will be scanning through range from 500Mb to 5Gb.
So adding the content of the file into memory is not a option.
What I meant about position was, if i am looking for a word like
"slurp" (from your paragraph), it should tell me where in the file the
word is, so that I can use the seek function and jump directly to the
position in the file where the word "slurp" is.
------------------------------
Date: Thu, 18 Feb 2010 00:08:00 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: File Position
Message-Id: <5tspn5hrhnkmvlmn7o917frba3tqvbpjs7@4ax.com>
mud_saisem <mud_saisem@hotmail.com> wrote:
>On Feb 18, 4:56 pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>> mud_saisem <mud_sai...@hotmail.com> wrote:
>> >Does anybody know how to read through a file searching for a word and
>> >printing the file position of that word ?
>>
>> Please define 'position': are you talking about characters or bytes?
[...]
>What I meant about position was, if i am looking for a word like
>"slurp" (from your paragraph), it should tell me where in the file the
>word is,
That is not any more specific than your first requrest. It could still
be bytes or characters.
>so that I can use the seek function
Now, that is the critical clue. seek() is based on bytes, so you need a
position in bytes in order to use seek().
Position in characters would do you no good and therefore my suggestion
with index() wouldn't do you any good, either, because it returns the
position in characters. As does the suggestion from Peter Makholm. His
regular expression search is character-based, too, therefore it will not
return the byte-based position that you need for seek().
That is unless your file is in a single-byte character set, of course,
but you didn't say.
jue
------------------------------
Date: Wed, 17 Feb 2010 22:30:19 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: How to get offset position from unpack()?
Message-Id: <r87u47-722.ln1@osiris.mauzo.dyndns.org>
Quoth "jl_post@hotmail.com" <jl_post@hotmail.com>:
> > Quoth "jl_p...@hotmail.com" <jl_p...@hotmail.com>:
> >
> > However, there's something I want to do with unpack() that I
> > haven't figured out how to do: I'd like to unpack part of a
> > string, but keep track of where the unpacking ended, so I can
> > resume unpacking the string (at a later time) where I left off.
>
>
> On Feb 15, 1:48 pm, Ben Morrow <b...@morrow.me.uk> replied:
> > ~% perl -E'my $x = "aaa"; say for unpack "a2.", $x'
> > aa
> > 2
> > ~%
>
>
> Wow, thanks! The '.' character was exactly what I was looking for!
>
> (I notice it's new in Perl 5.10, so if I'm working for platforms
> that have an older version of Perl I'll just have to just the old "a*"
> trick.)
>
> I tried searching for "."'s behavior in "perldoc -f unpack",
> "perldoc -f pack", and even "perldoc perlpacktut", but I couldn't find
> where it mentions that it returns the offset when used with unpack().
> Is there a place that explains this with a little more depth?
If there is, I didn't find it either. I just tried 'unpack "."' and
'unpack "@"' since they looked like likely possibilities, and "."
worked.
Ben
------------------------------
Date: Wed, 17 Feb 2010 15:55:37 -0800
From: sln@netherlands.com
Subject: Re: utf8, length and syswrite are killing me
Message-Id: <gqvon5pvuee2fr5c40ho9goi6in2qj2j81@4ax.com>
On Wed, 17 Feb 2010 10:28:59 -0800 (PST), "A. Farber" <alexander.farber@gmail.com> wrote:
>Hello,
>
>I have a russian card game at
>http://apps.facebook.com/video-preferans/
>which I've recently moved from using urlencoded data
>to XML data in UTF-8. Since then it often hangs
>for the users and I suspect, that my subroutine:
>
>sub enqueue {
> my $child = shift;
> my $data = shift;
> my $fh = $child->{FH};
> my $response = $child->{RESPONSE};
>
> # flash.net.Socket.readUTF() expects 16-bit prefix in network
>order
> my $prefix = pack 'n', length $data;
>
> # append to the end of the outgoing queue
> push @{$response}, $prefix . $data;
>}
>
>packs wrong number of bytes for cyrillic messages.
>
If '$data' is still a Perl string,
I would encode() to UTF-8 octets then
push @outarray, pack ('n a*', length($octets), $octets);
But, you could do it a couple of different ways. Basically
you want the length to be of the encoded data, not the length
of the perl string (if it's in Perl character semantics).
You really don't want to push '$prefix . $data' if $data is
not yet encoded utf-8. If it is already encoded utf-8, then
the length would be correct because its already bytes (octets),
not character semantics.
You should read the Unicode docs: perluniintro, perlunicode, unicode, etc.
Each have links that take you to each other documentation.
Below is some examples of a couple of ways to do it. See what works
for you.
-sln
----------------------
use strict;
use warnings;
use Encode;
binmode (STDOUT, ':encoding(UTF-8)');
##
my $perlstring = "This is a string <\x{2100}>...";
my $utf8octets = encode('UTF-8', $perlstring);
my $packd_string = pack('n', length($utf8octets));
my $unpackd_string = unpack('n', $packd_string);
print "** Perl string : '$perlstring', length = ", length($perlstring),"\n\n";
print "UTF-8 octets: '$utf8octets', length = ", length($utf8octets),"\n\n";
print "Packed length of encoded string is $unpackd_string\n\n";
##
my $len_plus_octets = $packd_string . $utf8octets;
print "Length.UTF-8 octets: '$len_plus_octets'\n\n";
##
my $packd_all = pack ('n a*', length($utf8octets), $utf8octets);
print "Packed all : '$packd_all', length = ",length($packd_all),"\n\n";
##
my ($len,$octets) = unpack ('n a*', $packd_all);
print "Unpacked all : '$octets', length = ",length($octets),"\n";
print " : read packed length = $len\n\n";
my $decoded_string = decode('UTF-8', $octets);
print "** Perl string : '$decoded_string', length = ", length($decoded_string), "\n\n";
if ($decoded_string eq $perlstring) {
print "** Perl strings are equal.\n";
}
else {
print "** Perl strings are not equal.\n";
}
__END__
** Perl string : 'This is a string <GäÇ>...', length = 23
UTF-8 octets: 'This is a string <+ó-ä-Ç>...', length = 25
Packed length of encoded string is 25
Length.UTF-8 octets: ' ?This is a string <+ó-ä-Ç>...'
Packed all : ' ?This is a string <+ó-ä-Ç>...', length = 27
Unpacked all : 'This is a string <+ó-ä-Ç>...', length = 25
: read packed length = 25
** Perl string : 'This is a string <GäÇ>...', length = 23
** Perl strings are equal.
------------------------------
Date: Wed, 17 Feb 2010 23:14:25 -0800 (PST)
From: "A. Farber" <alexander.farber@gmail.com>
Subject: Re: utf8, length and syswrite are killing me
Message-Id: <dfe7e8bb-0c3e-4012-8cdb-bb111f846e55@x22g2000yqx.googlegroups.com>
Thank you! I've ended up with encode($data) and after that the
length() gives me the number of bytes for the syswrite (I hope)
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 2823
***************************************