[21878] in Perl-Users-Digest
Perl-Users Digest, Issue: 4082 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 7 18:11:33 2002
Date: Thu, 7 Nov 2002 15:10:13 -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, 7 Nov 2002 Volume: 10 Number: 4082
Today's topics:
Re: Simple question - What is unicode? <flavell@mail.cern.ch>
Re: Simple question - What is unicode? (Malcolm Dew-Jones)
Re: Simple question - What is unicode? <flavell@mail.cern.ch>
Re: Simple question - What is unicode? <pkent77tea@yahoo.com.tea>
Test-Unit on Win32: OutputDebugString at 'assert' failu (Phlip)
Unstricting a 'map' <bernie@fantasyfarm.com>
Re: Unstricting a 'map' <goldbb2@earthlink.net>
Re: Why not PERL? <usenet@dwall.fastmail.fm>
Re: Why not PERL? <graham.lee@wadham.ox.ac.uk>
Re: Why not PERL? <holland@origo.phys.au.dk>
Re: Win32::OLE talking to IIS webserver (again) <brian_helterline@hp.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 7 Nov 2002 20:19:46 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Simple question - What is unicode?
Message-Id: <Pine.LNX.4.40.0211072007520.12812-100000@lxplus075.cern.ch>
On Nov 7, W K inscribed on the eternal scroll:
> > Not exactly. Unicode assigns numerical values to characters, but
> > there are numerous ways (several of which are in active use) of
> > actually encoding those numerical values to represent a character.
>
> I was really meaning simple 2 byte UCS-2 ? is that utf 16 ?
(The answer to that question has overlapped with your f'up. For many
purposes you can treat them as effectively synonymous, if you factor
out considerations of byte ordering.)
> anyway - that sounds like what hes got if it turns out like "#A#B#C",
Agreed.
------------------------------
Date: 7 Nov 2002 13:19:32 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Simple question - What is unicode?
Message-Id: <3dcad8e4@news.victoria.tc.ca>
Alan J. Flavell (flavell@mail.cern.ch) wrote:
: On Nov 6, W K inscribed on the eternal scroll:
: > Helgi Briem <helgi@decode.is> wrote
: > > Unicode is a scheme for encoding alphabets
: Not exactly. Unicode assigns numerical values to characters, but
: there are numerous ways (several of which are in active use) of
: actually encoding those numerical values to represent a character.
: > > other than
: > > the Latin by encoding each character with 2 bytes instead
: > > of 1.
: Some confusion here.
: > All latin-1 and ascii have the same numerical values in unicode,
: Yes
: > BUT are now represented by two bytes instead of one.
: That depends on the coding chosen.[1]
: The problem here is that many folks coming to Unicode for the first
: time have a background only in 8-bit character codings, where it's
: obvious that once the characters have been identified by the numerical
: values 0-255 you can represent them by the correspondingly-valued
: octet (byte), end of story. So there is no distinction between the
: character code (i.e the assignment of characters to smallish integers)
: and the character encoding scheme (the bit-patterns used to transmit
: those integers). In Unicode you cannot get away with that: it's
: necessary to observe the distinction.
: Note that recent versions of Unicode have more characters than can be
: represented by a 16-bit number. Which means that ucs-2 can no longer
: represent the full unicode range, and therefore utf-16 was introduced.
<rant>
Yes, but this is only due to lack of mental disipline which has allowed
the whole beauty and simplicity of the original unicode scheme to be
subsumed to unnecessary complications.
Original character data transmission (30's/40's or so) was in very few
bits. That is why an old telegram was always in captial letters, with
some punctuation spelled out. As technology improved and prices went
down, the number of bits used increased to six, and then 7 and now 8 bits.
ASCII was created when 7 bits was the value normally available.
With modern computers there is no reason why a larger size for all
elementry units of data could not be used, and there's no real reason why
computers, storage, and transmission devices could not use a larger byte
size except for a misplaced concern about efficency. Efficency has always
been a trade off. In the past, as larger sizes became practical, they
were used because of the increased functionality and simplicity. For some
reason, people are unable now to change their thought patterns to accept
an extremely simple scheme that solves the vast majority of text exchange
issues.
The original unicode idea was to pave the way to standardize the next
generation of data unit at 16 bits, and to define, for textual data, how
to map those 16 bits to elementry textual/language units in the same
utterly simple one to one manner that made it so easy to work with plain
old ascii text.
As for running out of values for all languages, what do you expect when
the standard wastes the "unicode bandwidth" for languages such as klingon.
This is simply an example of the lack of mental disipline as mentioned
earlier.
</rant>
------------------------------
Date: Thu, 7 Nov 2002 23:38:25 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Simple question - What is unicode?
Message-Id: <Pine.LNX.4.40.0211072333590.4762-100000@lxplus075.cern.ch>
On Nov 7, Alan J. Flavell inscribed on the eternal scroll:
> The specific bit-combination, if it occurs at the start of a file, is
> always a BOM,
I have to correct myself, sorry.
> whereas if it occurs anywhere else, it's a zero-width
> no-break space.
The bit pattern in question cannot be a BOM anywhere than at the
beginning of a file: anywhere else it's a zwnbsp. That much was
correct.
But it's possible for the parties to agree to use, or not to use, BOM
semantics. If they're not using BOM semantics, then the bit pattern
is capable of being used as a zwnbsp at the start of the file. The
FAQs explain it better than I did.
In short, I seem to have out-pedanted myself :-} Apologies.
------------------------------
Date: Thu, 07 Nov 2002 22:43:18 GMT
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Simple question - What is unicode?
Message-Id: <pkent77tea-663869.22431707112002@news-text.blueyonder.co.uk>
In article <aqdld3$ms2$1@nets3.rz.RWTH-Aachen.DE>,
"Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de> wrote:
> Hadn't the Britons decided to use such an odd character for their
> currency (£), they'd probably get on quite well with plain ascii. ;-)
That's _nothing_ compared to people using MS Word's smart quotes in XML
files, and wondering why XML::Parser dies.
FWIW, I generally say 'GBP' unless I know the other person can actually
see £ properly. And I'm sure Angry of Tunbridge Wells is writing
to you _as we speak_ to point out that the Pounds Sterling sign predates
computers, and that the A in ASCII is 'American' so it's only natural
that it should be tailored for the US usage.
P
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: 7 Nov 2002 11:43:24 -0800
From: phlip_cpp@yahoo.com (Phlip)
Subject: Test-Unit on Win32: OutputDebugString at 'assert' failure time.
Message-Id: <63604d2.0211071143.eb60484@posting.google.com>
Perlies:
I like unit tests. My employers like Win32, VC++, and Perl. So here I
am writing an "acceptance test" rig for our VC++ code, and it calls
Perl embedded in the C++ code.
When an assertion fails, such as this one...
$self -> assert ($result =~ /LW is god/);
...I want the VC++ Output window to contain the file name, line
number, and spit-list of the failure:
c:\projects\testage.pm:14: get a clue, homey...
That way I can tap <F4> and go straight to the offending line in the
editor. No more reading & GotoLine-ing. That's the computer's job.
(Other Perl editors may support these kinds of features before the new
Millenium is old...)
So first I get OutputDebugString from here:
Win32-API-OutputDebugString-0.03.tar.gz
Now I feel like overriding Test::Unit::Debug::debug so it also pushes
text out OutputDebugString:
use Test::Unit::Debug;
{
package Test::Unit::Debug;
*Test::Unit::Debug::debug = sub {
my ($package, $filename, $line) = caller();
print $out "***************************************that's the
facts, Jack!\n";
print $out @_ if $DEBUG{$package};
}
}
That's as far as I can decipher the documentation on global hostile
takeover-style overrides. But even with "strict" and "-w" turned off,
Perl still screams at me: "Subroutine debug redefined..."
Then, if Perl think's it's "redefined" (past-tense), why don't Perl
then call it?
How am I expected to do this?
(BTW I can't "inherit" Test::Unit::Debug and then overload because the
other Test-Unit stuff won't call my derived class.)
--
Phlip
http://www.greencheese.org/NorovostokNovus
-- All sensors report Patti having a very good time --
------------------------------
Date: Thu, 07 Nov 2002 17:32:43 -0500
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Unstricting a 'map'
Message-Id: <51AAB7694E3F6496.14BCDE572B8BDC41.6B7ACC0259810DBB@lp.airnews.net>
I have a bit of code that looks like:
map { no strict 'refs';
[stuff that requires refs to be turned off]
}
@array;
And on that line I'm getting '"no" not allowed in expression...'. I
specifically used the 'block' form of map precisely because I needed to be
able to un-strict it. I realize that I can just move the map one level
higher. In the dumbest case, I can do:
my @res ;
{ no strict 'refs';
@res = map { dangerousstuff} ;
}
But it isn't clear to me *why* I would need to go to that trickery. This
with 5.6.1.
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Thu, 07 Nov 2002 18:02:25 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Unstricting a 'map'
Message-Id: <3DCAF101.D912FB10@earthlink.net>
Bernie Cosell wrote:
>
> I have a bit of code that looks like:
> map { no strict 'refs';
> [stuff that requires refs to be turned off]
> }
> @array;
> And on that line I'm getting '"no" not allowed in expression...'. I
> specifically used the 'block' form of map precisely because I needed
> to be able to un-strict it.
The problem is that perl doesn't think it's a block -- it thinks that
the '{' is to indicate the start of anonymous hash. Add a ';' in
between the '{' and the 'no', and it should work as intended.
> I realize that I can just move the map one level
> higher. In the dumbest case, I can do:
> my @res ;
> { no strict 'refs';
> @res = map { dangerousstuff} ;
> }
Actually, if you did want to use such trickery, I would suggest doing:
my @res = do { no strict 'refs'; map { stuff } LIST };
Since you don't need to mention @res twice, that way.
> But it isn't clear to me *why* I would need to go to that trickery.
> This with 5.6.1.
perldoc -f map
And see the stuff about ambiguous stuff.
--
my $n = 2; print +(split //, 'e,4c3H r ktulrnsJ2tPaeh'
."\n1oa! er")[map $n = ($n * 24 + 30) % 31, (42) x 26]
------------------------------
Date: Thu, 07 Nov 2002 19:12:21 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: Why not PERL?
Message-Id: <Xns92BF908246542dkwwashere@216.168.3.30>
cp <cpryce@pryce.net> wrote on 07 Nov 2002:
> Another reason for the flames is that the answer to your question is
> found in the FAQs. And people that make the mistake of writing PERL
> demonstrate that they haven't read those either.
Including some book publishers.
I recently ran across a program that claimed full support for "Pearl's
regular expressions". Um... ok....
--
David K. Wall - usenet@dwall.fastmail.fm
"Oook."
------------------------------
Date: Thu, 07 Nov 2002 20:36:06 +0000
From: Frodo Morris <graham.lee@wadham.ox.ac.uk>
Subject: Re: Why not PERL?
Message-Id: <aqeiop$i7u$1@news.ox.ac.uk>
TBN wrote:
> I've only been using Perl for a couple of months, so I'll admit to ignorance
> here, but according to ActiveState, Perl stands for "Practical Extraction
> and Report Language". If that's the case, it should be PERL. But if anyone
> ever refers to it as PERL on this usenet group, they get chastised promptly
> and harshly. Fortunately, I saw this "mistake" in others before posting
> messages, so I didn't have to suffer any flames for it, but can someone
> elaborate on why this is such a horrible thing to the point where some
> people ignore the poster's question altogether just to correct their "PERL"?
> Seems like time wasted, but I'm open to hearing some supporting arguments to
> help me "see the light."
>
>
I thought it was the Pathologically Eclectic Rubbish Lister. Don't tell
anyone.
--
FM
------------------------------
Date: 07 Nov 2002 21:46:41 +0100
From: Steve Holland <holland@origo.phys.au.dk>
Subject: Re: Why not PERL?
Message-Id: <w477kfpds5q.fsf@origo.phys.au.dk>
Frodo Morris <graham.lee@wadham.ox.ac.uk> writes:
> TBN wrote:
> > I've only been using Perl for a couple of months, so I'll admit to ignorance
> > here, but according to ActiveState, Perl stands for "Practical Extraction
> > and Report Language". If that's the case, it should be PERL. But if anyone
> > ever refers to it as PERL on this usenet group, they get chastised promptly
> > and harshly. Fortunately, I saw this "mistake" in others before posting
> > messages, so I didn't have to suffer any flames for it, but can someone
> > elaborate on why this is such a horrible thing to the point where some
> > people ignore the poster's question altogether just to correct their "PERL"?
> > Seems like time wasted, but I'm open to hearing some supporting arguments to
> > help me "see the light."
> I thought it was the Pathologically Eclectic Rubbish Lister. Don't tell
> anyone.
I have always prefered Practically Eliminates Rival Languages,
even though it does not.
=====================================================================
To find out who and where I am look at:
http://www.nd.edu/~sholland/index.html
"An eagle can not fly with a broken left wing."
=====================================================================
------------------------------
Date: Thu, 7 Nov 2002 14:27:43 -0800
From: "Brian Helterline" <brian_helterline@hp.com>
Subject: Re: Win32::OLE talking to IIS webserver (again)
Message-Id: <aqepg1$k5j$1@hpcvsgen.cv.hp.com>
"Christian Caron" <nospam@nospam.org> wrote in message
news:<aqecht$r59@nrn2.NRCan.gc.ca>...
> Here's the code:
>
>
############################################################################
> use Win32::OLE;
> use OLE;
> use strict;
>
> my $websvc = Win32::OLE->GetObject("IIS://localhost/W3SVC/3") || print
> Win32::OLE->LastError;
> print $websvc->{"ServerComment"};
>
> exit;
>
############################################################################
>
> Here's the output:
>
> CGI Error
> The specified CGI application misbehaved by not returning a complete set
of
> HTTP headers. The headers it did return are:
>
> Win32::OLE(0.1403) error 0x80070005: "Access is denied"
> after character 0 in "IIS://localhost/W3SVC/3"
It sounds like a permissions problem...
>
> The reason I'm posting here is because I use Perl to connect to the MMC. I
> just hope somebody already came across a problem like this and may help
me.
If I understand you correctly, you are calling this script as a CGI script?
If so, scripts tend not to have permission to mess around outside the
heirarchy
or the web server - and for good reason. Your script is most likely running
under the IUSR_<machine name> account for Windows which is a guest account
with very few privlidges.
-brian
>
> Thanks!
>
> Christian
>
>
------------------------------
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:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
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 V10 Issue 4082
***************************************