[29780] in Perl-Users-Digest
Perl-Users Digest, Issue: 1023 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 11 09:09:48 2007
Date: Sun, 11 Nov 2007 06:09:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 11 Nov 2007 Volume: 11 Number: 1023
Today's topics:
Re: calculate the number of days between two dates <lucavilla@cashette.com>
launch a DOS program from a Perl script? <lucavilla@cashette.com>
Re: launch a DOS program from a Perl script? <jurgenex@hotmail.com>
Re: launch a DOS program from a Perl script? <rkb@i.frys.com>
Re: launch a DOS program from a Perl script? <lucavilla@cashette.com>
new CPAN modules on Sun Nov 11 2007 (Randal Schwartz)
Re: Problem installing IO::Compress::Base <spam.me.all.you.want.123@gmail.com>
Re: Problem installing IO::Compress::Base <sisyphus359@gmail.com>
Re: Set TCP_MAXSEG (OS buffering) on Win32? How? <nospam@somewhere.com>
Re: Sun and moon data program Nov. 8, 2007 <edgrsprj@ix.netcom.com>
Re: Sun and moon data program Nov. 8, 2007 <edgrsprj@ix.netcom.com>
Re: Sun and moon data program Nov. 8, 2007 <edgrsprj@ix.netcom.com>
Re: Sun and moon data program Nov. 8, 2007 <edgrsprj@ix.netcom.com>
Re: Why can't you slice an array @a[3..-1]? <nospam-abuse@ilyaz.org>
Re: Why can't you slice an array @a[3..-1]? <tzz@lifelogs.com>
Re: Why can't you slice an array @a[3..-1]? <tzz@lifelogs.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 11 Nov 2007 03:51:50 -0800
From: Luca Villa <lucavilla@cashette.com>
Subject: Re: calculate the number of days between two dates
Message-Id: <1194781910.031530.284480@50g2000hsm.googlegroups.com>
Thanks J=FCrgen
------------------------------
Date: Sat, 10 Nov 2007 15:30:04 -0800
From: Luca Villa <lucavilla@cashette.com>
Subject: launch a DOS program from a Perl script?
Message-Id: <1194737404.750582.63550@50g2000hsm.googlegroups.com>
Can I launch a DOS program from within a Perl script?
____
This is what I need to do:
I have many files like this:
c:\dir\pippo-red.html
c:\dir\paperino-yellow.html
c:\dir\pluto-red.html
c:\dir\gastone-green.html
I have a HTML2TXT.EXE program that converts files from html to txt
(removing the tags etc...).
The syntax of this program is: "HTML2TXT htmlfilename.htm >
txtfilename.txt"
I want to convert all and only the file which path-name match "c:\dir
\*-red.html". The output files must have the suffix "-text" in the
filename and ".txt" as extension.
In a few words the Perl script in this example must execute the
command two times like this:
HTML2TXT c:\dir\pippo-red.html > c:\dir\pippo-red-text.txt
HTML2TXT c:\dir\pluto-red.html > c:\dir\pluto-red-text.txt
Do you know how can I do this?
Thanks in advance for any help
------------------------------
Date: Sun, 11 Nov 2007 00:43:53 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: launch a DOS program from a Perl script?
Message-Id: <dfsZi.3018$cD.930@trndny08>
Luca Villa wrote:
> Can I launch a DOS program from within a Perl script?
perldoc -f system
perldoc -f qx
jue
------------------------------
Date: Sat, 10 Nov 2007 17:04:31 -0800
From: Ron Bergin <rkb@i.frys.com>
Subject: Re: launch a DOS program from a Perl script?
Message-Id: <1194743071.705509.245460@i38g2000prf.googlegroups.com>
On Nov 10, 3:30 pm, Luca Villa <lucavi...@cashette.com> wrote:
> Can I launch a DOS program from within a Perl script?
>
> ____
>
> This is what I need to do:
>
> I have many files like this:
> c:\dir\pippo-red.html
> c:\dir\paperino-yellow.html
> c:\dir\pluto-red.html
> c:\dir\gastone-green.html
>
> I have a HTML2TXT.EXE program that converts files from html to txt
> (removing the tags etc...).
>
> The syntax of this program is: "HTML2TXT htmlfilename.htm >
> txtfilename.txt"
>
> I want to convert all and only the file which path-name match "c:\dir
> \*-red.html". The output files must have the suffix "-text" in the
> filename and ".txt" as extension.
>
> In a few words the Perl script in this example must execute the
> command two times like this:
> HTML2TXT c:\dir\pippo-red.html > c:\dir\pippo-red-text.txt
> HTML2TXT c:\dir\pluto-red.html > c:\dir\pluto-red-text.txt
>
> Do you know how can I do this?
>
> Thanks in advance for any help
It's proper ediquite to inform people that you've posted this question
in multiple forums and have received the solution.
http://www.experts-exchange.com/Programming/Languages/Scripting/Perl/Q_22952500.html
------------------------------
Date: Sun, 11 Nov 2007 05:10:45 -0800
From: Luca Villa <lucavilla@cashette.com>
Subject: Re: launch a DOS program from a Perl script?
Message-Id: <1194786645.662928.311760@19g2000hsx.googlegroups.com>
This seems to be the solution:
system "HTML2TXT $_ > ".(/(.*)html/)[0]."txt" for <c:/dir/*-red.html>;
but how can I launch it from command-line?
I tried PERL 'system "HTML2TXT $_ > ".(/(.*)html/)[0]."txt" for <c:/
dir/*-red.html>;' without success...
sorry for my incompetence..
------------------------------
Date: Sun, 11 Nov 2007 05:42:17 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sun Nov 11 2007
Message-Id: <JrBuIH.1oCu@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.
Bundle-MARCEL-0.01
http://search.cpan.org/~marcel/Bundle-MARCEL-0.01/
install (nearly) all modules by MARCEL
----
Bundle-MARCEL-Likes-0.01
http://search.cpan.org/~marcel/Bundle-MARCEL-Likes-0.01/
FIXME
----
Carp-Source-0.02
http://search.cpan.org/~marcel/Carp-Source-0.02/
warn of errors with stack backtrace and source context
----
Carp-Source-0.03
http://search.cpan.org/~marcel/Carp-Source-0.03/
warn of errors with stack backtrace and source context
----
Catalyst-Engine-Wx-0.02_04
http://search.cpan.org/~eriam/Catalyst-Engine-Wx-0.02_04/
Catalyst wxPerl Engine
----
Class-Std-Fast-0.0.1
http://search.cpan.org/~acid/Class-Std-Fast-0.0.1/
faster but less secure than Class::Std
----
Class-Std-Fast-0.0.2
http://search.cpan.org/~acid/Class-Std-Fast-0.0.2/
faster but less secure than Class::Std
----
Compress-Raw-Bzip2-2.008
http://search.cpan.org/~pmqs/Compress-Raw-Bzip2-2.008/
Low-Level Interface to bzip2 compression library
----
Compress-Raw-Zlib-2.008
http://search.cpan.org/~pmqs/Compress-Raw-Zlib-2.008/
Low-Level Interface to zlib compression library
----
Compress-Zlib-2.008
http://search.cpan.org/~pmqs/Compress-Zlib-2.008/
Interface to zlib compression library
----
Config-Inetd-0.27
http://search.cpan.org/~schubiger/Config-Inetd-0.27/
Interface inetd's configuration file
----
Data-Visitor-Encode-0.09000
http://search.cpan.org/~dmaki/Data-Visitor-Encode-0.09000/
Encode/Decode Values In A Structure
----
Encode-HanExtra-0.23
http://search.cpan.org/~audreyt/Encode-HanExtra-0.23/
Extra sets of Chinese encodings
----
Getopt-CallingName-1.15
http://search.cpan.org/~srshah/Getopt-CallingName-1.15/
Script duties delegation based upon calling name
----
Glib-1.162
http://search.cpan.org/~tsch/Glib-1.162/
Perl wrappers for the GLib utility and Object libraries
----
Gtk2-1.162
http://search.cpan.org/~tsch/Gtk2-1.162/
Perl interface to the 2.x series of the Gimp Toolkit library
----
Gungho-0.09003_04
http://search.cpan.org/~dmaki/Gungho-0.09003_04/
Yet Another High Performance Web Crawler Framework
----
GunghoX-FollowLinks-0.00001
http://search.cpan.org/~dmaki/GunghoX-FollowLinks-0.00001/
Automatically Follow Links Within Responses
----
HTML-Parser-Stacked-0.00001
http://search.cpan.org/~dmaki/HTML-Parser-Stacked-0.00001/
HTML::Parser With Stacked Handlers
----
HTTP-Cookies-Mozilla-1.12
http://search.cpan.org/~bdfoy/HTTP-Cookies-Mozilla-1.12/
Cookie storage and management for Mozilla
----
HTTP-Cookies-Omniweb-1.11
http://search.cpan.org/~bdfoy/HTTP-Cookies-Omniweb-1.11/
Cookie storage and management for Omniweb
----
HTTP-Cookies-Safari-1.13
http://search.cpan.org/~bdfoy/HTTP-Cookies-Safari-1.13/
Cookie storage and management for Safari
----
HTTP-Parser-0.04
http://search.cpan.org/~dbrobins/HTTP-Parser-0.04/
parse HTTP/1.1 request into HTTP::Request/Response object
----
IO-Compress-Base-2.008
http://search.cpan.org/~pmqs/IO-Compress-Base-2.008/
Base Class for IO::Compress modules
----
IO-Compress-Bzip2-2.008
http://search.cpan.org/~pmqs/IO-Compress-Bzip2-2.008/
Write bzip2 files/buffers
----
IO-Compress-Lzf-2.008
http://search.cpan.org/~pmqs/IO-Compress-Lzf-2.008/
Write lzf files/buffers
----
IO-Compress-Lzop-2.008
http://search.cpan.org/~pmqs/IO-Compress-Lzop-2.008/
Write lzop files/buffers
----
IO-Compress-Zlib-2.008
http://search.cpan.org/~pmqs/IO-Compress-Zlib-2.008/
----
Mail-IMAPClient-2.99_04
http://search.cpan.org/~markov/Mail-IMAPClient-2.99_04/
An IMAP Client API
----
Module-DynamicSubModule-0.01
http://search.cpan.org/~xor/Module-DynamicSubModule-0.01/
Call new modules like calling subroutines!
----
MooseX-LogDispatch-1.0000
http://search.cpan.org/~ash/MooseX-LogDispatch-1.0000/
A Logging Role for Moose
----
POE-Component-CPAN-YACSmoke-1.08
http://search.cpan.org/~bingos/POE-Component-CPAN-YACSmoke-1.08/
Bringing the power of POE to CPAN smoke testing.
----
Parse-Eyapp-1.085
http://search.cpan.org/~casiano/Parse-Eyapp-1.085/
Extensions for Parse::Yapp
----
Parse-Marpa-0.001_039
http://search.cpan.org/~jkegl/Parse-Marpa-0.001_039/
Jay Earley's general parsing algorithm with LR(0) precomputation
----
Win32-Outlook-IAF-0.9
http://search.cpan.org/~pczerkas/Win32-Outlook-IAF-0.9/
Internet Account File (*.iaf) management for Outlook Express/2003.
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: Sun, 11 Nov 2007 00:53:06 GMT
From: Philip Sharman <spam.me.all.you.want.123@gmail.com>
Subject: Re: Problem installing IO::Compress::Base
Message-Id: <spam.me.all.you.want.123-F739F2.17530610112007@shawnews.cg.shawcable.net>
> I would have thought
> that reinstalling Scalar::Util would have been enough to sort this out.
I would have thought so too, but it didn't work for me.
(I'm using RedHat Enterprise Linux 4. I deleted
/usr/lib/perl5/5.8.5/Scalar/ and reinstalled Scalar::Util. I still get
the same error message.)
Any help on this would be greatly appreciated. How can I get an "XS
version"?
Thanks, Philip.
------------------------------
Date: Sat, 10 Nov 2007 23:40:25 -0800
From: sisyphus <sisyphus359@gmail.com>
Subject: Re: Problem installing IO::Compress::Base
Message-Id: <1194766825.961661.241160@k35g2000prh.googlegroups.com>
On Nov 11, 11:53 am, Philip Sharman
<spam.me.all.you.want....@gmail.com> wrote:
>
> Any help on this would be greatly appreciated. How can I get an "XS
> version"?
When Paul mentioned "reinstalling Scalar::Util" he meant that the
reinstallation be done by building from the CPAN source distribution
of Scalar::Util. Is that what you tried ? (Reinstalling an RPM
wouldn't help if the RPM package is not an XS build.)
Even then, building Scalar::Util from source won't give you an XS
build if a C compiler is not found - in which case (I think) you'll be
informed, during the build process, that you're not getting the XS
build.
Cheers,
Rob
------------------------------
Date: Sat, 10 Nov 2007 22:54:20 -0500
From: "Thrill5" <nospam@somewhere.com>
Subject: Re: Set TCP_MAXSEG (OS buffering) on Win32? How?
Message-Id: <0KOdnb-l7blx4avanZ2dnUVZ_jydnZ2d@comcast.com>
"Ed W" <ed@notarealemailaccount.com> wrote in message
news:iMednUXr2rEHDqnaRVnyhAA@pipex.net...
>
>
>> So Socket doesn't know about TCP_MAXSEG.
>
> Googling around some more suggests that it's actually a read only param on
> windows. I was obviously wrong about that being the backdoor to try and
> control the receive window
>
> OK, so to rephrase the question: anyone know how to influence advertised
> receive window on XP+ on the localhost interface? Don't really want to
> change the registry...
>
> Cheers
>
> Ed W
You need to do some research on the TCP protocol. You are confusing many
different things together and it is clear that you have no clue how TCP
works. I don't think you really know what you need to do because if your
app is not behaving as you expect it on localhost, changing buffers or MSS
sizes is not going to fix your problem. Since you haven't described the
problem you are trying to solve, I can only guess that you are having issues
with data written on the socket is not being sent out in a timely fashion.
You are guessing (wrongly) that this is a buffer problem, it is not. If you
are writing to a TCP socket and the data needs to be sent out immediately,
you need to set the TCP_NODELAY option.
------------------------------
Date: Sun, 11 Nov 2007 06:12:47 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Sun and moon data program Nov. 8, 2007
Message-Id: <13jduj1oihulmc5@corp.supernews.com>
Thanks. I checked the programs available at that Web site and a number of
other Web sites. And I did not see anything that would do exactly what is
needed. I am going to try some other locations.
>
> Quite a bit of stuff here, that might be able to be carved into what
> you need:
> http://www.freebsdsoftware.org/astro/
>
> David A. Smith
>
------------------------------
Date: Sun, 11 Nov 2007 06:33:44 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Sun and moon data program Nov. 8, 2007
Message-Id: <13jduj8nocb14cd@corp.supernews.com>
The data and chart generation Perl program (4000 lines of code) that I have
running works quite well. The next major step is to learn how to save the
main program as a .exe file. I have a "Par" module already merged with
Perl. But I have not had a chance to learn how to use it.
The Gif file generation module does generate nice charts. But for some
reason, some of the data displayed on the original chart are not appearing
on the Gif charts. So I have been sending the Perl screen charts to the
clipboard and pasting them to the Windows Paint program which is then used
to produce the Gif files. When time permits I plan to try to determine how
to get the Perl Gif module to copy all of the data to those files.
These are difficult programs for professional programmers to work with
because they involve so much research. Each improvement indicates what
needs to be done next. I never know beforehand exactly what the next
routine to be added is going to be. So it is almost impossible to make
plans for how to structure the main program. Things keep changing. If and
when everything gets settled the main program will probably be duplicated in
a more organized form by more highly skilled programmers. It is fortunate
that Perl is sufficiently versatile that when important changes are needed
they can be made without too much trouble.
>
> step 1) learn Perl
> step 2) write a sun and moon location data generation Perl program
------------------------------
Date: Sun, 11 Nov 2007 06:46:39 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Sun and moon data program Nov. 8, 2007
Message-Id: <13jdujoarssjhdb@corp.supernews.com>
Posted by E.D.G. November 11, 2007
None of the programs I have been able to find on the Web appear to have all
of the features that are needed here. And I am going to explore this
further in some of the astro and astrology newsgroups.
As already mentioned, another researcher and I have written a TrueBasic
program that will do what is needed. But it will have to be thoroughly
tested before it can be used to replace the U.S. Navy's MICA program that is
presently generating the needed data.
My data indicate to me (and more and more international researchers are
agreeing) that sun and moon gravity related effects are quite important to
determining the times when earthquakes occur. Ocean tide and Solid Earth
Tide effects also appear to be important. Considering how much damage
earthquakes can produce, it is amazing to me that our governments and major
research groups have not already made these types of data generation
computer programs available for researchers around the world to use.
These are personal opinions.
"E.D.G." <edgrsprj@ix.netcom.com> wrote in message
news:13j6kh9prckmn13@corp.supernews.com...
> Data needed from the sun and moon location program:
>
> Subsolar location - The latitude and longitude of the position on the
> Earth's surface that the sun is directly above. Any information regarding
> sun location that could be used in calculations to get the subsolar
location
> would do.
>
> Sublunar location - The latitude and longitude of the position on the
> Earth's surface that the moon is directly above. Any information
regarding
> moon location that could be used in calculations to get the sublunar
> location would do.
>
> Distance between the Earth and the sun - It could be the distance between
> their centers or between their surfaces. The centers distance would be
> preferable.
>
> Distance between the Earth and the moon - It could be the distance between
> their centers or between their surfaces. The centers distance would be
> preferable.
>
> Other types of data such as the velocity of the Earth relative to the sun
> and the velocity of the moon relative to the Earth would be helpful but
> not essential.
------------------------------
Date: Sun, 11 Nov 2007 06:48:40 -0600
From: "E.D.G." <edgrsprj@ix.netcom.com>
Subject: Re: Sun and moon data program Nov. 8, 2007
Message-Id: <13jdujr1tp0p5df@corp.supernews.com>
Thanks for the recommendation.
Another researcher/computer programmer and I already have all of the needed
equations. And we have a program running with the TrueBasic language which
does what is needed. I was checking to see if there might be any new
software out there that has already been tested and proven to be totally
reliable.
>
> I suggest you consult the book "Astronomical Algorithms" by Jean Meeus.
>
> http://www.willbell.com/math/mc1.htm
>
> Klazmon.
------------------------------
Date: Sat, 10 Nov 2007 23:18:08 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Why can't you slice an array @a[3..-1]?
Message-Id: <fh5e7g$pbp$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Ted Zlatanov
<tzz@lifelogs.com>], who wrote in article <m2lk96nnsc.fsf@lifelogs.com>:
> IZ> Hint: your proposal breaks the fundamental proportion:
^^^^^^^^^^ progression
> IZ> 5..7 ==> 5 6 7
> IZ> 5..6 ==> 5 6
> IZ> 5..5 ==> 5
> IZ> 5..4 ==> ???
>
> You see .. as a forward vector on the integer number line. I think the
> vector could point down as well:
>
> 5..4 ==> 5 4
As I have shown, this does not allow $n..$n+$count-1 to get $count items.
> 1) in @array[x..y] make the .. operator count down IFF y is negative
> ("subscript context"). As an alternative, make it count down everywhere
> with a pragma, or make it count down in subscript context with a pragma.
I see: you have never used $array[-5..-1] yet...
Hope this helps,
Ilya
------------------------------
Date: Sat, 10 Nov 2007 21:48:09 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Why can't you slice an array @a[3..-1]?
Message-Id: <m2r6ixmohy.fsf@lifelogs.com>
On Sat, 10 Nov 2007 17:16:34 +0100 Michele Dondi <bik.mido@tiscalinet.it> wrote:
MD> On Sat, 10 Nov 2007 09:16:28 -0600, Ted Zlatanov <tzz@lifelogs.com>
MD> wrote:
>> The resulting mess is not DWIM, so consider my arguments crap :)
MD> say "Whoa, at least!"; # just kidding ;)
I love admitting I'm wrong. It means I've learned something or seen
things in a new way.
Ted
------------------------------
Date: Sat, 10 Nov 2007 21:55:58 -0600
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Why can't you slice an array @a[3..-1]?
Message-Id: <m2mytlmo4x.fsf@lifelogs.com>
On Sat, 10 Nov 2007 23:18:08 +0000 (UTC) Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
IZ> I see: you have never used $array[-5..-1] yet...
You're right, I haven't used that one. @array[-5..-1] is pretty useful
though, I've used that :)
Ted
------------------------------
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 1023
***************************************