[27825] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9189 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 22 06:05:58 2006

Date: Sat, 22 Apr 2006 03:05:05 -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           Sat, 22 Apr 2006     Volume: 10 Number: 9189

Today's topics:
        new CPAN modules at Sat Apr 22 2006 (Randal Schwartz)
    Re: show hidden value in variable.. with mysql.. FIXED joe.henderson1@
    Re: Term::ReadKey on Win?  5.005 vs 5.8.8? <rvtol+news@isolution.nl>
    Re: Term::ReadKey on Win?  5.005 vs 5.8.8? <nospam-abuse@ilyaz.org>
    Re: Term::ReadKey on Win?  5.005 vs 5.8.8? <rvtol+news@isolution.nl>
    Re: Term::ReadKey on Win?  5.005 vs 5.8.8? <nospam-abuse@ilyaz.org>
    Re: Term::ReadKey on Win?  5.005 vs 5.8.8? <rvtol+news@isolution.nl>
    Re: XS Progamming with Perl 6 <Jeff.Stampes@xilinx.com>
    Re: XS Progamming with Perl 6 <sisyphus1@nomail.afraid.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sat, 22 Apr 2006 04:42:06 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules at Sat Apr 22 2006
Message-Id: <Iy3x26.12C3@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Apache2-ModBT-0.010
http://search.cpan.org/~crakrjack/Apache2-ModBT-0.010/
mod_perl interface to mod_bt
----
Net-BitTorrent-LibBTT-0.014
http://search.cpan.org/~crakrjack/Net-BitTorrent-LibBTT-0.014/
Manipulate a tracker running under libbtt from perl
----
Net-LibLO-0.04
http://search.cpan.org/~njh/Net-LibLO-0.04/
Perl interface for liblo Lightweight OSC library
----
Audio-MadJACK-0.03
http://search.cpan.org/~njh/Audio-MadJACK-0.03/
Talk to MadJACK server using Object Oriented Perl
----
Audio-JackMiniMix-0.02
http://search.cpan.org/~njh/Audio-JackMiniMix-0.02/
Talk to JACK Mini Mixer using OSC
----
Device-Quasar3108-0.04
http://search.cpan.org/~njh/Device-Quasar3108-0.04/
Control Quasar Electronics Serial I/O Module
----
Audio-MPD-0.12.3
http://search.cpan.org/~njh/Audio-MPD-0.12.3/
Class for talking to MPD (Music Player Daemon) servers
----
Net-SDP-0.03
http://search.cpan.org/~njh/Net-SDP-0.03/
Session Description Protocol (rfc2327)
----
Net-SAP-0.09
http://search.cpan.org/~njh/Net-SAP-0.09/
Session Announcement Protocol (rfc2974)
----
Alien-wxWidgets-0.05
http://search.cpan.org/~mbarbon/Alien-wxWidgets-0.05/
building, finding and using wxWidgets binaries
----
MARC-XML-0.83
http://search.cpan.org/~esummers/MARC-XML-0.83/
----
Astro-satpass-0.005
http://search.cpan.org/~wyant/Astro-satpass-0.005/
----
App-ErrorCalculator-1.00
http://search.cpan.org/~smueller/App-ErrorCalculator-1.00/
Calculations with Gaussian Error Propagation
----
Net-SMPP-1.10
http://search.cpan.org/~sampo/Net-SMPP-1.10/
pure Perl implementation of SMPP 3.4 over TCP
----
PITA-0.22
http://search.cpan.org/~adamk/PITA-0.22/
The Practical Image Testing Architecture
----
Hardware-Simulator-MIX-0.02
http://search.cpan.org/~litchie/Hardware-Simulator-MIX-0.02/
Knuth's famous virtual machine
----
Jifty-DBI-0.20
http://search.cpan.org/~jesse/Jifty-DBI-0.20/
An object-relational persistence framework
----
IO-Socket-TIPC-0.04
http://search.cpan.org/~infinoid/IO-Socket-TIPC-0.04/
Perl sockets for TIPC
----
Sort-Key-1.18
http://search.cpan.org/~salva/Sort-Key-1.18/
fastest way to sort things in perl
----
Pod-Html-HtmlTree-0.91
http://search.cpan.org/~tomyhero/Pod-Html-HtmlTree-0.91/
class to convert pod files to html tree
----
Noid-0.424
http://search.cpan.org/~jak/Noid-0.424/
routines to mint and manage nice opaque identifiers
----
Math-SymbolicX-Error-0.02
http://search.cpan.org/~smueller/Math-SymbolicX-Error-0.02/
Parser extension for dealing with numeric errors
----
Math-SymbolicX-Error-0.01
http://search.cpan.org/~smueller/Math-SymbolicX-Error-0.01/
Parser extension for dealing with numeric errors
----
Archive-Builder-1.06
http://search.cpan.org/~adamk/Archive-Builder-1.06/
File generation and archiving framework
----
IO-Socket-TIPC-0.03
http://search.cpan.org/~infinoid/IO-Socket-TIPC-0.03/
Perl sockets for TIPC
----
POE-Component-Client-NNTP-1.00
http://search.cpan.org/~bingos/POE-Component-Client-NNTP-1.00/
A component that provides access to NNTP.
----
File-Tasks-0.06
http://search.cpan.org/~adamk/File-Tasks-0.06/
A set of file tasks to be executed in a directory
----
Catalyst-Plugin-Authentication-Store-DBIC-0.06
http://search.cpan.org/~mramberg/Catalyst-Plugin-Authentication-Store-DBIC-0.06/
Authentication and authorization against a DBIx::Class or Class::DBI model.
----
Config-Model-0.505
http://search.cpan.org/~ddumont/Config-Model-0.505/
Model to create configuration validation tool
----
Net-EPP-Proxy-0.02
http://search.cpan.org/~gbrown/Net-EPP-Proxy-0.02/
a proxy server for the EPP protocol.
----
sqlpp-0.04
http://search.cpan.org/~karasik/sqlpp-0.04/
SQL preprocessor
----
Crypt-IDEA-1.08
http://search.cpan.org/~dparis/Crypt-IDEA-1.08/
----
OpenGuides-0.54
http://search.cpan.org/~dom/OpenGuides-0.54/
A complete web application for managing a collaboratively-written guide to a city or town.
----
Hardware-Simulator-MIX-0.01
http://search.cpan.org/~litchie/Hardware-Simulator-MIX-0.01/
Knuth's famous virtual machine
----
Test-WWW-Selenium-0.21
http://search.cpan.org/~lukec/Test-WWW-Selenium-0.21/
Test applications using Selenium Remote Control
----
Perl-Critic-0.15_02
http://search.cpan.org/~thaljef/Perl-Critic-0.15_02/
Critique Perl source code for best-practices
----
Chroniton-0.02
http://search.cpan.org/~jrockway/Chroniton-0.02/
simple backup system with archiving and incremental backups
----
Sub-Uplevel-0.11_01
http://search.cpan.org/~dagolden/Sub-Uplevel-0.11_01/
apparently run a function in a higher stack frame


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

print "Just another Perl hacker," # the original

--
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!


------------------------------

Date: Fri, 21 Apr 2006 23:20:24 GMT
From: joe.henderson1@
Subject: Re: show hidden value in variable.. with mysql.. FIXED
Message-Id: <q2qi4293o3i1q2dd7opgfv19eaib3s72uq@4ax.com>

On Fri, 21 Apr 2006 14:08:41 -0500, Tad McClellan
<tadmc@augustmail.com> wrote:

>joe.henderson1@ <joe.henderson1@> wrote:
>
>> But my question remains... "how did that null value get into that
>> string"...?
>
>
>It was probably put there by a C program somewhere, since C uses
>a null byte to mark the end of strings.

Well.. I talked with cisco today (tac) and they confirmed that
the IOS code is written in C..

However they are unsure of why the null string appears in the sysname
for the devices..

Thanks

Joe Henderson



------------------------------

Date: Fri, 21 Apr 2006 23:58:55 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Term::ReadKey on Win?  5.005 vs 5.8.8?
Message-Id: <e2bsar.1ko.1@news.isolution.nl>

Ilya Zakharevich schreef:
> Dr.Ruud:

> Eh?  All your message contained was "I tested THIS code".  No
> information about the testing was contained.

I assumed that merely running both! the tests (on the mentioned
perl-version) would show you what I noticed.
Did you run them? Add $in as the Filehandle parameter to each ReadKey,
if you think that is a better test.


>> I was pointing to the difference between calling ReadKey with 0 and
>> with '0E0'. The first has the "erratic" behaviour, the second not.
>> See the conditionals involved in the source.
>
>> I get the same results with "ReadKey 0, $in" vs. "ReadKey '0E0',
>> $in".
>
> I do not follow again.  Is the result the same, or one `is "erratic"',
> other not?  And IS it the same as with getc?

The first works "erratic" (not really erratic, see perldoc -f getc), so
the same as with getc. The second works as I would expect (Enter and
Ctrl-M give 13, Ctrl-J gives 10, no delays, etc.) because it AFAIK
doesn't use getc.


>> I didn't get why you use "getc" and not "ReadKey" (which not always
>> uses "getc").
>
> Because T:R:P uses getc().

I assume that is Term::ReadLine::Perl. What is the reason to do the test
with Term::ReadKey?


>> See perldoc Term::ReadKey, under ReadKey MODE [, Filehandle], at the
>> end it mentions Windows and getc.
>
> Did not find any mention of what you suggest (0 vs 0e0, Win and getc)
> in 2.30.

Not 0e0, but '0E0'.

  if (0)     { print "0:    true\n" };
  if ('0')   { print "'0':  true\n" };
  if (0E0)   { print "0E0:  true\n" };
  if ('0E0') { print "'0E0':true\n" };

Only the last one should print true. When MODE eq '0E0', ReadKey() takes
a subt(i)le different code path.

        if ($_[0]) {
            Win32PeekChar($File, $_[0]);
        } else {
            getc $File;
        }

With '0E0' (I assume that) the $_0 tests true, so Win32PeekChar() is
used.


>> My conclusion at this moment: don't use "getc" but "ReadKey", and if
>> you don't want ReadKey to use getc, but still want a blocked read,
>> use MODE '0E0' (as a workaround).
>
> Again, this looks like contradicting the other parts of your message.

Not to me.

-- 
Affijn, Ruud

"Gewoon is een tijger."



------------------------------

Date: Sat, 22 Apr 2006 03:44:30 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Term::ReadKey on Win?  5.005 vs 5.8.8?
Message-Id: <e2c8qu$2s7v$1@agate.berkeley.edu>

[A complimentary Cc of this posting was NOT [per weedlist] sent to
Dr.Ruud
<rvtol+news@isolution.nl>], who wrote in article <e2bsar.1ko.1@news.isolution.nl>:
> I assumed that merely running both! the tests (on the mentioned
> perl-version) would show you what I noticed.

> Did you run them?

  No such file or directory at -e line 1.

> >> I was pointing to the difference between calling ReadKey with 0 and
> >> with '0E0'. The first has the "erratic" behaviour, the second not.
> >> See the conditionals involved in the source.

> >> I get the same results with "ReadKey 0, $in" vs. "ReadKey '0E0',
> >> $in".

> > I do not follow again.  Is the result the same, or one `is "erratic"',
> > other not?  And IS it the same as with getc?

> The first works "erratic" (not really erratic,

Sorry, but I cannot make head or tail of this sentence.

> see perldoc -f getc),

Do not see anything relevant there (5.8.7).

> The second works as I would expect (Enter and
> Ctrl-M give 13, Ctrl-J gives 10, no delays, etc.) because it AFAIK
> doesn't use getc.

Thanks.

> >> I didn't get why you use "getc" and not "ReadKey" (which not always
> >> uses "getc").
> >
> > Because T:R:P uses getc().

> I assume that is Term::ReadLine::Perl. What is the reason to do the test
> with Term::ReadKey?

Because T:R:P can use Term::ReadKey (if present).

> >> See perldoc Term::ReadKey, under ReadKey MODE [, Filehandle], at the
> >> end it mentions Windows and getc.
> >
> > Did not find any mention of what you suggest (0 vs 0e0, Win and getc)
> > in 2.30.

> Only the last one should print true. When MODE eq '0E0', ReadKey() takes
> a subt(i)le different code path.

I see nothing in the docs; so a behaviour of a particular version is
can't be relied on...

>         if ($_[0]) {
>             Win32PeekChar($File, $_[0]);
>         } else {
>             getc $File;
>         }

The source of Win32PeekChar() is in T:RK...  If `delay' parameter is
0, it does not Peek at all!  But I have no idea what it returns if one
presses, e.g., Left key...

> With '0E0' (I assume that) the $_0 tests true, so Win32PeekChar() is
> used.

  [One should better use '0 but true' in such a case.]

> > Again, this looks like contradicting the other parts of your message.

> Not to me.

Well, after your explanations, it is more clear.

Still, a lot of questions remain.  See above.

Thanks,
Ilya


------------------------------

Date: Sat, 22 Apr 2006 10:12:35 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Term::ReadKey on Win?  5.005 vs 5.8.8?
Message-Id: <e2d0dj.1ho.1@news.isolution.nl>

Ilya Zakharevich schreef:
> Dr.Ruud:

>> [tests]
>> Did you run them?
>
>   No such file or directory at -e line 1.

It is working code, just spread over more lines.
OK, different formatting:

#!/usr/bin/perl
use strict;
use warnings;

use Term::ReadKey;

local $\ = "\n";

open my $in, '+< CONIN$' or die $!;
ReadMode 4, $in;

$|=1;

print ord
  while defined($_=ReadKey 0, $in) and 3!=ord;

ReadMode 0, $in;  # change the number 0 to the string '0E0'
                  # (so with the quotes) for different behaviour
close $in;
__END__


Insert binmode at will.


>> The first works "erratic" (not really erratic,
>
> Sorry, but I cannot make head or tail of this sentence.
>
>> see perldoc -f getc),
>
> Do not see anything relevant there (5.8.7).

Have you actually read it?
"However, it cannot be used by itself to fetch single characters
without waiting for the user to hit enter."

Further, getc() has other (probably related) problems on Windows, see
Readkey.pm:
There are currently some limitations with this call under Windows. It
may be possible that non-blocking reads will fail when reading repeating
keys from more then one console.


>> When MODE eq '0E0', ReadKey()
>> takes a subt(i)le different code path.
>
> I see nothing in the docs; so a behaviour of a particular version is
> can't be relied on...

The docs say you can use 0. The docs don't say you can use '0E0'. But
still I did, after reading the code, because I saw the different code
path it would take.

>>         if ($_[0]) {
>>             Win32PeekChar($File, $_[0]);
>>         } else {
>>             getc $File;
>>         }
>
> The source of Win32PeekChar() is in T:RK...  If `delay' parameter is
> 0, it does not Peek at all!

But if its '0E0', it does.

I read the Win32PeekChar in the ReadKey.xs that comes with
Term::ReadKey-2.30.
If delay == 0 then Win32PeekChar() calls ReadConsoleInput().
http://en.wikipedia.org/wiki/Win32_console

-- 
Affijn, Ruud

"Gewoon is een tijger."



------------------------------

Date: Sat, 22 Apr 2006 08:55:04 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Term::ReadKey on Win?  5.005 vs 5.8.8?
Message-Id: <e2cr18$hs$1@agate.berkeley.edu>

[A complimentary Cc of this posting was NOT [per weedlist] sent to
Dr.Ruud
<rvtol+news@isolution.nl>], who wrote in article <e2d0dj.1ho.1@news.isolution.nl>:
> >> Did you run them?

> >   No such file or directory at -e line 1.

> It is working code,

Sure.  But there is "No such file or directory"!

If it is not clear yet: if I had an access to Win* machines, I would
do experiments myself.  Thanks.

> >> The first works "erratic" (not really erratic, see perldoc -f getc),

> > Do not see anything relevant there (5.8.7).

> Have you actually read it?

Dear Dr, Ruud; please be assured that the probability of myself
knowing what I talk about is not vanishingly small.  Thanks.  ;-)

> "However, it cannot be used by itself to fetch single characters
> without waiting for the user to hit enter."

Given that I do not "use it by itself", this carries no relevance.
Moreover, my dictionary would define "erratic" as "sometimes pink,
sometimes blue"; do not think this correlates any way with this
(unfortunate) sentence in the docs.

> Further, getc() has other (probably related) problems on Windows, see
> Readkey.pm:

> There are currently some limitations with this call under Windows. It
> may be possible that non-blocking reads will fail when reading repeating
> keys from more then one console.

Sorry, but I cannot read this message as broad as your interpretation.

> > I see nothing in the docs; so a behaviour of a particular version
> > can't be relied on...
> 
> The docs say you can use 0. The docs don't say you can use '0E0'. But
> still I did, after reading the code, because I saw the different code
> path it would take.

The code changes every release (this is what releases are about, right?).

> >>         if ($_[0]) {
> >>             Win32PeekChar($File, $_[0]);
> >>         } else {
> >>             getc $File;
> >>         }

> > The source of Win32PeekChar() is in T:RK...  If `delay' parameter is
> > 0, it does not Peek at all!

> But if its '0E0', it does.

The argument to Win32PeekChar() is int.  There is no difference of
(int)0 and (int)0e0.

Thanks,
Ilya

P.S.  Note that none of the questions in my preceeding message is
      answered.  Let me recall that they are about any guarantee (or
      intent) to support non-blocking calls via Win32PeekChar(), and
      what happens with "special keys"-presses if Win32PeekChar() is
      used.



------------------------------

Date: Sat, 22 Apr 2006 11:15:00 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Term::ReadKey on Win?  5.005 vs 5.8.8?
Message-Id: <e2d3kt.1dc.1@news.isolution.nl>

Ilya Zakharevich schreef:
> Ruud:
>> Ilya:

>>> [calling ReadKey with MODE 0 vs. '0E0']
>>> I see nothing in the docs; so a behaviour of a particular version
>>> can't be relied on...
>>
>> The docs say you can use 0. The docs don't say you can use '0E0'. But
>> still I did, after reading the code, because I saw the different code
>> path it would take.
>
> The code changes every release (this is what releases are about,
> right?).

This is about 2.30, but mainly about unwanted getc()-behaviour.


>>>>         if ($_[0]) {
>>>>             Win32PeekChar($File, $_[0]);
>>>>         } else {
>>>>             getc $File;
>>>>         }
>>>
>>> The source of Win32PeekChar() is in T:RK...  If `delay' parameter is
>>> 0, it does not Peek at all!
>>
>> But if its '0E0', it does.
>
> The argument to Win32PeekChar() is int.  There is no difference of
> (int)0 and (int)0e0.

The '0E0' thing is not about the C-code path inside Win32PeekChar(), it
is about the Perl-code path inside ReadKey(). You didn't call
Win32PeekChar() in your test, you called getc(). I changed that to an
undocumented ReadKey() call, to get rid of the getc().


> P.S.  Note that none of the questions in my preceeding message is
>       answered.  Let me recall that they are about any guarantee (or
>       intent) to support non-blocking calls via Win32PeekChar(), and
>       what happens with "special keys"-presses if Win32PeekChar() is
>       used.

When MODE is 0, ReadKey() uses getc(), and you get getc()-behaviour.
When MODE is '0E0', ReadKey() uses Win32PeekChar, and behaves a lot
better.

-- 
Affijn, Ruud

"Gewoon is een tijger."



------------------------------

Date: Fri, 21 Apr 2006 16:37:13 -0600
From: Jeff Stampes <Jeff.Stampes@xilinx.com>
Subject: Re: XS Progamming with Perl 6
Message-Id: <e2bmq5$dq316@xco-news.xilinx.com>

Uri Guttman wrote:
> some of these quick pronouncement of never using p6 are silly. most who
> claim that don't know much about it.

Or they think they know too much about it.  Personally I'm excited by the prospects of 
perl6, and made the mistake of subscribing to p6-language.  Following the discussion 
there, or should I say *trying* to follow the discussion there is enough to scare any 
self-respecting perl programmer!

I've now learned language design is the same as government and sausage, you really don't 
want to see what goes into it.

~Jeff


------------------------------

Date: Sat, 22 Apr 2006 11:25:29 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: XS Progamming with Perl 6
Message-Id: <444986c6$0$19831$afc38c87@news.optusnet.com.au>


"Dave" <daveandniki@ntlworld.com>
 .
 .
>
> What puts you off Perl6? What would you choose to use in its place?
>

Basically, my main worry centres around the lack of XS. I am continually
extending perl (xs modules that interface to C libraries, Inline::C scripts)
and I'm not sure that I'll have the desire/energy to learn how to write
perl6 "extensions" - sort of depends upon how much desire/energy is needed.
If perl6 had been written in C, just as with the earlier versions of perl,
then I would have no problem with it. I can't actually understand anything
I've read about the perl6 internals (and parrot's involvement) which leads
me to think that it might not be for me ...... though, on the other hand,
it's unwise to make speculations based on stuff one doesn't understand.
(Then again, I've never claimed to have any wisdom.)

Just *why* does parrot have to be involved ? Can someone tell me that.

In an attempt to learn something of parrot, I tried to build the latest
snapshot a few weeks back. It won't even build straight out of the box using
gcc on Win32. Using MSVC++7.0, I was able to get it to build, though it
failed a significant number of the tests. And working from examples, while
some scripts worked, others failed with error messages that meant little to
me. I lost interest pretty quickly .... and it's those quick losses of
interest that will, I fear, be the main hurdle to overcome if I want to come
to grips with perl6.

For me, if I choose not to use perl6, and perl5 becomes unusable, then I'll
probably just do it in C. (I can still see me writing perl5 extensions 20
years from now :-)

Cheers,
Rob




------------------------------

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 9189
***************************************


home help back first fref pref prev next nref lref last post