[27238] in Perl-Users-Digest
Perl-Users Digest, Issue: 9020 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 5 14:05:53 2006
Date: Sun, 5 Mar 2006 11:05:04 -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, 5 Mar 2006 Volume: 10 Number: 9020
Today's topics:
Re: Accessibility of the Higher-Order Perl E-book in Am <vtatila@mail.student.oulu.fi>
Re: Different results parsing a XML file with XML::Simp (Erik Wasser)
Re: Load perl module dynamically (use $object) <thepoet_nospam@arcor.de>
Re: References as Hash Keys, Tree Structures (Newbie) ( <tassilo.von.parseval@rwth-aachen.de>
Re: Upload file format checking <hjp-usenet2@hjp.at>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 5 Mar 2006 13:07:52 +0200
From: "Veli-Pekka Tätilä" <vtatila@mail.student.oulu.fi>
Subject: Re: Accessibility of the Higher-Order Perl E-book in Amazon (Was: Emulating Generators)
Message-Id: <duegqk$ltr$1@news.oulu.fi>
Steven N. Hirsch wrote:
> Veli-Pekka Tätilä wrote:
>> What would be a good way to do an iterator for a sequence of values to be
>> returned, also called a generator, in Perl?
> You will probably find Mark-Jason Dominus' book "Higher Order Perl" of
> interest.
Hey thanks for the tip. I visited the books Web site and it seems to be just
what I need. Especially as I'd like to know more about functional
programming in general, not just in the context of Perl alone. I'm planning
to give lisp a try to see how it's like.
But speaking of the book, has anyone here purchased the electronic version
of Higher-Order Perl via Amazon? URL:
http://tinyurl.com/l7bmj
I'd like to get that one but I'm wondering if the book is screen reader
accessible. Obviously it wouldn't be much help for me if it is not. I've
also got second thoughts on Acrobat due to accessibility issues, and might
like to export the contents to say plain text or OCR them for my own use.
If some of you do have the book but aren't screen reader users, which is
probable, I would really appreciate it if you could test it with a screen
reader. If interested I can give some more instructions and hints off-list,
too. As I'm not a Jaws user, trying the Supernova or HAL demo would give the
highest confidence. You can get a copy at:
http://www.dolphincomputeraccess.com/products/supernova.htm
I do have the latest beta but it should be similar to the latest official
release, as far as PDFs go.
If it turns out that the book is not accessible, another option would be to
wait for the on-line free, Wiki version to appear. The author states on his
Web-site that he is working on it. Too bad he doesn't, as far as I know,
offer the book in any other format in the mean time.
As to what's wrong with Acrobat accessibilitywise, which is a bit OT, I've
posted on this in alt.comp.blind-users lately. You can find the thread in
Google groups by searching for amazon's acrobat e-books. It should be the
first hit on the list as I posted just yesterday.
--
With kind regards Veli-Pekka Tätilä (vtatila@mail.student.oulu.fi)
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/
------------------------------
Date: Sun, 5 Mar 2006 12:49:22 +0100
From: fuzz@uni-paderborn.de (Erik Wasser)
Subject: Re: Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser)
Message-Id: <2rvqd3-bpo.ln1@wasser-7359.user.cis.dfn.de>
robic0 wrote:
> Just a followup, I know your question was with xml, but if you wan't to use
> unicode "outside" the 0-128 bracket fro regex you might want to use the
> codes as in this simple example (which just uses various "ranges"):
My question was: why two XML parsers are getting different results? The
different results are confusing me not unicode itself.
--
So long... Fuzz
------------------------------
Date: Sun, 05 Mar 2006 12:32:32 +0100
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: Load perl module dynamically (use $object)
Message-Id: <440acc4e$0$13780$9b4e6d93@newsread4.arcor-online.net>
Markus Dehmann schrieb:
> Can I load perl modules dynamically?
>
> In other words, I want to do something like this:
>
> my $obj = "Getopt::Long";
> eval{ use $obj } or die($@);
>
> But it doesn't work like that. Is such a dynamic module loading
> possible at all?
It is, and it has been done. But you will have to get rid
of the "use" inside the eval block for it to work. You could
make "use" work inside a string eval, but there are points
against that, like catching typos in the code at compile time.
Just a quick shot:
my $package = "Getopt::Long";
eval {
(my $pkg = $package) =~ s|::|/|g; # require need a path
require "$pkg.pm";
import $package;
};
die $@ if( $@ );
HTH
-Chris
------------------------------
Date: Sun, 5 Mar 2006 09:25:18 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: References as Hash Keys, Tree Structures (Newbie) (Was: simple pointer operations (newbe))
Message-Id: <46vljhFd2inoU1@news.dfncis.de>
Also sprach Abigail:
> Tassilo v. Parseval (tassilo.von.parseval@rwth-aachen.de) wrote on
> MMMMDLXIV September MCMXCIII in <URL:news:46ihi4Fb1mfsU1@news.dfncis.de>:
>:)
>:) Yes, inside-out indeed seems to be Perl-centric. On the other hand, it's
>:) nothing that would have been invented by the Perl folks. They are a
>:) variation on the flyweight-pattern where an object is a very lightweight
>:) entity ($dummy in the above article) and it is used to look up the real
>:) data from some static container outside the caller's scope.
>:)
>:) Besides avoiding typos, they have some other advantages. One is that
>:) subclassing becomes easier and safer as the access to an object's
>:) innards happens exlusively through accessor methods.
>
> That's not quite right. The essence of avoiding name clashes doesn't
> lie in exclusive access through accessor methods, it lies in storing
> attributes in a structure that's bound to the class that uses the
> attributes, and not the object.
>
> Now usually this means you use a lexical hash, and you use one class
> per file, so accessors is the only feasible access. But it doesn't have
> to. If you do something like:
>
> package MyClass;
>
> our %attribute; # Instead of 'my %attribute'.
>
> ...
>
> you can access attributes defined in another class without accessor methods,
> and still enjoy all the benefits InsideOut objects give you. Using 'our'
> instead of 'my' maybe handy if you want to write a serialiser.
>
> Remember, inside-out objects aren't about enforcing encapsulation, it's
> all about preventing *accidental* globbering someone elses internals.
Ah, alright. I have to add that I've never used the inside-out pattern
yet (or at least not consciously) so my conception of it may be a little
foggy and inaccurate. Thanks for the explanation.
Tassilo
--
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);
------------------------------
Date: Sun, 05 Mar 2006 18:11:51 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Upload file format checking
Message-Id: <duf64n$stt$1@hermes.luga.at>
Gunnar Hjalmarsson wrote:
> Bryan wrote:
>> What is the best way to validate that an uploaded file (using CGI.pm) is
>> a tab delimited table of the correct format? I.e. every line has the
>> same number of columns as the header, and the header has to match a
>> predefined set of table headers. Should it be done as the file is read
>> in? After I store it to disk?
>
> I don't understand how you would be able to validate the file before it
> has been stored to disk, at least temporarily.
You (or more exactly, the CGI module) are reading the contents of the file
from stdin. In general, it is certainly possible to validate the contents
as it is being read - it doesn't have to be stored at all. However, CGI
stores the contents in a temporary file, so usually, when you get around to
it, it is already on disk. But from reading the docs, it looks like
upload_hook might be used to change that (I've never used it).
hp
--
This is not a signature
------------------------------
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 V10 Issue 9020
***************************************