[30470] in Perl-Users-Digest
Perl-Users Digest, Issue: 1713 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 12 03:09:46 2008
Date: Sat, 12 Jul 2008 00:09:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 12 Jul 2008 Volume: 11 Number: 1713
Today's topics:
Could someone give me suggestions with my code? <clarjon1@null.wikimedia.gmail.invalid.com>
Re: Could someone give me suggestions with my code? <spamtrap@dot-app.org>
Re: Could someone give me suggestions with my code? <mjcarman@mchsi.com>
Re: Could someone give me suggestions with my code? <uri@stemsystems.com>
Re: empty first element after split <someone@example.com>
Re: FAQ 1.1 What is Perl? <bill@ts1000.us>
Re: FAQ 1.12 What's the difference between "perl" and " <m@rtij.nl.invlalid>
Re: FAQ 1.12 What's the difference between "perl" and " <allergic-to-spam@no-spam-allowed.org>
Re: How to get Perl CGI working on Mac OS 10.5? (Randal L. Schwartz)
new CPAN modules on Sat Jul 12 2008 (Randal Schwartz)
Re: Pugs versus Perl 6 on Parrot <hjp-usenet2@hjp.at>
reliability problem with Finance::QuoteHist::Yahoo <r.ted.byers@rogers.com>
Re: unix guy needs win32 API help <ivowel@gmail.com>
Re: Value of "Programming perl" 1st Ed.? <hjp-usenet2@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 11 Jul 2008 23:43:55 +0000 (UTC)
From: Jonathan Clark <clarjon1@null.wikimedia.gmail.invalid.com>
Subject: Could someone give me suggestions with my code?
Message-Id: <g58r7q$oqp$1@registered.motzarella.org>
Hello, all.
I'm re-learning perl (again), and have put myself into a while loop which
i've just broken out of ( while $problemSolved != 1 {thinkOfSolution
();trySolution();} ), I'd like to post my code, complete with example
data, for you to look over, and give some suggestions on how to improve
my style.
Most of the hard stuff was figuring out the regexps I needed for this
task. It's essentially a two-rexexp solution at the moment, but was
wondering if it could be done.
I've created this with the help of perlfaq, other perldocs, Beginning
Perl, and reading this newsgroup. I did some copy-pasting from the
perldoc IIRC, for the 'framework' of the program.
Oh, yes, the purpose of this program is to strip headers from newsgroup
messages so that I can feed the files to my megahal bot later :)
------- headerstrip.pl --------
#!/usr/bin/perl
use warnings;
use strict;
undef $/; #read that this allows the whole file to be read in, rather
than as lines or paragraphs.
my $file = "@ARGV"; #Get the filename passed from the command line
open my $in, '<', $file or die "Can't read old file: $!";
open my $out, '>', "$file.new" or die "Can't write new file: $!";
#Standard file openings, opens the original for reading, and the new file
#(with .new extension added) to be changed...
while( <$in> )
{
s/^Path(.*?)^Xref//gsm; #clears out most of the headers,
from the Path line to the end of the word Xref, where Xref starts on it's
own line
s/^: news.*\n//; #removes the rest of that Xref line
print $out $_; #writes file
}
close $out; #And, close the file handle
--------- EOF ------------
\
Now, I'd like to be able to pass multiple files to it, and I can tell
from my limited knowledge of perl that a) it isn't gonna work yet, and b)
I'll probably have to stick my $file [...] close $out; into a while loop,
most likely with @ARGV (or a 'copy' of it) as the iterator... Or would
that be a for loop? hmm... :)
I'll leave you Perl gurus to pointing out my mistakes, and await your
suggestions :)
--
Clarjon1
Bingo, gas station, hamburger with a side order of airplane noise,
and you'll be Gary, Indiana. - Jessie in the movie "Greaser's Palace"
------------------------------
Date: Fri, 11 Jul 2008 21:05:33 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Could someone give me suggestions with my code?
Message-Id: <m17ibr9ajm.fsf@dot-app.org>
Jonathan Clark <clarjon1@null.wikimedia.gmail.invalid.com> writes:
> Oh, yes, the purpose of this program is to strip headers from newsgroup
> messages so that I can feed the files to my megahal bot later :)
So essentially what you want to do is delete everything up to the
first blank line, then print the rest? Sounds like a job for the range
operator (.. or ...). In scalar context it evaluates to false for as
long as its first operand is false, after which it evaluates to true
until its second operand is true, then back to false, and so on.
The -n switch adds an implicit "while(<>) { ... }" around your code,
and -i specifies in-place editing with an optional backup of the
original file. So this is a one-liner:
perl -n -i.bak -e 'print() if (/^\n$/ .. eof(ARGV))' ..filenames..
See "perldoc perlop" for details about the range operator, and
"perldoc perlrun" for the command-line switches.
sherm--
--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Sat, 12 Jul 2008 01:42:29 GMT
From: Michael Carman <mjcarman@mchsi.com>
Subject: Re: Could someone give me suggestions with my code?
Message-Id: <9_Tdk.194437$TT4.1819@attbi_s22>
Jonathan Clark wrote:
> #!/usr/bin/perl
> use warnings;
> use strict;
So far, so good. :D
> undef $/; #read that this allows the whole file to be read in, rather
> than as lines or paragraphs.
Slurping is okay for small files but doesn't scale. It should be fine
for newsgroup postings.
> my $file = "@ARGV"; #Get the filename passed from the command line
If the user specifies multiple arguments this will concatenate them. You
only want one argument.
my $file = shift @ARGV;
You might want to throw an error if the user doesn't specify a file at
all. For example:
die "Usage: $0 <file>\n";
> open my $in, '<', $file or die "Can't read old file: $!";
> open my $out, '>', "$file.new" or die "Can't write new file: $!";
Good x 3. You're using three-arg open(), checking its return value, and
including the error in any message.
> while( <$in> )
Since you're slurping the file you don't need a loop at all.
$_ = <$in>;
> {
> s/^Path(.*?)^Xref//gsm; #clears out most of the headers,
> from the Path line to the end of the word Xref, where Xref starts on it's
> own line
I suspect the /g isn't necessary there as it appears you're trying to
remove all the headers in a single pass.
Since you aren't using $1 and don't need any grouping you can get rid of
the parentheses.
s/^Path.*?^Xref//sm;
> s/^: news.*\n//; #removes the rest of that Xref line
> print $out $_; #writes file
I think you can merge the two regular expressions into one.
[Note: untested]
s/^Path.*?^Xref:[^\n]*\n/sm;
Are you trying to delete *all* message headers? What if there's
something after Xref?
I'd process the file (without undef'ing $/) this way:
while (<$in>) {
next if /^[\w-]+:/ .. /^(?![\w-]+:)/; # skip header lines
print $out $_; # print first line of message
print $out <$in>; # print rest of file
}
> }
>
> close $out; #And, close the file handle
This isn't strictly necessary, although I prefer to explicitly close
handles. Be consistent though. Either close both $in and $out or neither.
> Now, I'd like to be able to pass multiple files to it, and I can tell
> from my limited knowledge of perl that a) it isn't gonna work yet, and b)
> I'll probably have to stick my $file [...] close $out; into a while loop,
> most likely with @ARGV (or a 'copy' of it) as the iterator... Or would
> that be a for loop? hmm... :)
You need a loop. The idiomatic loop for perl is a "foreach" loop.
foreach my $file (@ARGV) {
next unless -f $file; # skip missing or non-text files
# (open files)
# (process file)
}
-mjc
------------------------------
Date: Sat, 12 Jul 2008 02:49:32 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Could someone give me suggestions with my code?
Message-Id: <x77ibrbyv6.fsf@mail.sysarch.com>
>>>>> "MC" == Michael Carman <mjcarman@mchsi.com> writes:
MC> Jonathan Clark wrote:
>> #!/usr/bin/perl
>> use warnings;
>> use strict;
MC> So far, so good. :D
>> undef $/; #read that this allows the whole file to be read in,
>> rather than as lines or paragraphs.
MC> Slurping is okay for small files but doesn't scale. It should be fine
MC> for newsgroup postings.
the definition of small files has grown considerably. it used to mean
<1k and today 1mb can be condsidered small. most common text files
(sources, *ML, docs, configs, etc.) are easily slurped. and slurping if
done right is faster. of course doing it right means using
File::Slurp. it is cleaner code than undefing $/ and it is faster too.
MC> die "Usage: $0 <file>\n";
>> open my $in, '<', $file or die "Can't read old file: $!";
>> open my $out, '>', "$file.new" or die "Can't write new file: $!";
MC> Good x 3. You're using three-arg open(), checking its return value,
MC> and including the error in any message.
a good extra is to put the file name in the (improved) error string.
open my $in, '<', $file or die "Can't open $file: $!";
open my $out, '>', "$file.new" or die "Can't create $file.new: $!";
MC> Since you're slurping the file you don't need a loop at all.
MC> $_ = <$in>;
use File::Slurp ;
# no need to call open and <>. also no need to touch $/
my $post = read_file( $file ) ;
MC> Are you trying to delete *all* message headers? What if there's
MC> something after Xref?
then delete up to the first blank line (2 newlines or crlf
pairs). someone else commented on this already
MC> I'd process the file (without undef'ing $/) this way:
MC> while (<$in>) {
MC> next if /^[\w-]+:/ .. /^(?![\w-]+:)/; # skip header lines
what about continuation header lines?
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Fri, 11 Jul 2008 19:40:26 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: empty first element after split
Message-Id: <KGOdk.71165$Jx.44402@pd7urf1no>
Dave B wrote:
> "Heiko Ei=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=
=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=
=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=
=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=BF=BD=EF=
=BF=BD=EF=BF=BD=EF=BF=BD" wrote:
>=20
>> The delimiter is ^([^:]+):\s* which matches a:. Everything
>> before the : is captured, so you get=20
>> undef, a, b, c, d, e, f
>=20
> I think the first field is the empty string, rather than undef (but I m=
ay be
> wrong).
No, you are correct.
John
--=20
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall
------------------------------
Date: Fri, 11 Jul 2008 12:59:39 -0700 (PDT)
From: Bill H <bill@ts1000.us>
Subject: Re: FAQ 1.1 What is Perl?
Message-Id: <cea2add7-7842-4104-aeb7-adf27856c2ac@l42g2000hsc.googlegroups.com>
On Jul 11, 3:03=A0pm, PerlFAQ Server <br...@stonehenge.com> wrote:
> This is an excerpt from the latest version perlfaq1.pod, which
> comes with the standard Perl distribution. These postings aim to
> reduce the number of repeated questions as well as allow the community
> to review and update the answers. The latest version of the complete
> perlfaq is athttp://faq.perl.org.
>
> --------------------------------------------------------------------
>
> 1.1: What is Perl?
>
> =A0 =A0 Perl is a high-level programming language with an eclectic herita=
ge
> =A0 =A0 written by Larry Wall and a cast of thousands. It derives from th=
e
> =A0 =A0 ubiquitous C programming language and to a lesser extent from sed=
, awk,
> =A0 =A0 the Unix shell, and at least a dozen other tools and languages. P=
erl's
> =A0 =A0 process, file, and text manipulation facilities make it particula=
rly
> =A0 =A0 well-suited for tasks involving quick prototyping, system utiliti=
es,
> =A0 =A0 software tools, system management tasks, database access, graphic=
al
> =A0 =A0 programming, networking, and world wide web programming. These st=
rengths
> =A0 =A0 make it especially popular with system administrators and CGI scr=
ipt
> =A0 =A0 authors, but mathematicians, geneticists, journalists, and even m=
anagers
> =A0 =A0 also use Perl. Maybe you should, too.
>
> --------------------------------------------------------------------
>
> The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
> are not necessarily experts in every domain where Perl might show up,
> so please include as much information as possible and relevant in any
> corrections. The perlfaq-workers also don't have access to every
> operating system or platform, so please include relevant details for
> corrections to examples that do not work on particular platforms.
> Working code is greatly appreciated.
>
> If you'd like to help maintain the perlfaq, see the details in
> perlfaq.pod.
Is the FAQ server talking to itself here?
Bill H
------------------------------
Date: Fri, 11 Jul 2008 22:34:59 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <pan.2008.07.11.20.34.58@rtij.nl.invlalid>
On Fri, 11 Jul 2008 10:31:51 -0700, Gordon Corbin Etly wrote:
> Glenn Jackman wrote:
>> At 2008-07-10 02:52PM, "Gordon Corbin Etly" wrote:
>> > Then please read the article for yourself:
>
>> > < http://tinyurl.com/6joyuz >
>> > " Perl not only stands for the Practical Extraction and Report "
>> > Language, but it also stands for the Pathologically Eclectic "
>> > Rubbish Lister.
>> >
>> > These are Larry Walls own words.
>
>> Here are some more:
>>
>> http://www.linuxjournal.com/article/3394
>>
>> Eventually I came up with the name "pearl", with the gloss Practical
>> Extraction and Report Language. The "a" was still in the name when I
>> made that one up. But I heard rumors of some obscure graphics
>> language named "pearl", so I shortened it to "perl". (The "a" had
>> already disappeared by the time I gave Perl its alternate gloss,
>> Pathologically Eclectic Rubbish Lister.) ...
>> we realized about the time of Perl 4 that it was useful to
>> distinguish between "perl" the program and "Perl" the language.
>
> How does this negate the validity of "Practical Extraction and Report
> Language" (or even the alternate phrase?) It seems to me that he has
> given a two expansions in two separate articles. Whether it's a "gloss"
> or "not only stands for", or some such, it's a meaning the Larry Wall
> himself gave, and as such, there is nothing wrong with writing that in a
> shortened form. No one, I repeat, NO ONE has given any real reason that
> makes this truly invalid. What you and others keep doing is throwing out
> the same tired excuses of why you don't like it, or trying to pull
> technicalities based on the insignificant wording of a quotation, and
> ignoring what he actually said. Twice. Two separate columns. How many
> more are needed?
Are you really that thick, or are you pretending to be?
YOU are quoting Larry out of context. When someone gives that context,
you completely ignore it.
M4
------------------------------
Date: Sat, 12 Jul 2008 03:49:16 +0200 (CEST)
From: Jim Cochrane <allergic-to-spam@no-spam-allowed.org>
Subject: Re: FAQ 1.12 What's the difference between "perl" and "Perl"?
Message-Id: <slrng7g3bl.djb.allergic-to-spam@no-spam-allowed.org>
On 2008-07-11, Gordon Corbin Etly <semysig@gmail.com> wrote:
> Glenn Jackman wrote:
>> At 2008-07-10 02:52PM, "Gordon Corbin Etly" wrote:
>> > Then please read the article for yourself:
>
>> > < http://tinyurl.com/6joyuz >
>> > " Perl not only stands for the Practical Extraction and Report
>> > " Language, but it also stands for the Pathologically Eclectic
>> > " Rubbish Lister.
>> >
>> > These are Larry Walls own words.
>
>> Here are some more:
>>
>> http://www.linuxjournal.com/article/3394
>>
>> Eventually I came up with the name "pearl", with the gloss
>> Practical Extraction and Report Language. The "a" was still in the
>> name when I made that one up. But I heard rumors of some obscure
>> graphics language named "pearl", so I shortened it to "perl". (The
>> "a" had already disappeared by the time I gave Perl its alternate
>> gloss, Pathologically Eclectic Rubbish Lister.)
>> ...
>> we realized about the time of Perl 4 that it was useful to
>> distinguish between "perl" the program and "Perl" the language.
I thought you wore yourself out on this topic a month or more ago - but
.... no.
Time to add your name to the kill file.
--
------------------------------
Date: Fri, 11 Jul 2008 14:38:41 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: "szr" <szr@szroman.com>
Subject: Re: How to get Perl CGI working on Mac OS 10.5?
Message-Id: <86skugrti6.fsf@blue.stonehenge.com>
>>>>> "szr" == szr <szr@szroman.com> writes:
szr> <side question>
szr> I never understood why that news group wasn't created up the 'comp.*'
szr> hierarchy and why it was made under 'alt.*', was there any particular
szr> reason for this?
szr> </side question>
Not sure what that alt. group is doing there, but
comp.infosystems.www.servers.unix has always been the apache group to me.
--
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: Sat, 12 Jul 2008 04:42:20 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat Jul 12 2008
Message-Id: <K3vMEK.2188@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-ManekiNeko-0.03
http://search.cpan.org/~gmccar/Acme-ManekiNeko-0.03/
----
App-Env-0.12
http://search.cpan.org/~djerius/App-Env-0.12/
manage application specific environments
----
App-Env-0.13
http://search.cpan.org/~djerius/App-Env-0.13/
manage application specific environments
----
App-XML-DocBook-Builder-0.01
http://search.cpan.org/~shlomif/App-XML-DocBook-Builder-0.01/
Build DocBook/XML files.
----
Audio-M4P-0.50
http://search.cpan.org/~billh/Audio-M4P-0.50/
Perl QuickTime / MP4 / iTunes Music Store audio / video file tools
----
Business-CardInfo-0.01
http://search.cpan.org/~wreis/Business-CardInfo-0.01/
Get/Validate data from credit & debit cards
----
CGI-AutoForm-1.02
http://search.cpan.org/~rsandberg/CGI-AutoForm-1.02/
Automated abstraction of HTML forms from a data source
----
CGI-CRUD-1.05
http://search.cpan.org/~rsandberg/CGI-CRUD-1.05/
Instant CRUD web front-end, featuring auto-discovery of the data dictionary for an RDBMS source
----
DBIx-Array-0.04
http://search.cpan.org/~mrdvt/DBIx-Array-0.04/
This modules is a wrapper around DBI with array interfaces
----
DBIx-IO-1.06
http://search.cpan.org/~rsandberg/DBIx-IO-1.06/
Abstraction layer for database I/O with auto-discovery of data dictionary.
----
Devel-FindRef-1.3
http://search.cpan.org/~mlehmann/Devel-FindRef-1.3/
where is that reference to my variable hiding?
----
Devel-NYTProf-1.90_4
http://search.cpan.org/~timb/Devel-NYTProf-1.90_4/
Powerful feature-rich perl source code profiler
----
Devel-PPPort-3.14_01
http://search.cpan.org/~mhx/Devel-PPPort-3.14_01/
Perl/Pollution/Portability
----
Emacs-PDE-0.2.16
http://search.cpan.org/~yewenbin/Emacs-PDE-0.2.16/
Perl Development Environment in emacs
----
Graphics-Color-0.04
http://search.cpan.org/~gphat/Graphics-Color-0.04/
Device and library agnostic color spaces.
----
Gtk2-Ex-TickerView-6
http://search.cpan.org/~kryde/Gtk2-Ex-TickerView-6/
scrolling ticker display widget
----
HTML-TurboForm-0.21
http://search.cpan.org/~camelcase/HTML-TurboForm-0.21/
----
IPC-PerlSSH-0.08
http://search.cpan.org/~pevans/IPC-PerlSSH-0.08/
a class for executing remote perl code over an SSH link
----
Layout-Manager-0.02
http://search.cpan.org/~gphat/Layout-Manager-0.02/
2D Layout Management
----
Layout-Manager-0.03
http://search.cpan.org/~gphat/Layout-Manager-0.03/
2D Layout Management
----
Lingua-DE-Tagger-0.16
http://search.cpan.org/~tschulz/Lingua-DE-Tagger-0.16/
Part-of-speech tagger for German natural language processing.
----
Lingua-JA-FindDates-0.005
http://search.cpan.org/~bkb/Lingua-JA-FindDates-0.005/
find Japanese dates & convert them
----
Mail-QmailRemoteXS-1.3
http://search.cpan.org/~rsandberg/Mail-QmailRemoteXS-1.3/
Lightweight (XS) SMTP send function based on Qmail's qmail-remote
----
MooseX-Types-DateTime-0.03
http://search.cpan.org/~nuffin/MooseX-Types-DateTime-0.03/
DateTime related constraints and coercions for Moose
----
Nagios-Plugin-SNMP-1.0
http://search.cpan.org/~maxschube/Nagios-Plugin-SNMP-1.0/
Helper module to make writing SNMP-based plugins for Nagios easier.
----
Net-LDAP-Class-0.03
http://search.cpan.org/~karman/Net-LDAP-Class-0.03/
object-relational mapper for Net::LDAP
----
Object-InsideOut-3.44
http://search.cpan.org/~jdhedden/Object-InsideOut-3.44/
Comprehensive inside-out object support module
----
Object-InsideOut-3.45
http://search.cpan.org/~jdhedden/Object-InsideOut-3.45/
Comprehensive inside-out object support module
----
Object-eBay-0.3.1
http://search.cpan.org/~mndrix/Object-eBay-0.3.1/
Object-oriented interface to the eBay API
----
OpenResty-0.3.13
http://search.cpan.org/~agent/OpenResty-0.3.13/
General-purpose web service platform for web applications
----
Oracle-CAPI-1.03
http://search.cpan.org/~rsandberg/Oracle-CAPI-1.03/
Perl XS wrapper extension for the Oracle Collaboration Suite CAPI SDK
----
POE-Stage-0.04
http://search.cpan.org/~rcaputo/POE-Stage-0.04/
a base class for message-driven objects
----
Perl-Tags-0.25
http://search.cpan.org/~osfameron/Perl-Tags-0.25/
Generate (possibly exuberant) Ctags style tags for Perl sourcecode
----
Pod-Server-1.03
http://search.cpan.org/~beppu/Pod-Server-1.03/
a web server for locally installed perl documentation
----
QualysGuard-Request-0.01
http://search.cpan.org/~pdevlin/QualysGuard-Request-0.01/
Simple interface to QualysGuard API
----
RDF-Simple-Serialiser-Notation3-1.011
http://search.cpan.org/~mthurn/RDF-Simple-Serialiser-Notation3-1.011/
Output RDF triples in Notation3 format
----
Run-Env-0.03
http://search.cpan.org/~jkutej/Run-Env-0.03/
running environment detection
----
Text-LooseCSV-1.6
http://search.cpan.org/~rsandberg/Text-LooseCSV-1.6/
Highly forgiving variable length record text parser; compare to MS Excel
----
Text-Markdown-1.0.20
http://search.cpan.org/~bobtfish/Text-Markdown-1.0.20/
Convert Markdown syntax to (X)HTML
----
WWW-ActiveState-PPM-0.01
http://search.cpan.org/~adamk/WWW-ActiveState-PPM-0.01/
Scrape build status from the ActiveState build farm
----
XUL-App-0.07
http://search.cpan.org/~agent/XUL-App-0.07/
Nifty XUL apps in a XUL::App
----
threads-shared-1.24
http://search.cpan.org/~jdhedden/threads-shared-1.24/
Perl extension for sharing data structures between threads
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: Sat, 12 Jul 2008 08:38:35 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Pugs versus Perl 6 on Parrot
Message-Id: <slrng7gkbe.u9c.hjp-usenet2@hrunkner.hjp.at>
On 2008-07-09 03:20, ++imanshu <himanshu.garg@gmail.com> wrote:
> Is it correct that there are two parallel(competing?) lines of
> development for Perl6.
I think there are more than two.
> One on Parrot and the other in Pugs?
AFAIK development of Pugs has been abandoned.
Rakudo (based on Parrot) is currently the implementation most likely to
become usable some day.
hp
------------------------------
Date: Fri, 11 Jul 2008 21:53:53 -0700 (PDT)
From: Ted <r.ted.byers@rogers.com>
Subject: reliability problem with Finance::QuoteHist::Yahoo
Message-Id: <481621fe-ac67-4345-b90a-6f11bae8851e@f36g2000hsa.googlegroups.com>
I have been able to get this package to work sometimes. However,
invariably it fails on me part way through my script, after
downloading data for from one to four ticker symbols. The error is:
Can't use an undefined value as an ARRAY reference at C:/Perl/site/lib/
Finance/QuoteHist/Generic.pm line 863.
I have no information about how an undefined value is being passed
deep into the code of a package I didn't write. I took a quick look
into Generic.pm and yahoo.pm, but found no enlightenment so far
(there's a lot of code there).
Sometimes it arises when quotes() is executed, and at other times, it
occurs when dividends() is executed.
The script I am using is appended below. There isn't anything special
about it. Much of it I copied from example code in the documentation
provided for the two finance packages I'm trying. About all I did was
merge two example scripts, and attempt to get the historical quote
data for one symbol at a time. So far, I have historical quote data
for four stocks. There are over 7000 that I need to retrieve:
obviously not something that is manageable manually downloading each
individually.
Neither Finance::QuoteHist::Generic nor Finance::QuoteHist::Yahoo
(which is derived from the former) say anything about error handling,
or provide a way to test whether or not data was successfully
downloaded.
Any assistance would be greatly appreciated.
Thanks
Ted
use Finance::TickerSymbols;
use Finance::QuoteHist::Yahoo;
use IO::File;
#my $fh1 = new IO::File "> values.csv";
#my $fh2 = new IO::File "> splits.csv";
#my $fh3 = new IO::File "> dividends.csv";
my $fname1;
my $fname2;
my $fname3;
for my $industry ( industries_list()) {
print "\n\n$industry\n";
mkdir "$industry";
for my $symbol ( industry_list( $industry ) ) {
print "$symbol\n\n";
mkdir "$industry\\$symbol";
$fname1 = "$industry\\$symbol\\values.csv";
$fname2 = "$industry\\$symbol\\splits.csv";
$fname3 = "$industry\\$symbol\\dividends.csv";
$fh1 = new IO::File "> $fname1";
$fh2 = new IO::File "> $fname2";
$fh3 = new IO::File "> $fname3";
$q = new Finance::QuoteHist::Yahoo
(
symbols => "$symbol",
start_date => '01/01/1998',
end_date => 'today'
);
# Values
foreach $row ($q->quotes()) {
if (defined $row ) {
($symbol, $date, $open, $high, $low, $close, $volume) = @$row;
print $fh1 "$symbol, $date, $open, $high, $low, $close, $volume
\n";
} else {
print "No data for $symbol\n";
next;
}
}
$fh1->close();
foreach $row ($q->splits()) {
if (defined $row ) {
($symbol, $date, $post, $pre) = @$row;
print $fh2 "$symbol, $date, $post, $pre\n";
} else {
print "No splits data for $symbol\n";
next;
}
}
$fh2->close();
foreach $row ($q->dividends()) {
if (defined $row ) {
($symbol, $date, $dividend) = @$row;
print $fh3 "$symbol, $date, $dividend\n";
} else {
print "No dividend data for $symbol\n";
next;
}
}
$fh3->close();
}
}
------------------------------
Date: Fri, 11 Jul 2008 21:18:18 -0700 (PDT)
From: ivowel <ivowel@gmail.com>
Subject: Re: unix guy needs win32 API help
Message-Id: <ed9f55ec-c49d-4b18-a8af-14f75acc044f@i76g2000hsf.googlegroups.com>
On Jul 8, 8:24 am, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth Ben Bullock <benkasminbull...@gmail.com>:
>
>
>
> > On Mon, 07 Jul 2008 18:55:16 -0700,ivowelwrote:
>
> > > * in the file explorer, right-click on a file [whose name my perl
> > > program provides] and select a particular program to invoke on this
> > > file. For example, this could be "Send To -> Compressed (zipped)
> > > Folder" or "Send to Mail Recipient". In my specific case, I want to
> > > right-click a file to "Abby Finereader -> Convert into ..." or
> > > "OmniPage 16 -> Convert to PDF". Fortunately, there is nothing else
> > > that these invoked programs require as subsequent input.
>
> > > Then I want to wait until the invoked program is completed and
> > > exits. This is it.
>
> > As Martijn Lievaart mentioned, this isn't a Perl problem. Altering the
> > behaviour of the right-click menu in "Explorer" is to do with the Windows
> > registry.
>
> I believe (but ICBW) that this is not what the OP is asking. I think he
> is trying to *invoke* an existing right-click option on a given file.
> For ordinary options (those in the first section of the menu, and those
> in Send To) this is easy: just incoke the appropriate command with the
> appropriate options. For those provided by dlls, this is much harder,
> and I'm afraid I don't know of any easy way to do it. I would advise
> checking the documentation of your OCR programs to be sure they don't
> provide some sort of command-line interface.
>
> Ben
>
> --
> All persons, living or dead, are entirely coincidental.
> b...@morrow.me.uk Kurt Vonnegut
Exactly. I really want to write a sub in Perl that does exactly the
same as right-clicking by hand would achieve. Yes, these menu options
are provided by programs. (I used "Send to" as an illustration,
because everyone has seen what it is.)
In some sense, all that I need is something like
my $process = $somefilename->rightclick("OmniPage 16", "Convert to
Pdf"); # do the same thing as a hand-rightclick first on OmniPage16
and then its submenu Convert to pdf"
wait($process); # wait until it completes
That's it. Does anyone know?
/iaw
------------------------------
Date: Sat, 12 Jul 2008 08:25:17 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Value of "Programming perl" 1st Ed.?
Message-Id: <slrng7gjid.u9c.hjp-usenet2@hrunkner.hjp.at>
On 2008-07-11 17:33, Charlton Wilbur <cwilbur@chromatico.net> wrote:
>>>>>> "S" == Skyler <fuuri-sky@shaw.ca> writes:
>
> >>>>>>> "S" == Skyler <skyler@shaw.ca> writes:
>
> Would you be so kind as to keep your From address consistent, so that
> when I plonk you, you stay plonked?
I'm sure gnus supports regular expressions.
hp
------------------------------
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 1713
***************************************