[29368] in Perl-Users-Digest
Perl-Users Digest, Issue: 612 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 3 06:10:20 2007
Date: Tue, 3 Jul 2007 03:09:06 -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 Tue, 3 Jul 2007 Volume: 11 Number: 612
Today's topics:
Re: Adding a line in a file inside many directories <joe@inwap.com>
Re: Help finding CGI files on Unix server <joe@inwap.com>
Re: Help finding CGI files on Unix server anno4000@radom.zrz.tu-berlin.de
Re: Kicking off multiple processes at once instead of w <mark.clementsREMOVETHIS@wanadoo.fr>
new CPAN modules on Tue Jul 3 2007 (Randal Schwartz)
Re: perl and php <bik.mido@tiscalinet.it>
Perl or Groovy - Help to decide which to learn <amitamit2@gmail.com>
Re: Perl or Groovy - Help to decide which to learn <mark.clementsREMOVETHIS@wanadoo.fr>
Re: Portable general timestamp format, not 2038-limited <scott.daniels@acm.org>
Re: Portable general timestamp format, not 2038-limited <hjp-usenet2@hjp.at>
Re: Portable general timestamp format, not 2038-limited <http://phr.cx@NOSPAM.invalid>
Re: Portable general timestamp format, not 2038-limited <rjh@see.sig.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 03 Jul 2007 02:30:26 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: Adding a line in a file inside many directories
Message-Id: <T9-dnfSs2eioihfbnZ2dnUVZ_rjinZ2d@comcast.com>
Ved wrote:
> Ok I did a chop to make it working.
> chomp $dir;
> chop $dir; #to get rid of whitespace
> my $file = "$dir/$file_to_change";
Ugh! Bad way of correcting bad data.
The proper way to get rid of trailing whitespace is to
explicitly get rid of trailing whitespace.
$dir =~ s/\s+$//; # Get rid of training blanks
-Joe
------------------------------
Date: Tue, 03 Jul 2007 02:07:04 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: Help finding CGI files on Unix server
Message-Id: <tJqdnSTbzoZfjBfbnZ2dnUVZ_vCknZ2d@comcast.com>
bassintro wrote:
> What I mean is I am trying to find executable files that are run on
> the server side of a www connection.
CGI files are whatever the web server's configuration says is a CGI.
On one web server I used, only the ScriptAlias defined the directories
where CGI programs lived, and any file in that directory was considered
to be a CGI program whether it was executable or not.
ls `awk '/^ScriptAlias/{print $3}' /etc/httpd/conf/httpd.conf`
Another web server accepted any file with a .cgi extension as a
CGI program. It did not matter whether the contents of the file was
Perl, Bourne shell, or compiled binary.
find /var/www/html /home/*/public_html -name '*.cgi' -print
Looking inside of HTML files is a pretty poor method for locating these.
-Joe
------------------------------
Date: 3 Jul 2007 09:37:54 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Help finding CGI files on Unix server
Message-Id: <5eujniF3a51tvU1@mid.dfncis.de>
bassintro <bassintro@gmail.com> wrote in comp.lang.perl.misc:
> On Jul 2, 1:56 pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
> wrote:
> > bassintro wrote:
> > > On Jul 2, 1:21 pm, Keith Keller <kkeller-use...@wombat.san-
> > > francisco.ca.us> wrote:
> > >> On 2007-07-02, bassintro <bassin...@gmail.com> wrote:
> >
> > >>> I need a way to find all the cgi files on my server and simply list
> > >>> their name and dir.
> I was actually looking for an alternative to running...
> find . -type f -name '*.*htm*' -exec grep cgi {} \;
>
> it spits out the results of the cgi. I just want it to list the file
> and state what dir it's in, that's all...
find . -type f -name '*.*htm*' | xargs grep -l cgi
Anno
------------------------------
Date: Tue, 03 Jul 2007 08:17:47 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Kicking off multiple processes at once instead of waiting....
Message-Id: <4689ea03$0$27393$ba4acef3@news.orange.fr>
Simon wrote:
<snip>
>
> Thanks Joe..much appreciated.
>
> I do know Joe how to connect to a remote registry.
>
> I spose what Im trying to do, but cant get myself on some really really
> simple examples, so i can play with them, are example scripts on how to fork
> a process.
> Ive looked at the perldoc but I find the doco not as clear as some good
> beginner fork examples so I can test them out on my systems, then gain
> confidence that way.
>
> Appreciate your help. :)
>
You could look at Parallel::ForkManager - it may make things easier for
you.
Mark
------------------------------
Date: Tue, 3 Jul 2007 04:42:12 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Tue Jul 3 2007
Message-Id: <JKL6EC.771@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.
Alvis-Convert-0.4
http://search.cpan.org/~wbuntine/Alvis-Convert-0.4/
Perl extension for converting documents from a number of different source formats to Alvis XML format.
----
Bot-BB2-0.05
http://search.cpan.org/~avar/Bot-BB2-0.05/
----
Bundle-Ensembl-0.01
http://search.cpan.org/~ashgene/Bundle-Ensembl-0.01/
Bundle for installing Ensembl Perl Modules (Built from dependencies of ENSEMBL_42 VERSION)
----
CGI-Install-0.02
http://search.cpan.org/~adamk/CGI-Install-0.02/
Installer for CGI applications
----
Catalyst-Model-MogileFS-Client-0.06
http://search.cpan.org/~zigorou/Catalyst-Model-MogileFS-Client-0.06/
Model class of MogileFS::Client on Catalyst
----
Catalyst-Model-Net-Amazon-0.01002
http://search.cpan.org/~cfranks/Catalyst-Model-Net-Amazon-0.01002/
Catalyst model for Net::Amazon SOAP interface
----
Catalyst-Plugin-Static-Simple-0.19
http://search.cpan.org/~agrundma/Catalyst-Plugin-Static-Simple-0.19/
Make serving static pages painless.
----
Chess-Coverage-0.00_4
http://search.cpan.org/~gene/Chess-Coverage-0.00_4/
Expose chess ply potential energy
----
Class-Accessor-Grouped-0.07000
http://search.cpan.org/~claco/Class-Accessor-Grouped-0.07000/
Lets you build groups of accessors
----
Class-Fields-0.202
http://search.cpan.org/~mschwern/Class-Fields-0.202/
Inspect the fields of a class.
----
DBIx-XML_RDB-0.06
http://search.cpan.org/~danpeder/DBIx-XML_RDB-0.06/
Perl extension for creating XML from existing DBI datasources
----
Data-ClearSilver-HDF-0.02
http://search.cpan.org/~zigorou/Data-ClearSilver-HDF-0.02/
Convert from Perl Data Structure to ClearSilver HDF
----
Data-ClearSilver-HDF-0.03
http://search.cpan.org/~zigorou/Data-ClearSilver-HDF-0.03/
Convert from Perl Data Structure to ClearSilver HDF
----
Egg-Plugin-BackUP-Easy-2.01
http://search.cpan.org/~lushe/Egg-Plugin-BackUP-Easy-2.01/
Preserve backup data for Egg plugin.
----
Egg-Plugin-IxHash-2.01
http://search.cpan.org/~lushe/Egg-Plugin-IxHash-2.01/
Tie::Hash::Indexed for Egg plugin.
----
Games-Chess-Coverage-0.0201_1
http://search.cpan.org/~gene/Games-Chess-Coverage-0.0201_1/
RETIRED Expose the potential energy of chess games
----
Geo-Coder-GoogleMaps-0.2
http://search.cpan.org/~dupuisarn/Geo-Coder-GoogleMaps-0.2/
Google Maps Geocoding API
----
Gtk2-1.145
http://search.cpan.org/~tsch/Gtk2-1.145/
Perl interface to the 2.x series of the Gimp Toolkit library
----
HTML-FormFu-0.01000_02
http://search.cpan.org/~cfranks/HTML-FormFu-0.01000_02/
HTML Form Creation, Rendering and Validation Framework
----
HTML-FormFu-0.01000_03
http://search.cpan.org/~cfranks/HTML-FormFu-0.01000_03/
HTML Form Creation, Rendering and Validation Framework
----
HTML-StripScripts-LibXML-0.10
http://search.cpan.org/~drtech/HTML-StripScripts-LibXML-0.10/
XSS filter - outputs a LibXML Document or DocumentFragment
----
JSON-XS-1.4
http://search.cpan.org/~mlehmann/JSON-XS-1.4/
JSON serialising/deserialising, done correctly and fast
----
KSx-IndexManager-0.002
http://search.cpan.org/~hdp/KSx-IndexManager-0.002/
high-level invindex management interface
----
MRTG-Config-0.03
http://search.cpan.org/~sscaffidi/MRTG-Config-0.03/
Perl module for parsing MRTG configuration files
----
MRTG-Config-0.04
http://search.cpan.org/~sscaffidi/MRTG-Config-0.04/
Perl module for parsing MRTG configuration files
----
MozRepl-0.05
http://search.cpan.org/~zigorou/MozRepl-0.05/
Perl interface of MozRepl
----
Net-Flickr-Geo-0.3
http://search.cpan.org/~ascope/Net-Flickr-Geo-0.3/
tools for working with geotagged Flickr photos
----
Net-RTP-0.09
http://search.cpan.org/~njh/Net-RTP-0.09/
Send and receive RTP packets (RFC3550)
----
PITA-Guest-Driver-Qemu-0.40
http://search.cpan.org/~adamk/PITA-Guest-Driver-Qemu-0.40/
PITA Guest Driver for Qemu images
----
Test-GreaterVersion-0.008
http://search.cpan.org/~ggoldbach/Test-GreaterVersion-0.008/
Test if you incremented VERSION
----
WWW-Mixi-Scraper-0.04
http://search.cpan.org/~ishigaki/WWW-Mixi-Scraper-0.04/
yet another mixi scraper
----
WWW-Myspace-0.67
http://search.cpan.org/~grantg/WWW-Myspace-0.67/
Access MySpace.com profile information from Perl
----
WWW-Myspace-Data
http://search.cpan.org/~oalders/WWW-Myspace-Data/
WWW::Myspace database interaction
----
WWW-Myspace-FriendAdder
http://search.cpan.org/~oalders/WWW-Myspace-FriendAdder/
Interactively add friends to your Myspace account
----
WebService-UWO-Directory-Student-0.01
http://search.cpan.org/~frequency/WebService-UWO-Directory-Student-0.01/
Perform lookups using the University of Western Ontario's student directory
----
Win32-IIS-Admin-1.022
http://search.cpan.org/~mthurn/Win32-IIS-Admin-1.022/
Administer Internet Information Service on Windows
----
XML-SAX-ExpatXS-1.30
http://search.cpan.org/~pcimprich/XML-SAX-ExpatXS-1.30/
Perl SAX 2 XS extension to Expat parser
----
base-2.11
http://search.cpan.org/~mschwern/base-2.11/
Establish an ISA relationship with base classes at compile time
----
pfacter-1.7
http://search.cpan.org/~sschneid/pfacter-1.7/
Collect and display facts about the system
----
warnings-compat-0.04
http://search.cpan.org/~saper/warnings-compat-0.04/
warnings.pm emulation for pre-5.6 Perls
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: Tue, 03 Jul 2007 11:27:58 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl and php
Message-Id: <ek5k83d3pvedih50h3pbj0ojfneqmcfe86@4ax.com>
On Mon, 02 Jul 2007 17:59:31 -0400, Sherm Pendley
<spamtrap@dot-app.org> wrote:
>> Please tell me why there are tons of web sites made with PHP as
>> compared to Perl or any other language, if PHP is worse than Perl and
>> Ruby. How does it survive?
>
>The same way McDonald's survives - by catering to people who don't realize
>and/or don't care just how terrible it really is.
How 'bout MySpace? ;-)
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: Mon, 02 Jul 2007 21:28:53 -0700
From: Amit <amitamit2@gmail.com>
Subject: Perl or Groovy - Help to decide which to learn
Message-Id: <1183436933.623463.182930@i38g2000prf.googlegroups.com>
Hi,
I want some help deciding which of the two to learn.
I am new to either of the scripting languages. But I have worked in
Java. So I wanted to know that how does groovy compare with Perl.
I know perl is very strong and very much adored. So, considering the
long history of perl, it may definitely have more functions and
libraries (and sample code :;). But considering my background, will I
miss many functionalities if I decide to learn Groovy instead of Perl.
tia
Amit
------------------------------
Date: Tue, 03 Jul 2007 08:26:40 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Perl or Groovy - Help to decide which to learn
Message-Id: <4689ec16$0$5097$ba4acef3@news.orange.fr>
Amit wrote:
> Hi,
>
> I want some help deciding which of the two to learn.
>
> I am new to either of the scripting languages. But I have worked in
> Java. So I wanted to know that how does groovy compare with Perl.
>
> I know perl is very strong and very much adored. So, considering the
> long history of perl, it may definitely have more functions and
> libraries (and sample code :;).
Well - that's one of the advantages of Groovy, supposedly seamless
integration with Java. You can call any Java libraries you have directly
from Groovy.
> But considering my background, will I
> miss many functionalities if I decide to learn Groovy instead of Perl.
If you already know Java, then Groovy probably won't be much of a
learning curve. You should probably consider it as an additional Java
skill rather than a totally separate language.
Any decision you make should be based on what you need to do your work.
It wouldn't hurt to learn both (and maybe look at other languages as
well, eg Python, Ruby). If you need to specialize, you can do that as
the need arises.
Mark
------------------------------
Date: Mon, 02 Jul 2007 22:12:42 -0700
From: Scott David Daniels <scott.daniels@acm.org>
Subject: Re: Portable general timestamp format, not 2038-limited
Message-Id: <138jml0ldeucf32@corp.supernews.com>
Peter J. Holzer wrote:
> On 2007-06-22 20:33, James Harris <james.harris.1@googlemail.com> wrote:
>> I have a requirement to store timestamps in a database. Simple enough
>> you might think but finding a suitably general format is not easy. The
>> specifics are
>>
>> 1) subsecond resolution - milliseconds or, preferably, more detailed
>> 2) not bounded by Unix timestamp 2038 limit
>> 3) readable in Java
>> 4) writable portably in Perl which seems to mean that 64-bit values
>> are out
>> 5) readable and writable in Python
>> 6) storable in a free database - Postgresql/MySQL
>
> Stick to unix timestamps but store them as a double precision floating
> point number. The 53 bit mantissa gives you currently a resolution of
> about 200 ns, slowly deteriorating (you will hit ms resolution in about
> 280,000 years, if I haven't miscalculated). Any language and database
> should be able to handle double-precision FP numbers, so that's as
> portable as it gets and conversion from/to system time should be
> trivial.
>
> If you need to represent milliseconds exactly, you can just multiply the
> timestamp with 1000 (and get java timestamps).
>
> hp
TOPS-20 did an interesting format which suggest an interesting variant:
Tops-20: 36-bit (the machine word size) fixed-bit representation
of days since a given moment (the first Photographic
plates of the sky). The "binary point" was at the middle
of the word; the low order 18 bits were the time of day
(GMT), the high-order 18 bits were the days-since date.
Inspired format:
Days since a some standard date (the TAI date may be a good such
date) expressed as fixed point 64-bit (32-bit day part, 32-bit
day-fraction part) or floating point (using Intel's double-precision,
for example, gives you 26 bits each for day and day-fraction, though
the binary point moves for particular stamps).
Advantages of such a format:
Using simple arithmetic for the difference between two such stamps
is reasonably accurate even without knowing about when the leap seconds
occur. Better resolution is available with leap-second aware software.
A leap second affects the resolution only in intervals where there
_are_ leap seconds, and ignoring them leaves you almost 5 digits of
accuracy even when you naively ignore them.
Disadvantages:
time-of-day is not simple (but I maintain it shouldn't be).
No external way to know if a stamp is leap-second aware or not;
you'll just have to know for a whole group.
Once you have done a naive difference, there is no way to correct it.
--Scott David Daniels
scott.daniels@acm.org
------------------------------
Date: Tue, 3 Jul 2007 08:12:20 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Portable general timestamp format, not 2038-limited
Message-Id: <slrnf8jq64.853.hjp-usenet2@zeno.hjp.at>
On 2007-07-03 05:12, Scott David Daniels <scott.daniels@acm.org> wrote:
> Peter J. Holzer wrote:
>> On 2007-06-22 20:33, James Harris <james.harris.1@googlemail.com> wrote:
>>> I have a requirement to store timestamps in a database. Simple enough
>>> you might think but finding a suitably general format is not easy. The
>>> specifics are
[...]
>> Stick to unix timestamps but store them as a double precision floating
>> point number. The 53 bit mantissa gives you currently a resolution of
>> about 200 ns, slowly deteriorating (you will hit ms resolution in about
>> 280,000 years, if I haven't miscalculated). Any language and database
>> should be able to handle double-precision FP numbers, so that's as
>> portable as it gets and conversion from/to system time should be
>> trivial.
>>
>
> TOPS-20 did an interesting format which suggest an interesting variant:
> Tops-20: 36-bit (the machine word size) fixed-bit representation
> of days since a given moment (the first Photographic
> plates of the sky). The "binary point" was at the middle
> of the word; the low order 18 bits were the time of day
> (GMT), the high-order 18 bits were the days-since date.
>
> Inspired format:
> Days since a some standard date (the TAI date may be a good such
> date) expressed as fixed point 64-bit (32-bit day part, 32-bit
> day-fraction part) or floating point (using Intel's double-precision,
> for example, gives you 26 bits each for day and day-fraction, though
> the binary point moves for particular stamps).
Doesn't MS-Excel store timestamps in such a format?
This requires you to define what a "day" is:
a) 86400 seconds
b) the time between two consecutive readings of 00:00:00 on a UTC clock
c) something else.
Definition b) is probably the most useful.
> Advantages of such a format:
> Using simple arithmetic for the difference between two such stamps
> is reasonably accurate even without knowing about when the leap seconds
> occur. Better resolution is available with leap-second aware software.
> A leap second affects the resolution only in intervals where there
> _are_ leap seconds, and ignoring them leaves you almost 5 digits of
> accuracy even when you naively ignore them.
Since a day with a leap second has 86401 seconds (or 86399, but that
hasn't happened yet), a leap second aware counter could record the time
HH:MM:SS on such a day as (HH*3600+MM*60+SS)/86401. If you know that
there was a leap second on that day you can still recover the exact time
wall clock time, otherwise you will be off by up to one second, but the
time is still monotonic and you don't have a sudden jump at the end of
the day.
hp
--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ | -- Sam in "Freefall"
------------------------------
Date: 03 Jul 2007 01:10:03 -0700
From: Paul Rubin <http://phr.cx@NOSPAM.invalid>
Subject: Re: Portable general timestamp format, not 2038-limited
Message-Id: <7xbqethpr8.fsf@ruckus.brouhaha.com>
sla29970@gmail.com writes:
> As for the primacy of UTC vs. TAI, this is the classical chicken and
> egg problem. The bureaucratic reality is opposed to the physical
> reality.
Well, if you're trying to pick just one timestamp standard, I'd say
you're better off using a worldwide one rather than a national one, no
matter how the bureaucracies work. TAI is derived from atomic clocks
all over the world, while the national metrology labs are more subject
to error and desynchronization, and whatever legal primacy they have
is good in only one country.
------------------------------
Date: Tue, 03 Jul 2007 08:57:47 +0000
From: Richard Heathfield <rjh@see.sig.invalid>
Subject: Re: Portable general timestamp format, not 2038-limited
Message-Id: <R6ednTyeKoKXkhfbRVnytAA@bt.com>
Paul Rubin said:
> sla29970@gmail.com writes:
>> As for the primacy of UTC vs. TAI, this is the classical chicken and
>> egg problem. The bureaucratic reality is opposed to the physical
>> reality.
>
> Well, if you're trying to pick just one timestamp standard, I'd say
> you're better off using a worldwide one rather than a national one, no
> matter how the bureaucracies work.
In that case, the obvious choice is Greenwich Mean Time. :-)
Seriously, GMT is recognised all over the world (far more so, in fact,
than UTC, which tends to be recognised only by some well-educated
people, and there are precious few of those), so why not use it?
I always leave my PC's clock set to GMT, partly out of this desire to
support a single timestamp standard, and (it must be said) partly out
of general cussedness.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
------------------------------
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 612
**************************************