[23511] in Perl-Users-Digest
Perl-Users Digest, Issue: 5720 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 28 14:07:50 2003
Date: Tue, 28 Oct 2003 11:05:09 -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 Tue, 28 Oct 2003 Volume: 10 Number: 5720
Today's topics:
Re: add text to next line? <minceme@start.no>
Beta Tester - Win a trip to London (Johnny P)
Checkbox - database checkbox, if checked gives value o (randy)
Re: debugging multi-file scripts using perldb (Peter Scott)
Re: error from - eval "do script" - unsolved: does not (Malcolm Dew-Jones)
Re: Expanding a perl regex to a list of files with full <neil.shadrach@corryn.com>
Re: Guide for dealing with alternate character sets? <usenet@morrow.me.uk>
Re: Guide for dealing with alternate character sets? <flavell@ph.gla.ac.uk>
Re: How To activate command line history in debugger? <k.kronschnabl-nospam@ica-intercom-akademie.de>
Re: Is there a VAR to count the number of occurences of (Roy Johnson)
multiline regular expression, is it possible? (Leif Wessman)
Re: multiline regular expression, is it possible? <noreply@gunnar.cc>
Re: Perl and IIS - script runs but 'The page cannot be <tom@ztml.com>
Re: Perl and IIS - script runs but 'The page cannot be <jurgenex@hotmail.com>
Re: Perl and IIS - script runs but 'The page cannot be <flavell@ph.gla.ac.uk>
Re: Perl and IIS - script runs but 'The page cannot be <jurgenex@hotmail.com>
Re: Printing folder contents <raisin@delete-this-trash.mts.net>
regex for stripping HTML <vilain@spamcop.net>
Re: runtime load of code (Alythh)
Singleton process (Roy Johnson)
Re: Singleton process <tassilo.parseval@rwth-aachen.de>
Re: Singleton process <usenet@morrow.me.uk>
Re: strange effect with [:lower:] in perl <flavell@ph.gla.ac.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 28 Oct 2003 18:36:01 +0000 (UTC)
From: Vlad Tepes <minceme@start.no>
Subject: Re: add text to next line?
Message-Id: <bnmcuh$daa$2@troll.powertech.no>
* Geoff Cox <geoff.cox@blueyonder.co.uk> (CCCI'st day of year MMIII)
> On Wed, 15 Oct 2003 16:10:09 +0100, Peter Hickman
> <peter@semantico.com> wrote:
>
>>What you prehaps should be looking at is CSS, you can have one stylesheet for
>>screen display and another for printing. The use just has to select that they
>>wish to print the page and the printing stylesheet will be used.
>
> Peter,
>
> that sounds interesting ... how does yser select the print style
> sheet?
The user doesn't have to. The stylesheet specifies the fonts used
for screen as well as fonts used for printing. When the user chooses
to print the page, the print-styles are chosen automatically by the
browser.
* { font-family: sans-serif, arial, helvetica }
@media print { /* fonts used for printing: */
body { margin: 1cm }
h1 { font-family: serif, Times; }
p { font-size: 11pt }
}
Another possibility is to link the html to two different stylesheets, one
for the screen and one to be used for printing the page:
<link rel="stylesheet" type="text/css" media="screen" href="screen.css">
<link rel="stylesheet" type="text/css" media="print" href="print.css">
( This is untested and off-topic in this group. Search the web and
ask in a group for html or css for more and better information about
css and selective styles. )
--
\/L/\D
------------------------------
Date: 28 Oct 2003 09:37:34 -0800
From: yonipa@hotmail.com (Johnny P)
Subject: Beta Tester - Win a trip to London
Message-Id: <5e72c5d9.0310280937.70379542@posting.google.com>
WhiteSmoke Technologies has released its program for beta testing
please visit our website and download the program. Whoever finds the most
bugs wins a trip to London.
www.whitesmoke.com
Username: betatester
PW: 0201
------------------------------
Date: 28 Oct 2003 10:25:26 -0800
From: searsdvdtech@yahoo.com (randy)
Subject: Checkbox - database checkbox, if checked gives value of 1 .. how to sum ?
Message-Id: <506a5f6b.0310281025.43cccebd@posting.google.com>
Checkbox - field in database is defined as checkbox, name of field
"comp" , if checked gives value of 1 .. how to get the sum these
checked checkbox values. see page at
http://baseportal.com/cgi-bin/baseportal.pl?htx=/searsdvdtech/testforperl.
here is the code i used
<do action=all>
<loop db=testforperl=perl>
$sum+=$_loop{"comp"};
</loop>
this does not work ... any suggestions...thanks
------------------------------
Date: Tue, 28 Oct 2003 15:10:25 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: debugging multi-file scripts using perldb
Message-Id: <BFvnb.205884$6C4.26871@pd7tw1no>
In article <94556837.0310271239.e2e82b2@posting.google.com>,
g_s_shah@hotmail.com (Gaurav Shah) writes:
>I'm using perldb to debug scripts that call functions from many
>different files, which are included with the "require" command.
>
>How do I set a breakpoint in a function, or at a line, that is found
>in a file other than the main one?
If the function has already been compiled, 'b funcname' will do it.
Of course, it may be in another package and hence 'b somepack::funcname'.
To switch to another source file to use its line numbers, use the
'f' command.
If the function hasn't been compiled yet, you can use
'b postpone funcname' to set a breakpoint on it when it is eventually
loaded.
--
Peter Scott
http://www.perldebugged.com
------------------------------
Date: 28 Oct 2003 09:41:26 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: error from - eval "do script" - unsolved: does not set $@
Message-Id: <3f9eaa46@news.victoria.tc.ca>
Sunil (sunil_franklin@hotmail.com) wrote:
: but my code like
: my $fullFileName = 'setvars.pl';
: my $evalStr = "do \'$fullFileName\'";
: eval "$evalStr";
: does not seem to set the $@ variable even though I am able to see the error
: in the console.
perldoc -f eval
...
using
"eval" neither silences perl from printing warn-
ings to STDERR, nor does it stuff the text of
warning messages into "$@"
...
perhaps this is your situation.
------------------------------
Date: Tue, 28 Oct 2003 15:14:58 +0000 (UTC)
From: Neil Shadrach <neil.shadrach@corryn.com>
Subject: Re: Expanding a perl regex to a list of files with full paths
Message-Id: <bnm15i$csk$1@visp.bt.co.uk>
Anno Siegel wrote:
> Why not? $File::Find::name contains the complete path, you can match
> against that.
True. I suppose what I rather vaguely had in mind was a way of using the module that
would optimize the search. That is not go down paths that could not possibly
match - if this could be determined from the expression. This implies breaking it
down in some way I guess. I did this by splitting on '/' but of course I've
lost the regex then. May be my best practical option.
> In general, there is no other way but to dive into *all* directories
> looking for a match. With a general regex you won't be able to tell
> from looking at a directory name whether the directory can hold
> matching files or not. Just think of /^a.*a$/ or even /^(.).*\1/.
>
> So, unless you can divide the regex into parts that match individual
> path components, you will have to walk the entire directory tree.
That's the conclusion I came to but I've been wrong before so I thought I'd ask :)
Thanks
Neil Shadrach
------------------------------
Date: Tue, 28 Oct 2003 16:50:25 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Guide for dealing with alternate character sets?
Message-Id: <bnm6oh$eel$1@wisteria.csv.warwick.ac.uk>
"Alan J. Flavell" <flavell@ph.gla.ac.uk> wrote:
> Beware of the interaction with your locale setting! In RedHat 9 for
> example the default locale setting will imply Unicode, and Perl (5.8.0
> and later) will respond to this in various ways.
5.8.0 only. This feature was considered to cause more problems than it
was worth, and was removed by default (although it can be activated
with a stolen -C switch) in 5.8.1. If you have a Unicode default
locale, it may be worth switching to 5.8.1 to save yourself some
pain... :)
Ben
--
. | .
\ / The clueometer is reading zero.
. .
__ <-----@ __ ben@morrow.me.uk
------------------------------
Date: Tue, 28 Oct 2003 16:55:02 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Guide for dealing with alternate character sets?
Message-Id: <Pine.LNX.4.53.0310281654090.28979@ppepc56.ph.gla.ac.uk>
On Tue, 28 Oct 2003, Ben Morrow wrote:
> > Beware of the interaction with your locale setting! In RedHat 9 for
> > example the default locale setting will imply Unicode, and Perl (5.8.0
> > and later) will respond to this in various ways.
>
> 5.8.0 only. This feature was considered to cause more problems than it
> was worth, and was removed by default
Ah, thanks for the correction!
------------------------------
Date: Tue, 28 Oct 2003 16:43:32 +0100
From: Kurt Kronschnabl <k.kronschnabl-nospam@ica-intercom-akademie.de>
Subject: Re: How To activate command line history in debugger?
Message-Id: <bnm2pq$p80$01$2@news.t-online.com>
Finally I found a solution for Knoppix 3.2 with Pater Scotts help:
First I installed Readline from
http://search.cpan.org/~ilyaz/Term-ReadLine-Perl-1.0203/
Then ReadKey didn't work not yet (Error message after instaling) inspite
of ReadKey.pm has been in the Lib path ($INC). But the history worked
already.
To get rid of the ReadLine Error message I reinstalled Term::ReadKey
interactive via "perl -MCPAN -e shell". Now it works perfect!
Regards, Kurt
------------------------------
Date: 28 Oct 2003 06:46:54 -0800
From: rjohnson@shell.com (Roy Johnson)
Subject: Re: Is there a VAR to count the number of occurences of matching
Message-Id: <3ee08638.0310280646.6ceb3d24@posting.google.com>
yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote in message news:<3f9da255@news.victoria.tc.ca>...
>
> Or
>
> $number_of_occurences_of_RE_in_x = () = $x=~m/$RE/g;
Or (oddly enough):
$number_of_occurences_of_RE_in_x = map(/$RE/g, $x);
which is somehow a little faster:
use strict;
use warnings;
use Benchmark;
my $str = 'aabaacbbacbabcbacbacbac';
my $re = qr/ac/;
my $num;
timethese(100_000, {
'mapmatch' => sub { $num = map(/$re/g, $str) },
'vialist' => sub { $num = () = $str =~ /$re/g }
});
$num = map(/$re/g, $str);
print "There are $num $re s in $str\n";
$num = () = $str =~ /$re/g;
print "There are $num $re s in $str\n";
--- output ---
Benchmark: timing 100000 iterations of mapmatch, vialist...
mapmatch: 1 wallclock secs ( 1.18 usr + 0.00 sys = 1.18 CPU) @
84745.76/s (n=100000)
vialist: 2 wallclock secs ( 1.80 usr + 0.00 sys = 1.80 CPU) @
55555.56/s (n=100000)
There are 5 (?-xism:ac) s in aabaacbbacbabcbacbacbac
There are 5 (?-xism:ac) s in aabaacbbacbabcbacbacbac
------------------------------
Date: 28 Oct 2003 06:37:21 -0800
From: leifwessman@hotmail.com (Leif Wessman)
Subject: multiline regular expression, is it possible?
Message-Id: <64beeaad.0310280637.4c49e659@posting.google.com>
I have a variable $myregexp with the following regexp (multiline):
<tr><td>
id: (\d{5}[AX])
<\/td><\/tr>
I also have another variable $results that has some html, like this:
<table>
<tr><td>
id: 45434X
</td></tr>
<tr><td>
id: 95434A
</td></tr>
</table>
In php I'm doing the following:
preg_match_all("/$myregexp/", $results, $matches);
But I get an error. Why is this?
Leif
------------------------------
Date: Tue, 28 Oct 2003 16:02:58 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: multiline regular expression, is it possible?
Message-Id: <bnm0lb$13auqq$1@ID-184292.news.uni-berlin.de>
Leif Wessman wrote:
> I have a variable $myregexp with the following regexp (multiline):
>
> <tr><td>
> id: (\d{5}[AX])
> <\/td><\/tr>
>
> I also have another variable $results that has some html, like this:
>
> <table>
> <tr><td>
> id: 45434X
> </td></tr>
> <tr><td>
> id: 95434A
> </td></tr>
> </table>
>
> In php I'm doing the following:
>
> preg_match_all("/$myregexp/", $results, $matches);
>
> But I get an error. Why is this?
Have no idea. But in Perl (this is a Perl group, you know) you can do:
@matches = $results =~ /$myregexp/g;
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Tue, 28 Oct 2003 14:32:02 GMT
From: tom <tom@ztml.com>
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <C5vnb.33381$1C5.23289@nwrdny02.gnilink.net>
anno4000 - lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
.
.
>
>Working from the command line, you control every aspect of the environ-
>ment, and output isn't post-processed. So you can concentrate on the
>script itself. Once it does what it is supposed to do, you can put it
>back in and concentrate on the other aspects.
>
>If you change a light bulb and it doesn't light up, would you insist
>in leaving it screwed in while trying to find out what's wrong?
>
>Anno
>
I don’t see how one can control every aspect of the environment from the
command line. For example, if the script requires the values in cookies, these
values will only be available if the script was run from the browser. Also, it
is very common for CGI scripts to include JavaScript functions, which these
functions cannot run from the command line. Trouble shooting CGI scripts still
may best be handled by running from the browser.
That light bulb doesn’t light up could be a burnt out fuse, which you may not
want to simply replace it. Besides, the OP got his answer already. This thread
should now be closed.
Tom
------------------------------
Date: Tue, 28 Oct 2003 15:38:14 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <G3wnb.79$Q9.7@nwrddc02.gnilink.net>
Anno Siegel wrote:
[...]
> By using the command line, you eliminate a lot of complexity from
> the situation. When a CGI script doesn't work *as a CGI* the problem
> can be at three points:
[three good points snipped]
On top of the partitioning of the complex CGI environment into independent
steps you also get all the benefits of a development environment for a real
programming language:
- you can use a debugger to pinpoint any problem
- you can use profiling and benchmarking
- instant test/bugfix/text cycle without uploading the script to some server
- etc. etc.
jue
------------------------------
Date: Tue, 28 Oct 2003 15:38:11 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <Pine.LNX.4.53.0310281521450.28979@ppepc56.ph.gla.ac.uk>
On Tue, 28 Oct 2003, tom wrote:
> I don’t see how one can control every aspect of the environment from the
> command line.
Perhaps you would see it better if you were to read CGI.pm's
documentation about its debugging options.
Of course there's nothing magical in there: it's just a lot more
convenient and effective (in the vast majority of cases, anyway) to
work with CGI.pm than to set up the environment manually yourself and
then stumble through hand-written low-level code.
> For example, if the script requires the values in cookies, these
> values will only be available if the script was run from the browser.
Cookies aren't something magical either: in normal operation, the
server makes them available to the CGI script via the environment, and
your debugging session can just do the same.
> Also, it is very common for CGI scripts to include JavaScript
> functions,
It's not a very good idea for the operation of a system to depend
critically on the execution of javascript at the client.
But anyway, the proper way to design and debug a complex system is to
build it in manageable parts, and debug each part in a suitable
harness. Seems to me you should be debugging your client-side
javascript separately until it works - not tossing untested code into
what's already a complex system, which is, ex hypothesi, causing you
some kind of difficulty to debug.
> Trouble shooting CGI scripts still
> may best be handled by running from the browser.
The foregoing discussion suggests to me that you're in no position yet
to make that determination.
> Besides, the OP got his answer already. This thread should now be
> closed.
Hello, who appointed you netcop this week?
------------------------------
Date: Tue, 28 Oct 2003 16:00:56 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Perl and IIS - script runs but 'The page cannot be displayed'
Message-Id: <Yownb.13338$%e3.3596@nwrddc03.gnilink.net>
tom wrote:
> anno4000 - lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>> Working from the command line, you control every aspect of the
>> environ- ment, and output isn't post-processed. So you can
>> concentrate on the script itself. Once it does what it is supposed
>> to do, you can put it back in and concentrate on the other aspects.
>
> I don't see how one can control every aspect of the environment from
> the command line.
Au contraire, mon ami! The command line is the only environment where you as
the programmer are the sole person who controls the environment. On a web
server too much depends upon how the server and how the server has been
configured by the server admin (which typically is not the same person as
the programmer of the script).
> For example, if the script requires the values in
> cookies, these values will only be available if the script was run
> from the browser.
I certainly don't know much about CGI programming, but it is my
understanding that web servers use environment variables to pass cookie
values to CGI programs. What is the problem with setting those values before
running the script? You do it only once and you can even alter them very
easily to test different configurations and behaviours.
> Also, it is very common for CGI scripts to include
> JavaScript functions, which these functions cannot run from the
> command line.
Hold it, hold it. Now you are talking about a different game.
By the time you start writing the Perl CGI script you better know exactly
what kind of HTML or JavaScript it is supposed to produce and you tested
that part already, using static files.
> Trouble shooting CGI scripts still may best be handled
> by running from the browser.
Of course at some point you have to put it all together and you will have to
test it as a whole.
But that should be at the very end when you are confident that the
individual pieces are working fine on their own.
If you do it earlier then you will be very confused about what causes a
problem, the Perl script, the JavaScript or HTML that the Perl script
generates, the server configuration, the web browser configuration, the web
browser itself, ....
jue
------------------------------
Date: Tue, 28 Oct 2003 08:29:16 -0600
From: Master Web Surfer <raisin@delete-this-trash.mts.net>
Subject: Re: Printing folder contents
Message-Id: <MPG.1a0839348abd9e89896b6@news.mts.net>
et>, <mh> says...
> I'.m trying to make a simple program which would print the contents of c:\
> folder.
> (files and first sub-folders). Am i at the right track? (this doesn't work)
>
> #!/usr/bin/perl
> use strict;
> print "Content-Type: text/plain\n\n";
> my @folder = <c:\*>;
> foreach my $file (@folder)
> {
> print "$file\n";
> }
> # end
Your syntax looks good (according to "The Camel"). Please be more
specific; what do you mean by "this doesn't work" ??
If you provide more details then perhaps someone can help you.
------------------------------
Date: Tue, 28 Oct 2003 10:47:48 -0800
From: "Michael Vilain <vilain@spamcop.net>"
Subject: regex for stripping HTML
Message-Id: <vilain-8A69E5.10474828102003@comcast.ash.giganews.com>
Originally, I was using
$value =~ s/<.*>//g;
to strip HTML tags from a variable. It actually stripped everything
from the first "<" to the last ">" after the ending tag. I found this
regex in this group:
$value =~ s/\<[^\<]+\>//g;
and I'm trying to parse it out and figure out why it works. First off,
some questions:
- why escape the "<"? It's not one of the meta characters that has
special meaning in a regex.
- what's the difference between using ".*" to match any string and "+"
to match a repeat of the character class "[^\<]".
Just trying to deepen my understanding of regex. It's like whitewash --
it gets more opaque with multiple coats.
TIA,
/MeV/
--
DeeDee, don't press that button! DeeDee! NO! Dee...
------------------------------
Date: 28 Oct 2003 07:10:56 -0800
From: alythh@netscape.net (Alythh)
Subject: Re: runtime load of code
Message-Id: <6a25ba72.0310280710.564f4c96@posting.google.com>
OK, it works
foreach $address (@addresses)
{
$mod = $modules{$address};
require $mod;
...
}
... it just complains about:
Subroutine process_page redefined at ... line 20.
Subroutine action_on_page redefined at ... line 48.
but it's OK enough for me.
thanks
Alessandro Magni
------------------------------
Date: 28 Oct 2003 07:00:07 -0800
From: rjohnson@shell.com (Roy Johnson)
Subject: Singleton process
Message-Id: <3ee08638.0310280700.6ec6247e@posting.google.com>
I've got a program that I want to be the only instance of itself
running at any given time. The method I've chosen for doing that is
probably not the preferred method, and it certainly won't work under
Windows.
Here's what I'm doing:
### Ensure that this is the only instance running
my @myprocs = grep(/perl $0/, `ps -f`);
for (@myprocs) {
my ($pid) = (split)[1];
next if ($pid == $$);
die "Found $_\n";
}
What *should* I be doing, for maximum reliability on both Unix and
Windows?
------------------------------
Date: 28 Oct 2003 15:48:15 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Singleton process
Message-Id: <bnm33v$3em$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Roy Johnson:
> I've got a program that I want to be the only instance of itself
> running at any given time. The method I've chosen for doing that is
> probably not the preferred method, and it certainly won't work under
> Windows.
>
> Here's what I'm doing:
> ### Ensure that this is the only instance running
> my @myprocs = grep(/perl $0/, `ps -f`);
> for (@myprocs) {
> my ($pid) = (split)[1];
> next if ($pid == $$);
> die "Found $_\n";
> }
>
> What *should* I be doing, for maximum reliability on both Unix and
> Windows?
Locking, I guess. Let the program create a lockfile at the beginning:
use Fcntl;
sysopen LOCK, "/tmp/prog.lock", O_CREAT|O_EXCL or
exit 1;
...
END { unlink "/tmp/prog.lock" }
This should be portable between UNIX and Windows.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Tue, 28 Oct 2003 17:11:18 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Singleton process
Message-Id: <bnm7vm$eel$2@wisteria.csv.warwick.ac.uk>
tassilo.parseval@post.rwth-aachen.de wrote:
> Also sprach Roy Johnson:
>
> > I've got a program that I want to be the only instance of itself
> > running at any given time. What *should* I be doing, for maximum
> > reliability on both Unix and Windows?
>
> Locking, I guess. Let the program create a lockfile at the beginning:
>
> use Fcntl;
>
> sysopen LOCK, "/tmp/prog.lock", O_CREAT|O_EXCL or
> exit 1;
>
> ...
>
> END { unlink "/tmp/prog.lock" }
>
> This should be portable between UNIX and Windows.
What if the process is killed and leaves a stale lockfile around?
You want to flock() the file as well; this will be broken when the
process dies, at least on Unix. Not sure about Windows: I've had nasty
experiences with programs dieing and leaving locks locked... :(
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
------------------------------
Date: Tue, 28 Oct 2003 18:46:30 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: strange effect with [:lower:] in perl
Message-Id: <Pine.LNX.4.53.0310281819040.28979@ppepc56.ph.gla.ac.uk>
On Mon, 27 Oct 2003, Abigail wrote:
> "" > [a-z0-9] # Lowercase letters *and* digits.
> ""
> "" Surely that only refers to a subset of what Unicode considers to be
> "" "letters"?
>
> Yeah, but that's what [:lower:] seems to do too:
>
> $ perl -wle 'for (0x00 .. 0x80) {
Surely you meant to set the limit at 0xff or so for this
demonstration?
> printf "%02x %s\n", $_, chr if chr () =~ /[[:lower:]]/}'
[snip]
> No lowercase accented letters here.
Curious. No surprise when the limit's set at 0x80, as I'm sure you'd
agree; but I must admit I was surprised at the accented lower-case
letters up to 0xff not being counted, despite the accented lower case
letters above 0x100 being counted. Prima facie I think there's
something wrong here, no? (This is perl 5.8.0 per RedHat 9).
If I set the upper limit at, say, 0xfff, then I get lots of lower-case
letters reported in the blocks of extended Latin, Greek, Coptic,
Cyrillic and Armenian.
And there are more still, e.g 0x2149 "DOUBLE-STRUCK ITALIC SMALL J"
;-)
------------------------------
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 5720
***************************************