[27526] in Perl-Users-Digest
Perl-Users Digest, Issue: 9095 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 27 11:05:50 2006
Date: Mon, 27 Mar 2006 08:05:05 -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 Mon, 27 Mar 2006 Volume: 10 Number: 9095
Today's topics:
[ANNOUNCE] POD2::IT 0.11 <bepi@perl.it>
Re: Concise idiom sought (Randal L. Schwartz)
Re: Concise idiom sought <rvtol+news@isolution.nl>
Re: Concise idiom sought (Anno Siegel)
Re: Concise idiom sought <rvtol+news@isolution.nl>
Re: Great JAPH (was Re: Creating Graphs Dynamically wit jussi.mononen-asdf@asdf-comptel.com
Re: OT: Emacspeak for Win32 <vtatila@mail.student.oulu.fi>
Re: OT: Emacspeak for Win32 <nospam-abuse@ilyaz.org>
Re: short form for (defined $x and defined $y and ... ) (Anno Siegel)
Re: sockaddr_in() timeout or asynchone call ? <no@thanks.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 27 Mar 2006 10:47:29 GMT
From: Enrico Sorcinelli <bepi@perl.it>
Subject: [ANNOUNCE] POD2::IT 0.11
Message-Id: <Iws8u2.1srq@zorch.sf-bay.org>
Hi all,
the pod2it[1] team is proud to announce a new POD2::IT release available on
CPAN[2]
This is a important release since there are 9 new translated pods and all pods
has been updated to Perl 5.8.8.
CHANGES FROM PREVIOUS VERSION
+ Added perl.pod [raffaellog, dree]
+ Added perlboot.pod [dree, dakkar, osfameron]
+ Added perlcheat.pod [frodo72, dree]
+ Added perlipc.pod translation [frodo72]
+ Added perlmodinstall.pod [raffaellog]
+ Added perlmodstyle.pod [raffaellog, dree]
+ Added perlref.pod [ludan, dree, frodo72]
+ Added perlrequick.pod [dree, shishii]
+ Added perlsyn.pod [kral, frodo72, dree]
+ Added resources/update-and-notify.pl script [frod72]
! Updated all translated pods to 5.8.8 [dree, frodo72]
! Minor fixes to all pods
! Added 'COPYRIGHT AND LICENCE' section to IT.pm [bepi]
POD2::IT also contains the patch to Pod/Perldoc.pm (3.14) in order to continue
to use -f and -q switches with translated pods (not only italian):
%> perldoc -L IT <podname>
%> perldoc -L IT -f <function>
%> perldoc -L IT -q <FAQregex>
Note that currently bleadperl has been patched.
Regards
- Enrico
------------------------------
Date: 26 Mar 2006 22:07:27 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Concise idiom sought
Message-Id: <86u09kzahs.fsf@blue.stonehenge.com>
>>>>> "Dave" == Dave <daveandniki@ntlworld.com> writes:
Dave> I have the following code snippet:
Dave> if ( !defined $base_ref->{pl} ) {
Dave> $base_ref->{pl} = 1;
Dave> }
Dave> following the 'Best practices' guidelines. Previously I had it as:
Dave> $base_ref->{pl} = 1 unless defined $base_ref->{pl};
Dave> which seems clearer to me...
I don't like repeating the expensive "find the lvalue" stuff. If there's a
complex calculation to get to the variable, do it just one, please.
I'd write that as:
defined $_ or $_ = 1 for $base_ref->{pl};
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
------------------------------
Date: Mon, 27 Mar 2006 09:05:37 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Concise idiom sought
Message-Id: <e08a8c.1eo.1@news.isolution.nl>
Randal L. Schwartz schreef:
> defined $_ or $_ = 1 for $base_ref->{pl};
Alternatively:
{ local $_; defined or $_ = 1 for $v }
{ local $_ = \$v; defined $$_ or $$_ = 1 }
--
Affijn, Ruud
"Gewoon is een tijger."
echo 014C8A26C5DB87DBE85A93DBF |perl -pe 'tr/0-9A-F/JunkshoP cartel,/'
------------------------------
Date: 27 Mar 2006 08:22:39 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Concise idiom sought
Message-Id: <48plmfFlclm0U1@news.dfncis.de>
Dr.Ruud <rvtol+"`ls -al .`"@isolution.nl> wrote in comp.lang.perl.misc:
> Randal L. Schwartz schreef:
>
> > defined $_ or $_ = 1 for $base_ref->{pl};
>
> Alternatively:
Where has $v come from?
> { local $_; defined or $_ = 1 for $v }
You don't need local() here. The assignment through "for" is instrinsically
localized.
> { local $_ = \$v; defined $$_ or $$_ = 1 }
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Mon, 27 Mar 2006 14:17:16 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Concise idiom sought
Message-Id: <e08skq.18k.1@news.isolution.nl>
Anno Siegel schreef:
> Dr.Ruud:
>> Randal L. Schwartz schreef:
>>> defined $_ or $_ = 1 for $base_ref->{pl};
>>
>> Alternatively:
>
> Where has $v come from?
It is just a replacement for the $base_ref->{pl}
Does $v suffer much less from the <expensive "find the lvalue"> blues
than $v, making it an invalid stand-in?
>> { local $_; defined or $_ = 1 for $v }
>
> You don't need local() here. The assignment through "for" is
> instrinsically localized.
Thanks, I didn't realize that while playing with several alternatives.
In perlsyn, it isn't stated explicitly that, inside a foreach, $_ is or
isn't local:
"If VAR is omitted, $_ is set to each value."
Especially because the behaviour of my-declared variables is explained
in detail, I fear that one might get from this text that $_ doesn't get
the same treatment. My proposal:
"If VAR is omitted, a local $_ is set to each value.".
"If VAR is omitted, the localized $_ is set to each value.".
--
Affijn, Ruud
"Gewoon is een tijger."
echo 014C8A26C5DB87DBE85A93DBF |perl -pe 'tr/0-9A-F/JunkshoP cartel,/'
------------------------------
Date: Mon, 27 Mar 2006 06:14:47 +0000 (UTC)
From: jussi.mononen-asdf@asdf-comptel.com
Subject: Re: Great JAPH (was Re: Creating Graphs Dynamically with Perl)
Message-Id: <e07vsm$6ds$1@phys-news4.kolumbus.fi>
Abigail <abigail@abigail.nl> wrote:
>
> But that's the output *after* you ran it.
>
> Try deparsing the program before running it.
I can't :-)
[tarzan ~]$ perl -MO=Deparse japh.pl
Jsyntax error at japh.pl line 3, next token ???
japh.pl had compilation errors.
sub BEGIN {
$| = $SIG{'__WARN__'} = sub {
$_ = $_[0];
tr/_/ /;
print /(.)"$/;
seek _, -open(_, "+<$0"), 2;
truncate _, tell _;
close _;
exec $0;
}
;
}
[tarzan ~]$
/jUSSi
--
remove -asdf and asdf- for email address
------------------------------
Date: Mon, 27 Mar 2006 08:57:10 +0300
From: "Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi>
Subject: Re: OT: Emacspeak for Win32
Message-Id: <e07us4$ne7$1@news.oulu.fi>
Ilya Zakharevich wrote:
>> using text to speech is what interests me. More specifically using
>> the same speech synth as in my screen reader but driven by
>> Emacspeak.
> Well, if you can write a small wrapper application (possibly in Perl
> XS ;-) which interfaces with your beloved API, and takes the text from
> STDIN, everything should be OK (although I have no idea how Emacsspeak
> works, I doubt it needs anything else).
I've never written XS apps but a pure Perl version is easy to write. You can
interface with Microsoft Speech API 5.x by using Win32::OLE. It will even
support asynchronous operation without me having to deal with threads.
Threads with OLE in Perl would crash anyway, which is a known problem.
Are other IPC mechanisms supported in Emacspeak, WIndows and Perl so they
might be faster. I'm thinking of sockets at this point.
Now seems the only thing I need is the Windows port of Emacspeak, which I
still have been unable to find so far. It must be somewhere, musn't it. I've
even read about a port but just couldn't find it at least yesterday.
"emacspeak for windows" quoted only returns some research papers and a
couple of posts within the Google top 10. emacspeak win32 without the quotes
doesn't produce much better results. The best hit seems to be the
installation instructions at:
http://home.vr-web.de/gerhard.stenzel/emacspeak/install-win32.html#c36e2526b5
But they talk about compiling from sources which I usually don't want to do
given a choice. I'm infinitely happy that there are tools like apt-get and
ppm available.
Ah, SAPI support is already available in Emacspeak so if it is SAPI 5 I
might not need to code anything at all.
The FAQ to which they link appears to hint at a binary version somewhere:
http://www.gnu.org/software/emacs/windows/faq3.html#install
I can find Emacs for Windows quite alright, but at least in tools like
apt-get Emacspeak shows up as a separate package from Emacs as far as I can
remember.
Neither does going through the Emacspeak Source Forge site help all that
much. I can only see various redhat packages and the sources at:
http://prdownloads.sourceforge.net/emacspeak/
If all else fails I suppose I could do something like the following:
Get a minimal Debian system somewhere and install it on some virtualization
solution running Linux inside Windows. Independent installation is quite
possible via TeraTerm, my Windows screen reader and a serial-port enabled
distro. The Linux distro could then host Emacspeak but I'd like to use my
Windows speech synth still. One way around this would be to talk to Windows
via a virtual serial port as above, receive the traffic to a Win32 perl
script and drive my SAPI synth from there. Not all that simple but none of
the substeps involved seem so difficult. I've already, for example,
installed LInux in Windows, talked to SAPI (pun intended) from Perl, and
delt with the serial port in Java prior to this writing.
--
With kind regards Veli-Pekka Tätilä (vtatila@mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/
------------------------------
Date: Mon, 27 Mar 2006 07:04:10 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: OT: Emacspeak for Win32
Message-Id: <e082pa$2bk3$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Veli-Pekka Tätilä
<vtatila@mail.student.oulu.fi>], who wrote in article <e07us4$ne7$1@news.oulu.fi>:
> Now seems the only thing I need is the Windows port of Emacspeak, which I
> still have been unable to find so far.
I do not know what Emacspeak is, but if it is Emacs with speech
extensions, I do not see why any port is needed. AFACS, the only
thing needed is a "speak this" application; anything else is a frill
(which may improve performance a tiny bit).
So on your place I would download .el files, and would read about
its "pathway to speaker" settings.
Yours,
Ilya
------------------------------
Date: 27 Mar 2006 08:32:31 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: short form for (defined $x and defined $y and ... )?
Message-Id: <48pm8vFlclm0U2@news.dfncis.de>
<robic0> wrote in comp.lang.perl.misc:
> On Sat, 25 Mar 2006 14:28:34 -0500, Uri Guttman <uri@stemsystems.com> wrote:
>
> >>>>>> "MD" == Markus Dehmann <markus.dehmann@gmail.com> writes:
[...]
> Any regex, if successfull will have defined values, absent 'or's (|).
Wrong.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Mon, 27 Mar 2006 11:36:08 +0200
From: Asterbing <no@thanks.com>
Subject: Re: sockaddr_in() timeout or asynchone call ?
Message-Id: <MPG.1e91d073c1807d9e9897ad@news.tiscali.fr>
In article <x7wtegepdh.fsf@mail.sysarch.com>, uri@stemsystems.com
says...
> don't use most perl code you find on the net. too much of it sucks and
> is for kiddies.
OK, daddy ;)
> LWP (the perl web client modules) is now in the core distribution. but
> that still means making sure your servers have a recent perl. if you
> can't load modules (which you can as a normal user so that is not a
> valid excuse) then how would you load a recent perl?
I will have to install the script on several servers, we the less upt to
date being with Perl 5.00503 under FreeBSD
> >> my $sock = IO::Socket::INET->new( "$host:$port" ) ;
>
> A> Is that the only line to change in the sub ?
>
> no. it replaces all the crappy socket code you copied. another point is
Understood
> A> print hpSOCK "GET $path HTTP/1.1\015\012";
> A> print hpSOCK "Host: $host\015\012\015\012";
>
> all that code is handled by LWP so use it instead of the crap you
> copied.
Yes, but I don't want to consider the GET return (neither header nor
server response content). My subject is just to push url parameters
toward the remote cgi !
Well, someone in fr.comp.lang.perl suggest me to go through fork like
this for the purpose to do thing be no-blocking for the rest of the
script (as I wish) :
my $child = fork;
die "fork: $!\n" unless defined $child;
return if $child;
What do you mean about this way ? It's a little bit obscur for me and
don't really see how to embed a call to my sub this way...
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 9095
***************************************