[31213] in Perl-Users-Digest
Perl-Users Digest, Issue: 2458 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 4 09:09:43 2009
Date: Thu, 4 Jun 2009 06:09:07 -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 Thu, 4 Jun 2009 Volume: 11 Number: 2458
Today's topics:
Flash calling Php calling Perl <bill@ts1000.us>
Re: Flash calling Php calling Perl <jstucklex@attglobal.net>
Re: Flash calling Php calling Perl <cartercc@gmail.com>
Intel Introduces ULV Processor, Presses Thin and Light <whatnextur@gmail.com>
new CPAN modules on Thu Jun 4 2009 (Randal Schwartz)
Perl FTP Get Help <mparker@ygptech.com>
Re: Perl FTP Get Help <mvdwege@maily.com>
Re: Perl FTP Get Help <tadmc@seesig.invalid>
Re: print buffer in Perl 5.10 <john1949@yahoo.com>
Re: Success <ben@morrow.me.uk>
Re: Success <ben@morrow.me.uk>
Re: Success <cwilbur@chromatico.net>
Re: Success <edgrsprj@ix.netcom.com>
Update <edgrsprj@ix.netcom.com>
What happened to perl doc <klausfpga@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 4 Jun 2009 03:28:59 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Flash calling Php calling Perl
Message-Id: <3b742fa7-2d62-4dc2-b44b-b1d833becd04@r34g2000vba.googlegroups.com>
Background:
I have a flash program that posts user enter data to a php program on
the server.
The php program then saves this data in a database and then uses system
() to call the perl program which takes the data and generates a pdf
file and thumbnail images.
The php program, on completion of the perl program then sends a status
back to flash telling it was done. Flash then calls the php script to
get thes thumbnails for the view to see. This process can take 10 or
more seconds on the perl side to complete.
We are changing the flash aplication so that there is no need for it
to display the thumbnails after posting the data over and I am looking
for a way of having the php program just start the perl program but
not wait for it to complete before sending back the status to flash.
From all the possible PHP commands, exec(), shell_exec(), passthru()
and system(), it seems that they all wait for the called program to
finish, is there a way to just start the program and not wait for it
to complete?
The other method would be to send the results back to flash prior to
calling the perl program and not care how long perl took to do its
job. Would flush() and ob_flush() be sufficient to force this
information out to flash (the only information being sent back is
"result=saved" or "result=fail")?
If this is not possible, then on the perl side (crossposted to
comp.lang.perl.misc for this question), is there a way of having a
script take the command line arguments passed by php's shell() and
forking (is this right term?) the real perl program and ending so that
php is not waiting for the real program to finish?
Bill H
------------------------------
Date: Thu, 04 Jun 2009 07:08:53 -0400
From: Jerry Stuckle <jstucklex@attglobal.net>
Subject: Re: Flash calling Php calling Perl
Message-Id: <h08a10$gl8$1@news.eternal-september.org>
Bill H wrote:
> Background:
>
> I have a flash program that posts user enter data to a php program on
> the server.
> The php program then saves this data in a database and then uses system
> () to call the perl program which takes the data and generates a pdf
> file and thumbnail images.
> The php program, on completion of the perl program then sends a status
> back to flash telling it was done. Flash then calls the php script to
> get thes thumbnails for the view to see. This process can take 10 or
> more seconds on the perl side to complete.
>
> We are changing the flash aplication so that there is no need for it
> to display the thumbnails after posting the data over and I am looking
> for a way of having the php program just start the perl program but
> not wait for it to complete before sending back the status to flash.
>
> From all the possible PHP commands, exec(), shell_exec(), passthru()
> and system(), it seems that they all wait for the called program to
> finish, is there a way to just start the program and not wait for it
> to complete?
>
http://www.lmgtfy.com/?q=php+exec+background
Lots of hits show how you run programs in the background from PHP. How
to do it is system specific, though, and you must redirect stdout.
For instance in Linux, you might do
exec("/usr/bin/perl /home/mydir/perlscript > /dev/null &");
> The other method would be to send the results back to flash prior to
> calling the perl program and not care how long perl took to do its
> job. Would flush() and ob_flush() be sufficient to force this
> information out to flash (the only information being sent back is
> "result=saved" or "result=fail")?
>
Not reliably. flush() and ob_flush() clear the PHP buffers, but you
can't force the data to be sent from the web server. The only way to
ensure the data is sent is for the script to end.
> If this is not possible, then on the perl side (crossposted to
> comp.lang.perl.misc for this question), is there a way of having a
> script take the command line arguments passed by php's shell() and
> forking (is this right term?) the real perl program and ending so that
> php is not waiting for the real program to finish?
>
>
>
> Bill H
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
------------------------------
Date: Thu, 4 Jun 2009 05:43:58 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: Flash calling Php calling Perl
Message-Id: <9fb8fffc-4953-4e71-a7cf-f939b7e49df5@l32g2000vba.googlegroups.com>
On Jun 4, 6:28=A0am, Bill H <b...@ts1000.us> wrote:
> The php program, on completion of the perl program then sends a status
> back to flash telling it was done. Flash then calls the php script to
> get thes thumbnails for the view to see. This process can take 10 or
> more seconds on the perl side to complete.
Why are you using PHP if all PHP does is act as an intermediary to
accept input from Flash and emit output to Perl? Do you really need to
have insert and select queries from a database? Seems to me you would
have a cleaner and more stable app calling Perl directly and by-
passing PHP and the DB entirely to the extent that you perform a write
and read operation before you start creating your files.
get_data($user_supplied_data);
insert_data($connection_dbh, $user_supplied_data);
create_documents($user_supplied_data);
> We are changing the flash aplication so that there is no need for it
> to display the thumbnails after posting the data over and I am looking
> for a way of having the php program just start the perl program but
> not wait for it to complete before sending back the status to flash.
You implied that this would be suitable for a multi-threaded app but
didn't directly say so. If you have multiple cores and multiple tasks,
you might be able to decompose your tasks into different processes and
queue them to pass to any processor that can run the process. If you
have only one processor this probably wouldn't make much sense.
> If this is not possible, then on the perl side (crossposted to
> comp.lang.perl.misc for this question), is there a way of having a
> script take the command line arguments passed by php's shell() and
> forking (is this right term?) the real perl program and ending so that
> php is not waiting for the real program to finish?
I have a couple of tasks that process several thousand files at a time
using data queried from a database, creating, printing, emailing, and
then deleting each file. My main Perl script calls helper scripts each
of which is designed to do exactly one thing. It's mostly a hack, but
it works (which is the main thing) and I don't have to wait until the
last file is handled to start using the earlier files.
CC
------------------------------
Date: Wed, 3 Jun 2009 21:36:02 -0700 (PDT)
From: "whatnext@gmail.com" <whatnextur@gmail.com>
Subject: Intel Introduces ULV Processor, Presses Thin and Light Laptops
Message-Id: <90947424-7180-4b01-935f-21e2c746df07@o20g2000vbh.googlegroups.com>
Intel introduced three standard-volt processors, a ULV processor and a
new chip set, plus emphasized growth of its My WiFi technology and
WiMax. But its big message from the Computex 2009 show in Taipei was
"thin is in."
for more info http://www.intel-intel99.blogspot.com/
------------------------------
Date: Thu, 4 Jun 2009 04:42:29 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Jun 4 2009
Message-Id: <KKp6Et.JLE@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-PodBrowser-0.01
http://search.cpan.org/~opi/Apache2-PodBrowser-0.01/
show your POD in a browser
----
App-ForExample-0.01
http://search.cpan.org/~rkrimen/App-ForExample-0.01/
A guide through Catalyst, Apache, lighttpd, nginx, monit, ..., configuration hell
----
App-Framework-0.94
http://search.cpan.org/~sdprice/App-Framework-0.94/
A framework for creating applications
----
Asterisk-CoroManager-0.11
http://search.cpan.org/~fiddur/Asterisk-CoroManager-0.11/
Asterisk Manager Interface, Coro version
----
B-Hooks-Parser-0.09
http://search.cpan.org/~flora/B-Hooks-Parser-0.09/
Interface to perls parser variables
----
Bundle-Compress-Zlib-2.020
http://search.cpan.org/~pmqs/Bundle-Compress-Zlib-2.020/
Install Compress::Zlib and dependencies
----
Bundle-IO-Compress-Bzip2-2.020
http://search.cpan.org/~pmqs/Bundle-IO-Compress-Bzip2-2.020/
Install IO::Compress::Bzip2 and dependencies
----
CGI-Application-Plugin-Routes-1.01
http://search.cpan.org/~porta/CGI-Application-Plugin-Routes-1.01/
Routes-style dispatching for CGI::Application
----
Catalyst-Action-SubDomain-0.07
http://search.cpan.org/~egor/Catalyst-Action-SubDomain-0.07/
Match action against names of subdomains
----
Catalyst-Controller-MetaForm-0.01_01
http://search.cpan.org/~berle/Catalyst-Controller-MetaForm-0.01_01/
MetaForm sugar for Catalyst
----
Catalyst-Model-SOAP-1.2
http://search.cpan.org/~druoso/Catalyst-Model-SOAP-1.2/
Map a WSDL to a catalyst model class.
----
CatalystX-Dispatcher-AsGraph-0.01
http://search.cpan.org/~franckc/CatalystX-Dispatcher-AsGraph-0.01/
Create a graph from Catalyst dispatcher
----
CatalystX-Dispatcher-AsGraph-0.02
http://search.cpan.org/~franckc/CatalystX-Dispatcher-AsGraph-0.02/
Create a graph from Catalyst dispatcher
----
Class-MetaForm-0.01_01
http://search.cpan.org/~berle/Class-MetaForm-0.01_01/
Gluing forms onto Moose
----
Compress-Raw-Bzip2-2.020
http://search.cpan.org/~pmqs/Compress-Raw-Bzip2-2.020/
Low-Level Interface to bzip2 compression library
----
Compress-Raw-Zlib-2.020
http://search.cpan.org/~pmqs/Compress-Raw-Zlib-2.020/
Low-Level Interface to zlib compression library
----
Data-Pareto-0.04
http://search.cpan.org/~pwes/Data-Pareto-0.04/
Computing Pareto sets in Perl
----
Data-Peek-0.26
http://search.cpan.org/~hmbrand/Data-Peek-0.26/
A collection of low-level debug facilities
----
Data-Peek-0.27
http://search.cpan.org/~hmbrand/Data-Peek-0.27/
A collection of low-level debug facilities
----
Devel-Declare-0.005004
http://search.cpan.org/~flora/Devel-Declare-0.005004/
Adding keywords to perl, in perl
----
Devel-PerlySense-0.0180
http://search.cpan.org/~johanl/Devel-PerlySense-0.0180/
Perl IDE backend with Emacs frontend
----
EBook-Tools-0.4.5
http://search.cpan.org/~azed/EBook-Tools-0.4.5/
Object class for manipulating and generating E-books
----
Elive-0.24
http://search.cpan.org/~warringd/Elive-0.24/
Elluminate Live (c) client library
----
Elive-0.25
http://search.cpan.org/~warringd/Elive-0.25/
Elluminate *Live!* (c) client library
----
Enbugger-2.006
http://search.cpan.org/~whitepage/Enbugger-2.006/
Enables the debugger at runtime.
----
File-ChangeNotify-0.06
http://search.cpan.org/~drolsky/File-ChangeNotify-0.06/
Watch for changes to files, cross-platform style
----
File-Spotlight-0.01
http://search.cpan.org/~miyagawa/File-Spotlight-0.01/
List files from Smart Folder by reading .savedSearch files
----
File-Spotlight-0.02
http://search.cpan.org/~miyagawa/File-Spotlight-0.02/
List files from Smart Folder by reading .savedSearch files
----
File-Spotlight-0.03
http://search.cpan.org/~miyagawa/File-Spotlight-0.03/
List files from Smart Folder by reading .savedSearch files
----
Gearman-XS-0.2
http://search.cpan.org/~dschoen/Gearman-XS-0.2/
Perl front end for the Gearman C library.
----
Getopt-Chain-0.014
http://search.cpan.org/~rkrimen/Getopt-Chain-0.014/
Command-line processing like svn and git
----
IO-Compress-2.020
http://search.cpan.org/~pmqs/IO-Compress-2.020/
----
IO-Compress-Lzf-2.020
http://search.cpan.org/~pmqs/IO-Compress-Lzf-2.020/
Write lzf files/buffers
----
IO-Compress-Lzop-2.020
http://search.cpan.org/~pmqs/IO-Compress-Lzop-2.020/
Write lzop files/buffers
----
JSON-Streaming-Reader-0.01
http://search.cpan.org/~mart/JSON-Streaming-Reader-0.01/
Read JSON strings in a streaming manner
----
Jorge-0.01
http://search.cpan.org/~porta/Jorge-0.01/
ORM Made simple.
----
Lingua-LO-Romanize-0.07
http://search.cpan.org/~jokke/Lingua-LO-Romanize-0.07/
Romanization of Lao language
----
Lingua-LO-Romanize-0.08
http://search.cpan.org/~jokke/Lingua-LO-Romanize-0.08/
Romanization of Lao language
----
Locale-Maketext-Pseudo-0.6
http://search.cpan.org/~dmuey/Locale-Maketext-Pseudo-0.6/
give localized code a pseudo language obj if a real one does not exist.
----
Locale-Maketext-Utils-0.15
http://search.cpan.org/~dmuey/Locale-Maketext-Utils-0.15/
Adds some utility functionality and failure handling to Local::Maketext handles
----
MQdb_0.954
http://search.cpan.org/~jms/MQdb_0.954/
----
Net-Growl-GNTP-0.05
http://search.cpan.org/~mattn/Net-Growl-GNTP-0.05/
Perl implementation of GNTP Protocol (Client Part)
----
Net-Server-Mail-ESMTP-STARTTLS-0.01
http://search.cpan.org/~danmoore/Net-Server-Mail-ESMTP-STARTTLS-0.01/
The great new Net::Server::Mail::ESMTP::STARTTLS!
----
Net-Twitter-3.00003
http://search.cpan.org/~mmims/Net-Twitter-3.00003/
A perl interface to the Twitter API
----
POE-Filter-Finger-0.08
http://search.cpan.org/~bingos/POE-Filter-Finger-0.08/
A POE Filter for creating FINGER servers.
----
Parse-Constructor-Arguments-0.091540
http://search.cpan.org/~nperez/Parse-Constructor-Arguments-0.091540/
Parse Moose constructor arguments using PPI
----
Pod-L10N-0.03_01
http://search.cpan.org/~argrath/Pod-L10N-0.03_01/
----
Rose-DBx-Object-Builder-0.02
http://search.cpan.org/~danny/Rose-DBx-Object-Builder-0.02/
Database Table Schema Generation for Rose::DB::Object
----
Spreadsheet-Read-0.35
http://search.cpan.org/~hmbrand/Spreadsheet-Read-0.35/
Read the data from a spreadsheet
----
Sub-Contract-0.10
http://search.cpan.org/~erwan/Sub-Contract-0.10/
Pragmatic contract programming for Perl
----
Twitter-0.12
http://search.cpan.org/~zefonseca/Twitter-0.12/
----
WWW-Wuala-00.1
http://search.cpan.org/~perforin/WWW-Wuala-00.1/
Interface to the Wuala API
----
WebService-Backlog-0.08
http://search.cpan.org/~yamamoto/WebService-Backlog-0.08/
Perl interface to Backlog.
----
XML-CompileX-Tranport-SOAPXMPP-1.0
http://search.cpan.org/~druoso/XML-CompileX-Tranport-SOAPXMPP-1.0/
----
XML-Easy-Transform-RationalizeNamespacePrefixes-1.00
http://search.cpan.org/~markf/XML-Easy-Transform-RationalizeNamespacePrefixes-1.00/
rationalize namespaces prefixes
----
XML-Parser-Wrapper-0.11
http://search.cpan.org/~dowens/XML-Parser-Wrapper-0.11/
A simple object wrapper around XML::Parser
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.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
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/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
------------------------------
Date: Wed, 3 Jun 2009 17:35:55 -0700 (PDT)
From: "mparker@ygptech.com" <mparker@ygptech.com>
Subject: Perl FTP Get Help
Message-Id: <7840e2cf-2344-43da-a03d-0fc82c1b2e94@m19g2000yqk.googlegroups.com>
I posted all of my code below for easy reference. I have this code
setup to connect to an FTP server and download some files. It works
great when I login as root. However, when I run this in cron I get the
error below. I set the directory permissions to 0777 just to see if it
would work and I get the same error.
Does anyone have any thoughts or any recommendations on what I can
look at to begin troubleshooting?
Thanks in advance!
Errors:
Cannot open Local file agents.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 12
Cannot open Local file commercial.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 13
Cannot open Local file condominium.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 14
Cannot open Local file multifamily.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 15
Cannot open Local file offices.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 16
Cannot open Local file residential.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 17
Cannot open Local file vacantland.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 18
Cannot open Local file photos.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 26
Cannot open Local file openhouse.txt: Permission denied
at /var/www/vhosts/domain.com/httpdocs/realcomp/idx.pl line 34
Code:
#!/usr/bin/perl
use Net::FTP;
my $ftp = Net::FTP->new("ftp.domain.com", Debug => 0);
$ftp->login("username", "password");
my @file_list = $ftp->ls();
foreach (@file_list) {
$ftp->get($_, 'agents.txt') if ( $_ =~ m/idxag.*?\.txt/ );
$ftp->get($_, 'commercial.txt') if ( $_ =~ m/idxcm.*?
\.txt/ );
$ftp->get($_, 'condominium.txt') if ( $_ =~ m/idxcn.*?
\.txt/ );
$ftp->get($_, 'multifamily.txt') if ( $_ =~ m/idxmf.*?
\.txt/ );
$ftp->get($_, 'offices.txt') if ( $_ =~ m/idxof.*?\.txt/ );
$ftp->get($_, 'residential.txt') if ( $_ =~ m/idxrs.*?
\.txt/ );
$ftp->get($_, 'vacantland.txt') if ( $_ =~ m/idxvl.*?
\.txt/ );
}
$ftp->cwd("/photoext");
my @file_list = $ftp->ls();
foreach (@file_list) {
$ftp->get($_, 'photos.txt') if ( $_ =~ m/photos.*?\.txt/ );
}
$ftp->cwd("/OpenHouse");
my @file_list = $ftp->ls();
foreach (@file_list) {
$ftp->get($_, 'openhouse.txt') if ( $_ =~ m/openhouse.*?
\.txt/ );
}
$ftp->quit;
------------------------------
Date: Thu, 04 Jun 2009 09:04:35 +0200
From: Mart van de Wege <mvdwege@maily.com>
Subject: Re: Perl FTP Get Help
Message-Id: <86bpp4scn0.fsf@gareth.avalon.lan>
"mparker@ygptech.com" <mparker@ygptech.com> writes:
> I posted all of my code below for easy reference. I have this code
> setup to connect to an FTP server and download some files. It works
> great when I login as root. However, when I run this in cron I get the
> error below. I set the directory permissions to 0777 just to see if it
> would work and I get the same error.
>
> Does anyone have any thoughts or any recommendations on what I can
> look at to begin troubleshooting?
>
> Thanks in advance!
>
> Errors:
> Cannot open Local file agents.txt: Permission denied
From the error it is obvious that your script cannot write out the
local file. If you have set the directory permissions to 777, then it is
also obvious that the script is not trying to write in that directory,
or it wouldn't get a permission denied error.
So, what you need to do is find out what the working directory is for
your script.
Mart
--
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.
------------------------------
Date: Thu, 4 Jun 2009 06:15:13 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Perl FTP Get Help
Message-Id: <slrnh2fb61.2gq.tadmc@tadmc30.sbcglobal.net>
Mart van de Wege <mvdwege@maily.com> wrote:
> "mparker@ygptech.com" <mparker@ygptech.com> writes:
>
>> I posted all of my code below for easy reference. I have this code
>> setup to connect to an FTP server and download some files. It works
>> great when I login as root. However, when I run this in cron I get the
>> error below. I set the directory permissions to 0777 just to see if it
>> would work and I get the same error.
>>
>> Does anyone have any thoughts or any recommendations on what I can
>> look at to begin troubleshooting?
>>
>> Thanks in advance!
>>
>> Errors:
>> Cannot open Local file agents.txt: Permission denied
>
> From the error it is obvious that your script cannot write out the
> local file. If you have set the directory permissions to 777, then it is
> also obvious that the script is not trying to write in that directory,
> or it wouldn't get a permission denied error.
>
> So, what you need to do is find out what the working directory is for
^^^^^^^^^^
> your script.
If the program simply chdir()s to the directory it wants to be in,
then what the old, default, working directory was will not matter. :-)
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Thu, 4 Jun 2009 10:44:06 +0100
From: "John" <john1949@yahoo.com>
Subject: Re: print buffer in Perl 5.10
Message-Id: <h0850t$q2j$1@news.albasani.net>
"Ben Morrow" <ben@morrow.me.uk> wrote in message
news:s6kif6-ir2.ln1@osiris.mauzo.dyndns.org...
>
> Quoth "John" <john1949@yahoo.com>:
>>
>> Moved from Etch to Lenny in Debian and from Perl 5.8.8 to 5.10.
>>
>> Normally I use:
>> our $old_fh=select(STDOUT); $|=1; select($old_fh); # Make standard output
>> socket hot
>> but this appears no longer to work and output is now buffered.
>
> That construction (ugly as it may be) ought to still work in 5.10.
> Please post a complete, short script that we can run which demonstrates
> your problem.
>
> Ben
>
The proram is embarrassingly small but I cannot stop the print buffer.
#!/usr/bin/perl
use strict;
use warnings;
# use FileHandle; STDOUT->autoflush(1);
our $old_fh=select(STDOUT); $|=1; select($old_fh); # Make standard output
socket hot
print "Content-type: text/html\n\n";
print "hallo\n";
print "hallo<br>\n";
sleep(5);
print "hallo<br>\n";
sleep(5);
print "hallo<br>";
sleep(10);
print "hallo<br>";
sleep(2);
Regards
John
------------------------------
Date: Thu, 4 Jun 2009 00:01:12 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Success
Message-Id: <oubjf6-l76.ln1@osiris.mauzo.dyndns.org>
Quoth Ilya Zakharevich <nospam-abuse@ilyaz.org>:
> On 2009-06-03, Ben Morrow <ben@morrow.me.uk> wrote:
> >> What I discovered is that when a Perl screen is the visible one, the
> >> ReadKey commands work fine for detecting key presses. However when a
> >> Gnuplot graphics screen is the one being displayed, the IsKeyPressed
> >> command has to be used. ReadKey doesn't see any key presses for some
> >> reason. That probably has to do with the way that Windows works.
> >
> > Let me ask you this: do you really want your Perl program to respond to
> > keys pressed when some random window, say a Word window, has the focus?
>
> Obviously, either you have not used gnuplot, or know its
> implementation. ;-)
No, and no.
> [gnuplot has an IPC channel, so that keys pressed in the preview
> window are passed to the caller. But the caller must participate in IPC...]
That would be a good solution then, though I'm beginning to doubt the OP
will be able to see it :(.
Ben
------------------------------
Date: Thu, 4 Jun 2009 00:03:23 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Success
Message-Id: <r2cjf6-l76.ln1@osiris.mauzo.dyndns.org>
Quoth rogerh906@gmail.com:
> Charlton, is this a "help the newcomer" blog or a "be a smart aleck
> site"?
It's neither. It's a Usenet group for discussing Perl. If in the course
of the discussion things are mentioned which are useful to newcomers,
then great. There is, however, no reason to expect they will be.
Ben
------------------------------
Date: Wed, 03 Jun 2009 20:09:06 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Success
Message-Id: <86my8ozwpp.fsf@mithril.chromatico.net>
>>>>> "r" == rogerh906 <rogerh906@gmail.com> writes:
>> ....er, maybe it *doesn't* have someone who understands
>> programming on it. Back to Square 1!
r> Charlton, is this a "help the newcomer" blog or a "be a smart
r> aleck site"?
It's neither a blog nor a website. It's a newsgroup.
You say you have 20 years of experience with computers? Indeed.
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Wed, 3 Jun 2009 21:17:43 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Success
Message-Id: <P72dncu3CdJfs7rXnZ2dnUVZ_sednZ2d@earthlink.com>
"Charlton Wilbur" <cwilbur@chromatico.net> wrote in message
news:86vdndytbd.fsf@mithril.chromatico.net...
> It sounds to me like the project needs at least one person who actually
> understands how to program, and who understands how event-driven GUIs
> and interprocess communication work. Without that, you're going to keep
Increasingly complex Perl programs are being gradually developed. And there
are simply some code usage and program data sharing and control matters that
need to be addressed as the efforts progress. Things are now actually
working fairly well. Perl has to be used in part because it will eventually
probably be necessary to develop some moderately complex CGI programs.
------------------------------
Date: Wed, 3 Jun 2009 20:05:22 -0500
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Update
Message-Id: <vpGdnXkjz7lSgLrXnZ2dnUVZ_g6dnZ2d@earthlink.com>
"Ben Morrow" <ben@morrow.me.uk> wrote in message
news:spjif6-ir2.ln1@osiris.mauzo.dyndns.org...
> Let me ask you this: do you really want your Perl program to respond to
> keys pressed when some random window, say a Word window, has the focus?
> If you use IsKeyPressed that is exactly what you will get.
I thought that this discussion was going along reasonably well. It looks
like something happened in the last day to change the tone.
Let me say again, regardless of what limitations it might have, I personally
like the Perl programming language better than any other I have worked with
over the years. And I am recommending that other researchers use it.
Whatever documentation is needed for the people that I work with can be
easily created and stored on a Web page.
Those comments regarding documentation were just added information. The
question that needed an answer is how to get Perl to detect key presses.
The main Perl program that needs to do that has already been up and running
for some time. And since early March of 2009 it has been available for use
by governments and researchers around the world as a freeware download.
It opens a pipe to Gnuplot and tells the program to display certain types of
charts. The IsKeyPressed command is used to detect key presses when Gnuplot
charts are being displayed. So, the answer to that one question is "Yes."
The Perl program needs to be able to detect key presses when some other
program is the one actively displaying data. Another of these programs has
Perl detect key presses when a Word for Windows program is the one being
displayed.
Two problems were encountered with IsKeyPressed.
First, as far as I can tell, it does not do a good job of removing the key
press from the Windows keyboard buffer. So if a readline command is later
used to get a line from the buffer the last character is still there.
The second problem is that it would read only a limited number of keys. For
example, it does not appear to be able to distinguish between upper and
lower case key presses.
The ReadKey commands are somewhat more versatile. But when Gnuplot is the
screen being displayed they don't detect key presses from what I can tell
The Win32::Console commands look even better. But I could not get them to
work at all.
So the Perl - Gnuplot program that is already running has now been upgraded
so that it uses both the IsKeyPressed commands for when Gnuplot is
displayed, and the ReadKey and readline commands for when Perl is the active
screen. Between them they take care of the key detection and buffer clear
problems. If I can eventually determine how to get the Win32::Console
commands to work I will probably use them instead of ReadKey.
Finally, now that the ReadKey commands are being used, Perl and Gnuplot are
actually doing about all of the things that we need them to do. And from
this point discussions will probably focus on the proper format for using
various commands such as "open" etc.
------------------------------
Date: Thu, 4 Jun 2009 05:43:27 -0700 (PDT)
From: perl man <klausfpga@gmail.com>
Subject: What happened to perl doc
Message-Id: <80ddda9c-27b3-4346-b59c-5630341b15ad@f10g2000vbf.googlegroups.com>
Is this a bug or a new feature?
What I notice:
Working example: (perldoc for old perl versions)
1.) I go to http://perldoc.perl.org
2.) I select perl version 5.8.9
3.) I enter the word 'index' in the search field an and press enter.
4.) I see the help text about index.
Now the failing example (perldoc for perl 5.10.0 )
1.) I go to http://perldoc.perl.org
2.) I select perl version 5.10.0 (or I just select no version at all)
3.) I enter the word 'index' in the search field an and press enter.
4.) I see no help text about index. I seem to have no hit.
Friendly as perldoc is it suggests now:
> Search results
>
> The perldoc.perl.org search engine is optimised to index Perl functions, core modules, and FAQs. To perform a > full-text search of the documentation, please repeat your query using Google:
>
> radio -box allowing to select the google search space
> Google search button
>
I hope this is just a current drop out.
I use perldoc.perl.org a lot to browse perl documentation
interactively
Loosing this capability would be a real pity :-(
------------------------------
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 V11 Issue 2458
***************************************