[29732] in Perl-Users-Digest
Perl-Users Digest, Issue: 976 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 26 06:09:39 2007
Date: Fri, 26 Oct 2007 03:09: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 Fri, 26 Oct 2007 Volume: 11 Number: 976
Today's topics:
Re: configurable variables in own file? <tzz@lifelogs.com>
Re: configurable variables in own file? <bik.mido@tiscalinet.it>
daemon in perl kaustabh.banerjee@gmail.com
Re: daemon in perl <josef.moellers@fujitsu-siemens.com>
EU:MM and custom installation path <matteo.corti@gmail.com>
Re: How to fetch output of some other script in the cur <stoupa@practisoft.cz>
Re: How to interactively sending the username/password <josef.moellers@fujitsu-siemens.com>
new CPAN modules on Fri Oct 26 2007 (Randal Schwartz)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 25 Oct 2007 22:06:12 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: configurable variables in own file?
Message-Id: <m27ilar2vv.fsf@lifelogs.com>
On Thu, 25 Oct 2007 23:50:24 -0000 ivowel@gmail.com wrote:
i> thank you everybody. I also had hidden was that I do want at least
i> one short sub in the configuration that an enduser should be able to
i> change.
As long as you understand that this means that the end user can make
your program do anything at all (including break it completely so it
won't run unless you take very specific precautions), this is fine.
In my experience making the end users edit code simply means they will
call you or someone like you to help them. I try to avoid that
situation by planning for the users' needs and abstracting them into
configuration options.
i> therefore, layout out the variables to a data file, an obvious
i> solution, would not work for me.
I don't know why you and many others insist on merging the notions of
configuration (pure data) and code (which includes code configuration).
Let the user write code your program will run if you wish, but at least
consider what it means to ask a user to learn Perl in order to configure
your program (for an example, consider what happens when the user tries
to use a dollar sign or a backslash, or what happens with a string like
"$var's").
i> I am not particularly fond of requiring my more naive users to start
i> using CPAN.
But you're OK asking them to write Perl code to configure your program?
i> yes, I love CPAN for my own use, but I don't want them to get into
i> potential dependency issues. I want to use only modules that come
i> with the standard perl distribution. It is just a personal choice,
i> that I don't expect anyone else to share.
Avoiding the use of CPAN is, to say the least, backwards. You can
always freeze a CPAN module with your program if you can't stand the
idea of software maintenance. Are you aware that the core 5.8, for
instance, contains modules that were not in 5.6? Does that mean you
won't use the 5.8 core modules to avoid dependency issues? Do you avoid
interactions with databases (the DBI module and related code)? How do
you justify to yourself and to your employers avoiding the use of
Regexp::Common, for example, just because you're not fond of relying on
CPAN?
Don't hide behind the "personal choice." That's nonsense. Avoiding
CPAN is a bad decision that can only be justified by a paranoid company
policy, but not by personal fondness (especially if you're paid for your
work).
Ted
------------------------------
Date: Fri, 26 Oct 2007 09:39:37 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: configurable variables in own file?
Message-Id: <5863i3l146qnhumincec84ob7v0uso61q8@4ax.com>
On Thu, 25 Oct 2007 23:50:24 -0000, ivowel@gmail.com wrote:
>thank you everybody. I also had hidden was that I do want at least
>one short sub in the configuration that an enduser should be able to
>change. therefore, layout out the variables to a data file, an
>obvious solution, would not work for me.
>
>I am not particularly fond of requiring my more naive users to start
>using CPAN. yes, I love CPAN for my own use, but I don't want them to
Your users are naive enough to have potential problems using CPAN, yet
they are expected to be knowledgeable enough as to write a Perl sub?
Now, this sounds somewhat strange...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 25 Oct 2007 22:27:50 -0700
From: kaustabh.banerjee@gmail.com
Subject: daemon in perl
Message-Id: <1193376470.375039.262010@t8g2000prg.googlegroups.com>
I have a perl daemon which queries the DB in every 10 secs and checks
some data. The daemon runs fine for most of the time, but dies
sometimes with some DB exceptions. I have put eval block to survive
this.
But still it breaks sometimes.
How to survive any exception at all. I just want to run no matter
what..
------------------------------
Date: Fri, 26 Oct 2007 09:09:17 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: daemon in perl
Message-Id: <ffs3r8$719$2@nntp.fujitsu-siemens.com>
kaustabh.banerjee@gmail.com wrote:
> I have a perl daemon which queries the DB in every 10 secs and checks
> some data. The daemon runs fine for most of the time, but dies
> sometimes with some DB exceptions. I have put eval block to survive
> this.
>=20
> But still it breaks sometimes.
>=20
> How to survive any exception at all. I just want to run no matter
> what..
>=20
There's a mis-spelt identifier in line 1234 of your program.
1. How on earth are we to know what your problem is if you don't show us =
any code?
2. Don't program around a problem, solve it.
--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
------------------------------
Date: Fri, 26 Oct 2007 06:57:12 -0000
From: Teo <matteo.corti@gmail.com>
Subject: EU:MM and custom installation path
Message-Id: <1193381832.077631.244290@57g2000hsv.googlegroups.com>
Hi,
am using ExtUtils::MakeMaker for the distribution of a Perl script.
The Perl script (not a module a standalone script) is a plugin for a
software tool (Nagios) and has to be installed in a particular
location (e.g., /usr/lib/nagios/plugins/contrib) instead of the
canonical /usr/local/bin on a Unix platform.
This is how one of my many test Makefile.PL looks like:
# Load the Module::Install bundled in ./inc/
use inc::Module::Install;
##############################################################################
# Define metadata (we read it from the binary)
name 'check_dir';
all_from 'check_dir';
##############################################################################
# Specific dependencies
requires 'Carp' => 0;
requires 'English' => 0;
requires 'File::stat' => 0;
requires 'Getopt::Long' => 0;
requires 'Nagios::Plugin' => 0;
requires 'Nagios::Plugin::Threshold' => 0;
requires 'Pod::Usage' => 0;
requires 'version' => 0;
install_script 'check_dir';
WriteMakefile(
INSTALLDIRS => 'site',
INSTALLSITEBIN => '/usr/lib/nagios/plugins/contrib',
INSTALLSCRIPT => '/usr/lib/nagios/plugins/contrib',
);
I tried many combinations of INSTALLDIR values and INSTALL* variables
but I was never able to install the script in a place different from /
usr/local/bin.
Any hint?
Many thanks,
Matteo
------------------------------
Date: Fri, 26 Oct 2007 03:33:54 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: How to fetch output of some other script in the current running perl script?
Message-Id: <ffrgip$2250$1@ns.felk.cvut.cz>
ritugoyal12@gmail.com wrote:
> Hi,
> I want to execute some script (May or May not be perl script) from a
> perl script and print the output of that executed script.
> My Operating system are Windows and Mac OS(Unix).
> I was trying the following code without success:
>
>
> Code
> $Response = system("start test.wbt");
> print $Response;
>
Maybe this help you
$Response = system("start /wait test.wbt");
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
------------------------------
Date: Fri, 26 Oct 2007 08:57:48 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: How to interactively sending the username/password to login using ssh
Message-Id: <ffs35k$51s$1@nntp.fujitsu-siemens.com>
cyrusgreats@gmail.com wrote:
> Hi ,
> I'm trying to interactively sending the username/password to login and
> then send CLI commands usinf ssh, this is the only way I can access
> the device, and then sending the commands when logged in, I used the
> following but it seems does not pass the password, I'm sure one of you
> guyus out there have an idea. Thanks in advance..
>=20
>=20
> #!/usr/bin/perl
>=20
> use IPC::Session;
>=20
> # open ssh session to your applinace
> # -- set timeout of 30 seconds for all send() calls
> my $mybox =3D "10.0.42.111";
> my $session =3D new IPC::Session("ssh -l usrname $mybox",30);
>=20
> # use like 'expect':
> print $session->send("passwd");
>=20
>=20
> Here I see the Password prompt but I can't pass password ..
> cheers
>=20
I don't see anything about ttys in IPC::Session's pod. Therefore I=20
assume that it just spawns off an ssh with a pipe opened between the=20
script and the ssh (I don't have it installed, so I can't check, but you =
can check using some system call trace command, e.g. strace. Beware that =
you must tell strace to follow subprocesses!). For some (security?)=20
reasons, on Linux ssh will open /dev/tty to obtain the password, so you=20
can't send it through the pipe.
It would be better, indeed, to use the Expect module to handle this. On=20
Linux, Expect will communicate with the subprocess through a pseudo tty, =
which is set up as the subprocess' controlling tty and, as such, will be =
accessable through /dev/tty.
Josef
--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
------------------------------
Date: Fri, 26 Oct 2007 04:42:19 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Fri Oct 26 2007
Message-Id: <JqI52J.C95@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.
Acme-LOLCAT-0.0.4
http://search.cpan.org/~kcowgill/Acme-LOLCAT-0.0.4/
SPEEK LIEK A LOLCATZ
----
Acme-Tiroler-0.02
http://search.cpan.org/~marcel/Acme-Tiroler-0.02/
write code like a tyrolean says it
----
Apache-iTunes-0.11
http://search.cpan.org/~bdfoy/Apache-iTunes-0.11/
control iTunes from mod_perl
----
BSD-Process-0.05
http://search.cpan.org/~dland/BSD-Process-0.05/
Information about running processes on BSD platforms
----
Business-ISBN-Data-1.16
http://search.cpan.org/~bdfoy/Business-ISBN-Data-1.16/
data pack for Business::ISBN
----
Business-ISMN-1.11
http://search.cpan.org/~bdfoy/Business-ISMN-1.11/
work with International Standard Music Numbers
----
Business-TW-TSIB-VirtualAccount-0.01
http://search.cpan.org/~cornelius/Business-TW-TSIB-VirtualAccount-0.01/
Module for Taishin Bank Virtual Account Management
----
Business-US-USPS-WebTools-0.00
http://search.cpan.org/~bdfoy/Business-US-USPS-WebTools-0.00/
Use the US Postal Service Web Tools
----
CatalystX-CRUD-Controller-RHTMLO-0.04
http://search.cpan.org/~karman/CatalystX-CRUD-Controller-RHTMLO-0.04/
Rose::HTML::Objects CRUD controller
----
Config-Hierarchical-0.08
http://search.cpan.org/~nkh/Config-Hierarchical-0.08/
Hierarchical configuration container
----
DateTime-Format-Natural-0.57
http://search.cpan.org/~schubiger/DateTime-Format-Natural-0.57/
Create machine readable date/time with natural parsing logic
----
Devel-Declare-0.001004
http://search.cpan.org/~mstrout/Devel-Declare-0.001004/
----
Exception-ThrowUnless-1.11
http://search.cpan.org/~rpaul/Exception-ThrowUnless-1.11/
----
Geo-Ov2-0.90_04
http://search.cpan.org/~hpa/Geo-Ov2-0.90_04/
Library for reading and writing TomTom Navigator .ov2 POI files.
----
Geo-Ov2-0.90_05
http://search.cpan.org/~hpa/Geo-Ov2-0.90_05/
Library for reading and writing TomTom Navigator .ov2 POI files.
----
Geo-Ov2-0.90_06
http://search.cpan.org/~hpa/Geo-Ov2-0.90_06/
Library for reading and writing TomTom Navigator .ov2 POI files.
----
Gungho-0.09000_01
http://search.cpan.org/~dmaki/Gungho-0.09000_01/
Yet Another High Performance Web Crawler Framework
----
HTML-Feature-2.0.2
http://search.cpan.org/~miki/HTML-Feature-2.0.2/
Extract Feature Sentences From HTML Documents
----
InSilicoSpectro-Databanks-0.0.22
http://search.cpan.org/~alexmass/InSilicoSpectro-Databanks-0.0.22/
parsing protein/nucleotides sequence databanks (fasta, uniprot...)
----
Lingua-EN-Conjugate-0.303
http://search.cpan.org/~rwg/Lingua-EN-Conjugate-0.303/
Conjugation of English verbs
----
Lingua-ES-Numeros-0.05
http://search.cpan.org/~jrey/Lingua-ES-Numeros-0.05/
Translates numbers to spanish text
----
Locale-Object-0.78
http://search.cpan.org/~jrobinson/Locale-Object-0.78/
An object-oriented representation of locale information.
----
Net-Address-Ethernet-1.096
http://search.cpan.org/~mthurn/Net-Address-Ethernet-1.096/
find hardware ethernet address
----
POE-Component-PreforkDispatch-0.1
http://search.cpan.org/~ewaters/POE-Component-PreforkDispatch-0.1/
Preforking task dispatcher
----
Parse-Yapp-KeyValue-0.02
http://search.cpan.org/~diz/Parse-Yapp-KeyValue-0.02/
parser for simple key/value pairs
----
Rose-DBx-Garden-0.01
http://search.cpan.org/~karman/Rose-DBx-Garden-0.01/
bootstrap Rose::DB::Object and Rose::HTML::Form classes
----
Swarmage-0.00007
http://search.cpan.org/~dmaki/Swarmage-0.00007/
A Distributed Job Queue
----
TRL-Microarray-0.061
http://search.cpan.org/~cjones/TRL-Microarray-0.061/
A Perl module for creating and manipulating microarray objects
----
TRL-Microarray-0.062
http://search.cpan.org/~cjones/TRL-Microarray-0.062/
A Perl module for creating and manipulating microarray objects
----
Term-Cap-1.11
http://search.cpan.org/~jstowe/Term-Cap-1.11/
Perl termcap interface
----
Test-CompanionClasses-0.01
http://search.cpan.org/~marcel/Test-CompanionClasses-0.01/
basic invocation of Test::CompanionClasses::Engine
----
Test-CompanionClasses-0.02
http://search.cpan.org/~marcel/Test-CompanionClasses-0.02/
basic invocation of Test::CompanionClasses::Engine
----
WWW-Mechanize-1.31_02
http://search.cpan.org/~petdance/WWW-Mechanize-1.31_02/
Handy web browsing in a Perl object
----
Win32-UrlCache-0.04
http://search.cpan.org/~ishigaki/Win32-UrlCache-0.04/
parse Internet Explorer's history/cache/cookies
----
XML-Tiny-1.08
http://search.cpan.org/~dcantrell/XML-Tiny-1.08/
simple lightweight parser for a subset of XML
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/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
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 976
**************************************