[26288] in Perl-Users-Digest
Perl-Users Digest, Issue: 8470 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 29 21:05:30 2005
Date: Thu, 29 Sep 2005 18:05:04 -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 Thu, 29 Sep 2005 Volume: 10 Number: 8470
Today's topics:
Re: How do I install this package using ppm? <1usa@llenroc.ude.invalid>
Re: How do I install this package using ppm? <1usa@llenroc.ude.invalid>
I have problems with download scripts, it's trying to p <atk@sbcglobal.net>
installing modules? <mikee@mikee.ath.cx>
Re: installing modules? (Anno Siegel)
Re: Order of Elements in Hash chris-usenet@roaima.co.uk
Re: Order of Elements in Hash chris-usenet@roaima.co.uk
overload proxy object <eric@afaik.us>
Re: XML Parsing <news@lawshouse.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 29 Sep 2005 18:34:59 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How do I install this package using ppm?
Message-Id: <Xns96E0945A88188asu1cornelledu@127.0.0.1>
Harry Haller <Harry@Steppenwolf.com> wrote in
news:pf3oj1d8u7uf8r0rin9nlqcd7dmjd95irn@4ax.com:
> Initially I was confused by the presence of two libraries:
> C:\Perl\site\lib and C:\Perl\lib\
>
> I was copying it to:
> C:\Perl\site\lib
> instead of:
> C:\Perl\lib
> as you do when having to guess what to do.
Please don't.
The two separate directories exists for a good reason. The latter is for
standard libraries that come with Perl. C:\Perl\site\lib is for extra
modules you install.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Thu, 29 Sep 2005 19:32:32 +0000 (UTC)
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How do I install this package using ppm?
Message-Id: <Xns96E09E1A8510Basu1cornelledu@132.236.56.8>
Zeno = Harry Haller <zeno@lastone.com> wrote in
news:prvnj15noj0m1pvs1ssto1die9qhgpmd3f@4ax.com:
> Apologies
>
> Zeno = Harry Haller
It does not matter what alias you use, so long as the address you enter is
consistent.
So, please choose one of Harry@Steppenwolf.com or zeno@lastone.com, and
kindly stick with it.
Sinan
------------------------------
Date: Thu, 29 Sep 2005 23:28:53 GMT
From: "E Arredondo" <atk@sbcglobal.net>
Subject: I have problems with download scripts, it's trying to print instead of saving the file
Message-Id: <VM__e.1810$rl1.648@newssvr27.news.prodigy.net>
Here's my cgi script :
---------------------------------------
#!/usr/bin/perl -w
use CGI;
$upload_dir = "/upload";
$query = new CGI;
$filename = $query->param("photo");
$claim = $query->param("claim");
$filename =~ s/.*[\/\\](.*)/$1/;
$upload_filehandle = $query->upload("photo");
open UPLOADFILE, ">$upload_dir/$filename";
binmode UPLOADFILE;
while ( <$upload_filehandle> )
{
print UPLOADFILE;
}
close UPLOADFILE;
print $query->header ( );
print <<END_HTML;
<HTML>
<HEAD>
<TITLE>Thanks!</TITLE>
<HEAD>
<TITLE>Thanks!</TITLE>
</HEAD>
<BODY>
<P>Thanks for uploading your photo!</P>
<P>Your Claim: $claim</P>
</BODY>
</HTML>
END_HTML
--------- cut here --------------------------------
And here's the log file :
binmode() on closed filehandle UPLOADFILE at
/usr/lib/apache/cgi-bin/upload.cgi
line 13.
print() on closed filehandle UPLOADFILE at
/usr/lib/apache/cgi-bin/upload.cgi li
ne 16, <fh00001C%3A\Graphics\crank.JPG> line 1.
print() on closed filehandle UPLOADFILE at
/usr/lib/apache/cgi-bin/upload.cgi li
ne 16, <fh00001C%3A\Graphics\crank.JPG> line 2
keeps going........all the way until
print() on closed filehandle UPLOADFILE at
/usr/lib/apache/cgi-bin/upload.cgi li
ne 16, <fh00001C%3A\Graphics\crank.JPG> line 433.
print() on closed filehandle UPLOADFILE at
/usr/lib/apache/cgi-bin/upload.cgi li
ne 16, <fh00001C%3A\Graphics\crank.JPG> line 434.
print() on closed filehandle UPLOADFILE at
/usr/lib/apache/cgi-bin/upload.cgi li
ne 16, <fh00001C%3A\Graphics\crank.JPG> line 435.
UX:lp: ERROR: No default destination.
TO FIX: You must identify which printer should
handle your request by naming it or a
class of printers (-d name) or by naming
a type of printer (-T type).
----------------------- cut here ------------------------------------
I can't find the file, so I'm assuming that it tried it to print , Am I
right ?
I'm running SCO OSR 507 (please don't flame me), and perl version 5.8.6EB
Thanks
------------------------------
Date: Thu, 29 Sep 2005 21:18:52 GMT
From: Mike <mikee@mikee.ath.cx>
Subject: installing modules?
Message-Id: <0TY_e.610$np2.551@fe02.lga>
I'm putting a system together to install PERL modules. I know
some modules prompt the user/installer for values important
to the module. Is there a way to supply these prompts to
the install? Is there any to uninstall?
Mike
------------------------------
Date: 29 Sep 2005 22:58:29 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: installing modules?
Message-Id: <dhhril$t72$1@mamenchi.zrz.TU-Berlin.DE>
Mike <mikee@mikee.ath.cx> wrote in comp.lang.perl.misc:
> I'm putting a system together to install PERL modules. I know
> some modules prompt the user/installer for values important
> to the module. Is there a way to supply these prompts to
> the install? Is there any to uninstall?
See perldoc MakeMaker.
Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
------------------------------
Date: Thu, 29 Sep 2005 20:53:19 +0100
From: chris-usenet@roaima.co.uk
Subject: Re: Order of Elements in Hash
Message-Id: <fatt03-o0s.ln1@news.roaima.co.uk>
chris@roaima.co.uk wrote:
> Perl has never guaranteed any ordering of the hash keys [...]
xhoster@gmail.com wrote:
> It is easy to come up with stupid things by taking documentation out of
> context.
Agreed, it is. But somethings what seems a stupid thing to you and me
might be a source of confusion to a perl newcomer who is genuinely trying
to work through the documentation thoroughly.
> Are you making a game of doing so, or what?
Not particularly. I was merely pointing out that perhaps the OP had also
come across this phrase when asking about the repeatable ordering of
hash keys and values. (Unlikely? Maybe. But certainly possible.)
Cheers,
Chris
------------------------------
Date: Thu, 29 Sep 2005 20:57:48 +0100
From: chris-usenet@roaima.co.uk
Subject: Re: Order of Elements in Hash
Message-Id: <sitt03-o0s.ln1@news.roaima.co.uk>
chris-usenet@roaima.co.uk <chris-usenet@roaima.co.uk> wrote:
> Perl has never guaranteed any ordering of the hash keys [...]
Tad McClellan <tadmc@augustmail.com> wrote:
> And your point is?
That we may have a documentation error? Perl clearly /does/ guarantee
the ordering of the hash keys under well defined circumstances.
Chris
------------------------------
Date: Thu, 29 Sep 2005 15:15:36 -0400
From: Eric Anderson <eric@afaik.us>
Subject: overload proxy object
Message-Id: <1128021380.7a27d7dbf1dcab18d5aac78c13af07a9@teranews>
I have occasional objects that are heavy to instantiate. Because of the
way the application is structured, often these objects won't even be
used (they are available if needed but they may not be needed). So to
reduce the resources of this application I have surrounded these objects
with a proxy object that delays instantiation.
Basically when the object is created you create it like this:
my $curusr = new Class::Delayed(sub {new Data::User($uid)})
Data::User is heavy because it does some database queries to get it's
attributes. But often the code doesn't even use $curusr meaning those
queries were for nothing. Now the proxy object looks like this:
******* BEGIN CLASS **********
package Class::Delayed;
sub new {
my ( $class, $closure ) = @_;
my $self = {};
bless( $self, $class );
$self->{closure} = $closure;
return $self;
}
sub AUTOLOAD {
my ( $self, @args ) = @_;
$AUTOLOAD =~ s/.*:://;
return if !exists($self->{obj}) and $AUTOLOAD eq 'DESTROY';
$self->{obj} = $self->{closure}->() unless exists $self->{obj};
$self->{obj}->$AUTOLOAD(@args);
}
1;
*********** END CLASS **********
As you can see anytime any method is called on the object it will
instantiate the object if it was not already created. It creates the
object by calling the closure that was passed into the proxy object.
This all works real well except when the real object is using overloads.
Many of the objects have "", cmp and <=> overloads (for sorting and
printing) and these no longer work. I am guessing because my overload
methods do not pass through AUTOLOAD.
I think I might be able to use the "nomethod" overload but it looks like
my implementation of nomethod will need to look at the symbol and then
carry out the operation according to each symbol. This seemed like a bit
of work (not too much but a bit) so I think maybe there is a better more
simpler way to just say "all overloads for object X get passed to object
Y". Any ideas?
Eric
------------------------------
Date: Thu, 29 Sep 2005 19:22:13 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: XML Parsing
Message-Id: <1128018117.12584.0@nnrp-t71-03.news.uk.clara.net>
xhoster@gmail.com wrote:
> I'd like to be familiar with the major alternatives to XML::Parser, without
> having to read 3689 different perldoc pages to find those major
> alternatives. So, what are your favorite Perl modules for general-purpose
> XML processing?
And I thought it was just me, being easily confused! For my part I use
XML:Simple occasionally (for config files and straightforward things
like that), but more often XML::Twig.
--
Henry Law <>< Manchester, England
------------------------------
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 8470
***************************************