[23461] in Perl-Users-Digest
Perl-Users Digest, Issue: 5676 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 17 09:06:02 2003
Date: Fri, 17 Oct 2003 06:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 17 Oct 2003 Volume: 10 Number: 5676
Today's topics:
Re: A New bie's doubt <andy@shitov.ru>
Re: Emacs syntax highlight of Perl comments <REMOVEsdnCAPS@comcast.net>
Re: How to update entries in a file <HelgiBriem_1@hotmail.com>
Kill forked process on Windows 2000 <stephane.metais-pourriel@laposte.net>
Re: OT: 'time' utilty for Win*? (!Cygwin) <bart.lateur@pandora.be>
Re: Perl scripts for Unix on my windows machine <bobx@linuxmail.org>
Re: script removes too many lines <HelgiBriem_1@hotmail.com>
Re: split operator <REMOVEsdnCAPS@comcast.net>
Re: split operator <nobull@mail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 17 Oct 2003 14:06:27 +0400
From: Andy Shitov <andy@shitov.ru>
Subject: Re: A New bie's doubt
Message-Id: <bmoeuv$um3$5@gavrilo.mtu.ru>
>> 2. Or declare and set initial values:
>>
>> my %hash = {key1 => "value1", key2 => "value2"};
>
>
> Try that with warnings enabled.
Human erratum
It should be
my %hash = (key1 => "value1", key2 => "value2");
or even
my %hash = ("key1" => "value1", "key2" => "value2");
------------------------------
Date: Fri, 17 Oct 2003 06:09:42 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Emacs syntax highlight of Perl comments
Message-Id: <Xns941748B6797A6sdn.comcast@216.196.97.136>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"Michael P. Broida" <michael.p.broida@boeing_oops.com> wrote in
news:3F8F196F.7116E5EF@boeing_oops.com:
> "Eric J. Roode" wrote:
>>
>> Are you using perl-mode or cperl-mode? cperl-mode is far better than
>> perl-mode. Also, be sure to use the latest version. cperl-mode 5.0 is
>> quite excellent -- I don't think I've come across a situation yet where
>> it highlights incorrectly.
>
> OOOH! I just tried cperl-mode and it does look nicer than
> perl-mode. :) Might take some getting used to, though.
>
> Now, how do I make that the default for .pl and .pm files?
Add the following lines to your .emacs file:
(setq auto-mode-alist (cons '("\\.pl$" . cperl-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.pm$" . cperl-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.cgi$" . cperl-mode) auto-mode-alist))
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP4/NwmPeouIeTNHoEQJlnwCgg7eL9hRLcg5AAcZS10xTZft46T4AoIgJ
j8GXtPoBhcRT+pGbuWNcd1mx
=Uus9
-----END PGP SIGNATURE-----
------------------------------
Date: Fri, 17 Oct 2003 10:47:39 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: How to update entries in a file
Message-Id: <j4ivov0tp9vsivsc7g7bmblnkv7otikauv@4ax.com>
On Thu, 16 Oct 2003 07:47:23 GMT, "John" <no@spam.here> wrote:
>Thanks for pointing out the errors.
>As expected, there were typos when I re-typed the code here. I'm sure you
>had never done that, right?
You have been told several times to "copy and paste" code,
not retype it. It's not a joke.
<plonk>
------------------------------
Date: Fri, 17 Oct 2003 12:39:05 +0200
From: =?ISO-8859-1?Q?St=E9phane_M=E9tais?= <stephane.metais-pourriel@laposte.net>
Subject: Kill forked process on Windows 2000
Message-Id: <3f8fc6c9$0$27032$626a54ce@news.free.fr>
Hello,
I am writing a perl script using fork().
The parent process manages the GUI (with Tk) while the child executes
some work (the 2 processes communicate through a pipe)
But i am facing 3 issues :
1) When terminating, the child causes the following error :
Unable to register TclNotifier window class
Tcl_Panic at my_script line xxx.
This error aborts the whole script.
In order to avoid this, the child doesn't die but tells to the parent
that he has finished and sleeps for ever.
So the parent process must now kill the child process ...
2) ... but when the parent process tries to kill the child process (in
order to abort the work or during the sleep), the child doesn't die.
3) When the parent exits, the script doesn't (perhaps because of the
sleeping child process ?)
So my question : does the "kill" command works properly on Windows 2000
? If yes, how ?
(nb: i use PERL v5.6.1, build 635, ActiveState distribution)
TIA
--
Stéphane
please remove "-pourriel" from address for reply
------------------------------
Date: Fri, 17 Oct 2003 10:58:24 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: OT: 'time' utilty for Win*? (!Cygwin)
Message-Id: <moivov4bn9ddmqmqiliek2kd2ujpjqjar9@4ax.com>
Michele Dondi wrote:
>I know this is OT, but since I use 'time' under Linux for quick tests
>of my perl scripts, I'm asking here...
Quick tests on you perl scripts? Timing tests? Look at the following
Perl modules:
- Benchmark
- Time::HiRes
--
Bart.
------------------------------
Date: Fri, 17 Oct 2003 01:28:50 GMT
From: "Bob X" <bobx@linuxmail.org>
Subject: Re: Perl scripts for Unix on my windows machine
Message-Id: <mBHjb.1296$CE2.1213283@news2.news.adelphia.net>
"Michael P. Broida" <michael.p.broida@boeing_oops.com> wrote in message
news:3F8D8FA5.8F3030FF@boeing_oops.com...
> James Willmore wrote:
> >
<snip>
> I've had that line in many of my Windows Perl scripts and
> had NO problems with it. Windows doesn't use that line
> in any way at all, so it's just another comment line.
>
Not entirely true. If you are using Apache on Windows, Apache uses that line
when calling CGI scripts. May not be true for all but I have to put "#!perl"
on the first line of my cgi's.
Bob
------------------------------
Date: Fri, 17 Oct 2003 11:32:01 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: script removes too many lines
Message-Id: <kokvov4038k9cp9kasbuno7ejjd8136fbh@4ax.com>
On Fri, 17 Oct 2003 00:45:28 -0500, tadmc@augustmail.com (Tad
McClellan) wrote:
>(or the bunny on the cover of that magazine that I never read)
Most people apparently *only* read the articles.
------------------------------
Date: Fri, 17 Oct 2003 06:21:47 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: split operator
Message-Id: <Xns94174AC2BABECsdn.comcast@216.196.97.136>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"Benedikt Feldhaus" <software@werthmesstechnik.de> wrote in news:bmo3kn
$ng4rt$1@ID-119432.news.uni-berlin.de:
> Hi,
>
> I have this line
> "a, b, c, [11, 22, 33], d"
> I want to split this line, not splitting the values in brackets.
> My result should be
> a
> b
> c
> [11, 22, 33]
> d
>
> Any ideas?
You could read the FAQ; that's what it's there for.
"How can I split a [character] delimited string except when inside
[character]? (Comma-separated files)"
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP4/QlGPeouIeTNHoEQIUkwCg4hRX0DVa02qhnXe+F4z5Uh+W2c8An2wd
1GkvO07HLnMWAHbEHgG69odt
=/8yi
-----END PGP SIGNATURE-----
------------------------------
Date: 17 Oct 2003 13:05:21 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: split operator
Message-Id: <u9oewgqdby.fsf@wcl-l.bham.ac.uk>
"Benedikt Feldhaus" <software@werthmesstechnik.de> writes:
> I have this line
> "a, b, c, [11, 22, 33], d"
> I want to split this line, not splitting the values in brackets.
This is very similar to the FAQ: "How can I split a [character]
delimited string except when inside [character]?"
Except if you want to handle nested brackets it also contains elements
of FAQ: "Can I use Perl regular expressions to match balanced text?"
So the first thing we need to know is do you want to handle nested
brackets?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
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 5676
***************************************