[25438] in Perl-Users-Digest
Perl-Users Digest, Issue: 7683 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 22 18:05:38 2005
Date: Sat, 22 Jan 2005 15:05:10 -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 Sat, 22 Jan 2005 Volume: 10 Number: 7683
Today's topics:
[perl-python] 20050121 file reading & writing <xah@xahlee.org>
Re: [perl-python] 20050121 file reading & writing <g.tagliarettiNO@SPAMparafernalia.org>
Re: [VERY OT] Seeya all! <bik.mido@tiscalinet.it>
Difference between redirects googleid2003@yahoo.com
Re: Difference between redirects <1usa@llenroc.ude.invalid>
Re: Difference between redirects googleid2003@yahoo.com
FetchURL with GIF files maw246@gmail.com
Re: FetchURL with GIF files <1usa@llenroc.ude.invalid>
Re: FetchURL with GIF files <tadmc@augustmail.com>
Re: FetchURL with GIF files <yyusenet@yahoo.com>
Re: FetchURL with GIF files maw246@gmail.com
Re: newbie perl questions <shawn.corey@sympatico.ca>
Re: newbie perl questions <sbryce@scottbryce.com>
Re: newbie perl questions <toddrw69@excite.com>
Re: Perl on Windows <jrbtech-at@gmail.com>
Re: Perl on Windows <1usa@llenroc.ude.invalid>
Re: Perl on Windows <jurgenex@hotmail.com>
Re: Perl on Windows <flavell@ph.gla.ac.uk>
Re: Perl on Windows <segraves_f13@mindspring.com>
Re: Perl on Windows <webmaster@diggingsonline.com>
Problem installing module <geoff.news.nospam@alphaworks.co.uk>
Re: Problem installing module <noreply@gunnar.cc>
Problem with PPC cross-compile jim_van_donsel@nmss.com
Send mail question <nospam@cdtoday.co.uk>
upgrade perl without reinstalling all modules? <pilsl@goldfisch.at>
Re: upgrade perl without reinstalling all modules? <andy@andyh.co.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 22 Jan 2005 03:57:40 -0800
From: "Xah Lee" <xah@xahlee.org>
Subject: [perl-python] 20050121 file reading & writing
Message-Id: <1106395060.211314.54530@f14g2000cwb.googlegroups.com>
# -*- coding: utf-8 -*-
# Python
# to open a file and write to file
# do
f=open('xfile.txt','w')
# this creates a file "object" and name it f.
# the second argument of open can be
# 'w' for write (overwrite exsiting file)
# 'a' for append (ditto)
# 'r' or read only
# to actually print to file or read from
# file, one uses methods of file
# objects. e.g.
# reading entire file
# text = f.read()
# reading the one line
# line = f.realine()
# reading entire file as a list, of lines
# mylist = f.readlines()
# to write to file, do
f.write('yay, first line!\n')
# when you are done, close the file
f.close()
# closing files saves memory and is
# proper in large programs.
# see
# http://python.org/doc/2.3.4/tut/node9.html
# or in Python terminal,
# type help() then topic FILES
# try to write a program that read in a
# file and print it to a new file.
------------------------
# in perl, similar functionality exists.
# their construct is quite varied.
# example of reading in file
# and print it out
# (first, save this file as x.pl)
open(f,"<x.pl") or die "error: $!";
while ($line = <f>) {print $line}
close(f) or die "error: $!";
print "am printing myself\n";
# the above is a so called "idiom"
# meaning that it is the way such is
# done in a particular language, as in
# English.
# note, the f really should be F in Perl
# by some references, but can also be
# lower case f or even "f". All are not
# uncommon. There is no clear reason for
# why or what should be or what
# is the difference. Usually it's
# not worthwhile to question in
# Perl. ">x.pl" would be for write to
# file. The <f> tells perl the file
# object, and when Perl sees t=<> it
# reads a line. (usually, but technically
# depending on some predefined
# variables...) The f they call "file handle".
# ... see
# perldoc -tf open
# to begin understanding.
------------
Note: this post is from the Perl-Python a-day mailing list at
http://groups.yahoo.com/group/perl-python/
to subscribe, send an email to perl-python-subscribe@yahoogroups.com
if you are reading it on a web page, program examples may not run
because html conversion often breaks the code.
Xah
xah@xahlee.org
http://xahlee.org/PageTwo_dir/more.html
------------------------------
Date: Sat, 22 Jan 2005 14:04:19 +0100
From: Gian Mario Tagliaretti <g.tagliarettiNO@SPAMparafernalia.org>
Subject: Re: [perl-python] 20050121 file reading & writing
Message-Id: <35f1akF4n2t5mU1@individual.net>
Xah Lee wrote:
> # the second argument of open can be
> # 'w' for write (overwrite exsiting file)
> # 'a' for append (ditto)
> # 'r' or read only
are you sure you didn't forget something?
> # reading the one line
> # line = f.realine()
wrong
> [...]
Maybe you didn't get the fact the you won't see a flame starting between
python people and perl friends?
throw yourself somewhere and... Xah.flush()
--
Gian Mario Tagliaretti
PyGTK GUI programming
http://www.parafernalia.org/pygtk/
------------------------------
Date: Sat, 22 Jan 2005 23:31:08 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: [VERY OT] Seeya all!
Message-Id: <7hn4v0pni8d19f6g1j3qtoeumse30511ip@4ax.com>
On Fri, 21 Jan 2005 22:56:24 -0500, "Matt Garrish"
<matthew.garrish@sympatico.ca> wrote:
>I think you just scored a perfect 10 on the melodrama scale...
:-)
or should that be
:'-(
?
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: 22 Jan 2005 12:16:25 -0800
From: googleid2003@yahoo.com
Subject: Difference between redirects
Message-Id: <1106424985.003262.168740@c13g2000cwb.googlegroups.com>
I know nothing about perl, so a friend of mine wrote a cgi script for
me to do a redirect on my website based on user input from a html form
using a variable $userName. The piece of code that does this:
print "Content-type:text/html\n\n";
print "<html><head><meta http-equiv=\"refresh\"
content=\"0;url=$path$userName\"></head><body></body>\n";
What's the pros/cons, if any, or difference between this and the
following:
print "Location: http://www.somesite.com/directory/$userName\n\n";
They seem to do the same thing, and I wonder which is "better".
Thanks,
Mike
------------------------------
Date: 22 Jan 2005 20:28:13 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Difference between redirects
Message-Id: <Xns95E69D670B309asu1cornelledu@132.236.56.8>
googleid2003@yahoo.com wrote in news:1106424985.003262.168740
@c13g2000cwb.googlegroups.com:
> I know nothing about perl, so a friend of mine wrote a cgi script for
> me to do a redirect on my website based on user input from a html form
> using a variable $userName. The piece of code that does this:
>
> print "Content-type:text/html\n\n";
> print "<html><head><meta http-equiv=\"refresh\"
> content=\"0;url=$path$userName\"></head><body></body>\n";
>
> What's the pros/cons, if any, or difference between this and the
> following:
>
> print "Location: http://www.somesite.com/directory/$userName\n\n";
This is not a Perl question. It is a CGI question. As such, it is off-
topic here. You'll better off posting it to a CGI group such as
comp.infosystems.www.authoring.cgi
See also http://cgi-spec.golux.com/cgi-120-00a.html#8.0
Sinan.
------------------------------
Date: 22 Jan 2005 12:47:01 -0800
From: googleid2003@yahoo.com
Subject: Re: Difference between redirects
Message-Id: <1106426821.929137.7290@f14g2000cwb.googlegroups.com>
Sorry about that. Thanks for the info.
A. Sinan Unur wrote:
> googleid2003@yahoo.com wrote in news:1106424985.003262.168740
> @c13g2000cwb.googlegroups.com:
>
> > I know nothing about perl, so a friend of mine wrote a cgi script
for
> > me to do a redirect on my website based on user input from a html
form
> > using a variable $userName. The piece of code that does this:
> >
> > print "Content-type:text/html\n\n";
> > print "<html><head><meta http-equiv=\"refresh\"
> > content=\"0;url=$path$userName\"></head><body></body>\n";
> >
> > What's the pros/cons, if any, or difference between this and the
> > following:
> >
> > print "Location: http://www.somesite.com/directory/$userName\n\n";
>
> This is not a Perl question. It is a CGI question. As such, it is
off-
> topic here. You'll better off posting it to a CGI group such as
> comp.infosystems.www.authoring.cgi
>
> See also http://cgi-spec.golux.com/cgi-120-00a.html#8.0
>
> Sinan.
------------------------------
Date: 22 Jan 2005 12:01:27 -0800
From: maw246@gmail.com
Subject: FetchURL with GIF files
Message-Id: <1106424087.175858.122960@f14g2000cwb.googlegroups.com>
I'm fairly new to Perl, so I hope this doesn't seem like a stupid
question.
I'm trying to download an image using a Perl script, because I want to
be able to automate the image download process. My code looks like
this:
#-----------------------
use Win32::Internet;
$inet = new Win32::Internet();
$myfile =
$inet->FetchURL("http://image.weather.com/web/common/wxicons/31/30.gif");
open (OUTP, ">30.gif");
print OUTP $myfile;
#-----------------------
It seems very simple, right? And when I use this to download a text
file or html file, it works just fine. However, when I use this same
code to download other file types-- such as the GIF file in this code
example, ZIP files, or PDFs-- the associated viewing applications see
the files as corrupt and won't open them. Yet when I download the GIF
via internet explorer and file compare it against what I downloaded in
perl, no differences are found . . . but there's a slight difference in
file size.
Can anyone tell me what I'm doing wrong? If so, please offer a
specific solution, because as I wrote above, I'm a bit of a newbie.
--Thanks
------------------------------
Date: 22 Jan 2005 20:37:15 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: FetchURL with GIF files
Message-Id: <Xns95E69EEF247A3asu1cornelledu@132.236.56.8>
maw246@gmail.com wrote in news:1106424087.175858.122960
@f14g2000cwb.googlegroups.com:
> I'm trying to download an image using a Perl script, because I want to
> be able to automate the image download process. My code looks like
> this:
> #-----------------------
use strict;
use warnings;
> use Win32::Internet;
> $inet = new Win32::Internet();
>
> $myfile =
> $inet->FetchURL
("http://image.weather.com/web/common/wxicons/31/30.gif");
> open (OUTP, ">30.gif");
You should always, yes always, check if open succeeded.
open my $out, '>', '30.gif' or die "Cannot open 30.gif: $!";
> print OUTP $myfile;
perldoc -f binmode
You are better off using LWP rather than Win32 specific functionality:
use LWP::Simple;
getstore('http://image.weather.com/web/common/wxicons/31/30.gif');
or, from the command line:
C:\> perl -MLWP::Simple -e getstore q
{http://image.weather.com/web/common/wxicons/31/30.gif}
(This command should be entered as a single line).
> Can anyone tell me what I'm doing wrong? If so, please offer a
> specific solution, because as I wrote above, I'm a bit of a newbie.
You should take this opportunity to go over the posting guidelines for
this group.
Sinan.
------------------------------
Date: Sat, 22 Jan 2005 15:12:44 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: FetchURL with GIF files
Message-Id: <slrncv5gec.6dh.tadmc@magna.augustmail.com>
maw246@gmail.com <maw246@gmail.com> wrote:
> I'm trying to download an image using a Perl script,
> Can anyone tell me what I'm doing wrong?
Treating a binary file as if it was a text file, on a OS
where that makes a difference.
> If so, please offer a
> specific solution,
perldoc -q binary
How do I handle binary data correctly?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 22 Jan 2005 14:34:34 -0700
From: YYusenet <yyusenet@yahoo.com>
Subject: Re: FetchURL with GIF files
Message-Id: <csugta$v37$1@news.xmission.com>
maw246@gmail.com wrote:
> I'm fairly new to Perl, so I hope this doesn't seem like a stupid
> question.
>
> I'm trying to download an image using a Perl script, because I want to
> be able to automate the image download process. My code looks like
> this:
> #-----------------------
> use Win32::Internet;
> $inet = new Win32::Internet();
>
> $myfile =
> $inet->FetchURL("http://image.weather.com/web/common/wxicons/31/30.gif");
> open (OUTP, ">30.gif");
> print OUTP $myfile;
> #-----------------------
> It seems very simple, right? And when I use this to download a text
> file or html file, it works just fine. However, when I use this same
> code to download other file types-- such as the GIF file in this code
> example, ZIP files, or PDFs-- the associated viewing applications see
> the files as corrupt and won't open them. Yet when I download the GIF
> via internet explorer and file compare it against what I downloaded in
> perl, no differences are found . . . but there's a slight difference in
> file size.
>
> Can anyone tell me what I'm doing wrong? If so, please offer a
> specific solution, because as I wrote above, I'm a bit of a newbie.
> --Thanks
>
The problem that you are having is that you are no treating the file
like a binary file. To do that, use binmode(FILE).
EX:
------------------------------------------------
#!perl
use warnings;
use strict;
use LWP::Simple;
my $file = get('http://image.weather.com/web/common/wxicons/31/30.gif');
open OUTFILE, '>', '30.gif' or die "Unable to open output file! $!";
binmode(OUTFILE);
print(OUTFILE $file);
------------------------------------------------
However, this code can be simplified to one line:
------------------------------------------------
#!perl
use warnings;
use strict;
use LWP::Simple;
getstore('http://image.weather.com/web/common/wxicons/31/30.gif','30.gif');
------------------------------------------------
Hope this helps,
kgabert _* at *_ xmission (dot) com
------------------------------
Date: 22 Jan 2005 13:53:40 -0800
From: maw246@gmail.com
Subject: Re: FetchURL with GIF files
Message-Id: <1106430820.461430.313820@f14g2000cwb.googlegroups.com>
All,
Thanks for your input. I got it to work quite well with the
LWP::Simple::getstore() effort.
> I'm fairly new to Perl, so I hope this doesn't seem like a stupid
> question.
>
> I'm trying to download an image using a Perl script, because I want
to
> be able to automate the image download process. My code looks like
> this:
> #-----------------------
> use Win32::Internet;
> $inet = new Win32::Internet();
>
> $myfile =
>
$inet->FetchURL("http://image.weather.com/web/common/wxicons/31/30.gif");
> open (OUTP, ">30.gif");
> print OUTP $myfile;
> #-----------------------
> It seems very simple, right? And when I use this to download a text
> file or html file, it works just fine. However, when I use this same
> code to download other file types-- such as the GIF file in this code
> example, ZIP files, or PDFs-- the associated viewing applications see
> the files as corrupt and won't open them. Yet when I download the
GIF
> via internet explorer and file compare it against what I downloaded
in
> perl, no differences are found . . . but there's a slight difference
in
> file size.
>
> Can anyone tell me what I'm doing wrong? If so, please offer a
> specific solution, because as I wrote above, I'm a bit of a newbie.
> --Thanks
------------------------------
Date: Sat, 22 Jan 2005 08:57:23 -0500
From: Shawn Corey <shawn.corey@sympatico.ca>
Subject: Re: newbie perl questions
Message-Id: <2XsId.49079$K03.1308874@news20.bellglobal.com>
chrispatton@gmail.com wrote:
> Hello, everyone.
>
> Is there a way to use the Perl interpereter interactivwely? As in, I
> type a command
> and the interpereter gives me the same responce it would give me in a
> regular running program.
>
> Is anyone familiar with the Python statement "exec"? Is there and
> equivelant to this in Perl? I tried this statement in Perl, and the OS
> executed the string passed to it. (awsome!)
>
> Thanks!
>
UNIX: perl -ple '$_=eval'
DOS: perl-ple "$_=eval"
Type 'exit' to quit.
--- Shawn
------------------------------
Date: Sat, 22 Jan 2005 07:36:56 -0700
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: newbie perl questions
Message-Id: <DbadnfEnWOVs-W_cRVn-1w@comcast.com>
chrispatton@gmail.com wrote:
> Is anyone familiar with the Python statement "exec"? Is there and
> equivelant to this in Perl? I tried this statement in Perl, and the OS
> executed the string passed to it. (awsome!)
If you tried it, and it worked, it must exist. I don't know whether it
does the same thing that exec does in Python. You can find out here:
http://www.perldoc.com/perl5.8.4/pod/func/exec.html
------------------------------
Date: Sat, 22 Jan 2005 15:28:49 GMT
From: "Todd W" <toddrw69@excite.com>
Subject: Re: newbie perl questions
Message-Id: <RiuId.8614$BR6.5895@newssvr31.news.prodigy.com>
<chrispatton@gmail.com> wrote in message
news:1106375505.017246.161130@z14g2000cwz.googlegroups.com...
> Hello, everyone.
>
> Is there a way to use the Perl interpereter interactivwely? As in, I
> type a command
> and the interpereter gives me the same responce it would give me in a
> regular running program.
I use the perl debugger like so: "$ perl -de 1"
[trwww@waveright trwww]$ perl -de 1
Loading DB routines from perl5db.pl version 1.19
Editor support available.
Enter h or `h h' for help, or `man perldebug' for more help.
main::(-e:1): 1
DB<1> print 1+1, "\n"
2
DB<2>Ctrl-D
[trwww@waveright trwww]$
> Is anyone familiar with the Python statement "exec"? Is there and
> equivelant to this in Perl? I tried this statement in Perl, and the OS
> executed the string passed to it. (awsome!)
I write portable perl programs, so I avoid system and exec calls at all
costs. Theres probably a module that will let you do what you want portably.
see http://search.cpan.org/
Todd W.
------------------------------
Date: Sat, 22 Jan 2005 08:30:09 -0500
From: "JRBTech" <jrbtech-at@gmail.com>
Subject: Re: Perl on Windows
Message-Id: <W-WdnUkXep_KyG_cRVn-pQ@adelphia.com>
Bah.
Go here, its free and works very well. I wrote a review on it for you today.
I think many people will ask the same question.....Active Perl isnt free.
http://www.jrbtech.com/index.php/codecenter/2005/01/22/indigoperl_run_perl_on_windows_for_free
--
JRB Technology
http://www.jrbtech.com
"Adam Smith" <adamsmith@econ.com> wrote in message
news:8cudnR-XYvkdx2zcRVn-gA@speakeasy.net...
> Hello,
>
> Could anyone advise on HOW TO set up and run Perl scripts on windows, and
> is it possible to run them as "standalones" without a server / browser
>
> Thanks
>
> -- Adam --
------------------------------
Date: 22 Jan 2005 13:46:55 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Perl on Windows
Message-Id: <Xns95E6595CF32C4asu1cornelledu@132.236.56.8>
"JRBTech" <jrbtech-at@gmail.com> wrote in
news:W-WdnUkXep_KyG_cRVn-pQ@adelphia.com:
[ You top-posted and put the text of the message below the signature
separator. Good newsreaders get rid of anything below the signature
separator when replying. Please do not top post and format your
replies properly. ]
> "Adam Smith" <adamsmith@econ.com> wrote in message
> news:8cudnR-XYvkdx2zcRVn-gA@speakeasy.net...
>> Hello,
>>
>> Could anyone advise on HOW TO set up and run Perl scripts on windows,
>> and is it possible to run them as "standalones" without a server /
>> browser
> Bah.
Bah what?
> Go here, its free and works very well. I wrote a review on it for you
> today. I think many people will ask the same question
Then they will be better served by going to
http://www.cpan.org/ports/#win32
> ... Active Perl isnt free.
Hmmm ... From <http://www.activestate.com/Products/ActivePerl/?_x=1>:
ActivePerl is ActiveState's quality-assured, ready-to-install
distribution of Perl, available for Linux, Solaris, and Windows.
As part of ActiveState's support for Perl, we provide the
ActivePerl distribution free to the community.
People may prefer one binary distribution over another. Nothing wrong
with that.
> http://www.jrbtech.com/index.php/codecenter/2005/01/22/indigoperl_run_
perl_on_windows_for_free
Not worth the paper it is printed on. There is absolutely no information
on the advantages of IndigoPerl relative to other binary distributions.
Sinan
------------------------------
Date: Sat, 22 Jan 2005 14:56:17 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Perl on Windows
Message-Id: <lQtId.11246$ef6.4615@trnddc07>
[Don't top post]
[Don't full quote]
JRBTech wrote:
> [...] Active Perl isnt free.
What gave you that idea? It most certainly is free.
jue
------------------------------
Date: Sat, 22 Jan 2005 14:55:59 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Perl on Windows
Message-Id: <Pine.LNX.4.61.0501221433500.7304@ppepc56.ph.gla.ac.uk>
On Sat, 22 Jan 2005, JRBTech blurted out, without the
customary courtesy of citation and context:
> Bah.
Indeed. Posting, without further comment, to a newsgroup
(comp.lang.perl) which was officially phased-out years ago, does not
bode well for the accuracy of anything else you might have to say to
the hon Usenauts.
> Go here,
To recommend Indigoperl, wouldn't it be better to refer to here?
- http://www.indigostar.com/indigoperl.htm
> its free and works very well. I wrote a review on it for you today.
What's wrong with usenet? It looks as if you don't know how to use
it yet.
> I think many people will ask the same question.....
What same question?
> Active Perl isnt free.
- From the ActivePerl license:
| You may use this Package for commercial or non-commercial purposes
| without charge.
- From the Indigoperl license:
| You may use IndigoPerl for commercial or non-commercial purposes
| without charge.
Would you care to take us through the differences which you perceive
in their respective licenses?
>... /index.php/codecenter/2005/01/22/indigoperl_run_perl_on_windows_for_free
Come off it. It looks as if you're trying to promote a specific
discussion forum, not really to help anyone with their choice of Perl
distributions. That cited URL can be summarised as "we installed it
on one laptop and it works". Well, so it does, but you could safely
have said that here too.
Both are respectable and useful distributions. Of course there's also
Cygwin Perl ;-)
The benefits of IndigoPerl, particularly for a beginner who has web
usage in mind, are in areas which you haven't even mentioned - being
bundled with Apache, mod_perl etc. But I don't see anything wrong
with the other options.
[ f'ups set ]
------------------------------
Date: Sat, 22 Jan 2005 18:08:25 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: Perl on Windows
Message-Id: <tEwId.3961$cZ1.2122@newsread2.news.atl.earthlink.net>
"Adam Smith" <adamsmith@econ.com> wrote in message
news:8cudnR-XYvkdx2zcRVn-gA@speakeasy.net...
> Could anyone advise on HOW TO set up and run Perl scripts on windows,
One way, already mentioned: IndigoPerl, available free from
www.indigostar.com.
> and is it possible to run them as "standalones" without a server /
browser?
Yes.
--
Bill Segraves
------------------------------
Date: Sat, 22 Jan 2005 07:06:44 GMT
From: Kendall K. Down <webmaster@diggingsonline.com>
Subject: Re: Perl on Windows
Message-Id: <c6a91f314d.diggings@diggingsonline.com>
In message <8cudnR-XYvkdx2zcRVn-gA@speakeasy.net>
Adam Smith <adamsmith@econ.com> wrote:
> Could anyone advise on HOW TO set up and run Perl scripts on windows,
> and is it possible to run them as "standalones" without a server / browser
I'm very much a newbie to Perl and I've found Optiperl is fine - a slight
fiddle to set up, but it appears to work well. I got it off a magazine cover
CD, it may be available for free download somewhere.
Ken Down
--
================ ARCHAEOLOGICAL DIGGINGS ===============
| Australia's premiere archaeological magazine |
| http://www.diggingsonline.com |
========================================================
------------------------------
Date: Sat, 22 Jan 2005 15:12:46 -0000
From: "Geoff Soper" <geoff.news.nospam@alphaworks.co.uk>
Subject: Problem installing module
Message-Id: <41f26e26$0$22072$cc9e4d1f@news.dial.pipex.com>
I'm trying to install Digest::SHA1 in my userspace on my web hosting
account. I'm not familiar with the process but think I have followed the
instructions properly i.e.:
perl Makefile.PL PREFIX=/home/alphaworks/perl_modules
make
make test
make install
But then when trying to use this module I get
Can't locate Digest/SHA1.pm in @INC (@INC contains:
/home/alphaworks/perl_modules ...
The precise output from the terminal during installation and a check to see
what was addedis shown below. I would have expected
/home/alphaworks/perl_modules/Digest/SHA1.pm to exist though.
Can anyone see what is going wrong here?
Thanks,
Geoff
*******************************************************************
bash-2.05a$ perl Makefile.PL PREFIX=/home/alphaworks/perl_modules/
Checking if your kit is complete...
Looks good
Writing Makefile for Digest::SHA1
bash-2.05a$ make
cp SHA1.pm blib/lib/Digest/SHA1.pm
/usr/bin/perl -I/usr/lib/perl5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1
/usr/lib/perl5/5.6.1/ExtUtils/xsubpp -typemap
/usr/lib/perl5/5.6.1/ExtUtils/typemap -typemap typemap SHA1.xs > SHA1.xsc &&
mv SHA1.xsc SHA1.c
gcc -c -fno-strict-aliasing -I/usr/local/include -O2 -march=i386 -mcpu=i686
-DVERSION=\"2.10\" -DXS_VERSION=\"2.10\" -fPIC -I/usr/lib/perl5/5.6.1/i386-linux/CORE
SHA1.c
Running Mkbootstrap for Digest::SHA1 ()
chmod 644 SHA1.bs
rm -f blib/arch/auto/Digest/SHA1/SHA1.so
LD_RUN_PATH="" gcc -shared -L/usr/local/lib SHA1.o -o
blib/arch/auto/Digest/SHA1/SHA1.so
chmod 755 blib/arch/auto/Digest/SHA1/SHA1.so
cp SHA1.bs blib/arch/auto/Digest/SHA1/SHA1.bs
chmod 644 blib/arch/auto/Digest/SHA1/SHA1.bs
Manifying blib/man3/Digest::SHA1.3pm
bash-2.05a$ make test
PERL_DL_NONLAZY=1
/usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/lib/perl5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1
-e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
t/*.t
t/badfile....ok
t/bits.......ok
t/sha1.......ok
All tests successful.
Files=3, Tests=17, 0 wallclock secs ( 0.05 cusr + 0.04 csys = 0.09 CPU)
bash-2.05a$ make install
Installing
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux/auto/Digest/SHA1/SHA1.so
Installing
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux/auto/Digest/SHA1/SHA1.bs
Files found in blib/arch: installing files in blib/lib into architecture
dependent library tree
Installing
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux/Digest/SHA1.pm
Installing /home/alphaworks/perl_modules/share/man/man3/Digest::SHA1.3pm
Writing
/home/alphaworks/perl_modules//lib/perl5/site_perl/5.6.1/i386-linux/auto/Digest/SHA1/.packlist
/bin/sh: /perllocal.pod: Permission denied
make: [doc_site_install] Error 1 (ignored)
Appending installation info to
/home/alphaworks/perl_modules//lib/5.6.1/i386-linux/perllocal.pod
bash-2.05a$ cat
/home/alphaworks/perl_modules//lib/5.6.1/i386-linux/perllocal.pod
cat: /home/alphaworks/perl_modules//lib/5.6.1/i386-linux/perllocal.pod: No
such file or directory
bash-2.05a$ ls -lR /home/alphaworks/perl_modules/
/home/alphaworks/perl_modules/:
total 8
drwxr-xr-x 3 alphawor alphawor 4096 Jan 22 12:23 lib
drwxr-xr-x 3 alphawor alphawor 4096 Jan 22 12:23 share
/home/alphaworks/perl_modules/lib:
total 4
drwxr-xr-x 3 alphawor alphawor 4096 Jan 22 12:23 perl5
/home/alphaworks/perl_modules/lib/perl5:
total 4
drwxr-xr-x 3 alphawor alphawor 4096 Jan 22 12:23 site_perl
/home/alphaworks/perl_modules/lib/perl5/site_perl:
total 4
drwxr-xr-x 3 alphawor alphawor 4096 Jan 22 12:23 5.6.1
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1:
total 4
drwxr-xr-x 4 alphawor alphawor 4096 Jan 22 12:23 i386-linux
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux:
total 8
drwxr-xr-x 3 alphawor alphawor 4096 Jan 22 12:23 auto
drwxr-xr-x 2 alphawor alphawor 4096 Jan 22 12:23 Digest
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux/auto:
total 4
drwxr-xr-x 3 alphawor alphawor 4096 Jan 22 12:23 Digest
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux/auto/Digest:
total 4
drwxr-xr-x 2 alphawor alphawor 4096 Jan 22 12:23 SHA1
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux/auto/Digest/SHA1:
total 20
-r--r--r-- 1 alphawor alphawor 0 Jan 22 12:22 SHA1.bs
-r-xr-xr-x 1 alphawor alphawor 19498 Jan 22 12:22 SHA1.so
/home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux/Digest:
total 8
-r--r--r-- 1 alphawor alphawor 6823 Apr 5 2004 SHA1.pm
/home/alphaworks/perl_modules/share:
total 4
drwxr-xr-x 3 alphawor alphawor 4096 Jan 22 12:23 man
/home/alphaworks/perl_modules/share/man:
total 4
drwxr-xr-x 2 alphawor alphawor 4096 Jan 22 12:23 man3
/home/alphaworks/perl_modules/share/man/man3:
total 12
-r--r--r-- 1 alphawor alphawor 11546 Jan 22 12:22 Digest::SHA1.3pm
------------------------------
Date: Sat, 22 Jan 2005 18:39:23 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Problem installing module
Message-Id: <35fiirF4l4higU1@individual.net>
Geoff Soper wrote:
> I'm trying to install Digest::SHA1 in my userspace on my web hosting
> account. I'm not familiar with the process but think I have followed the
> instructions properly i.e.:
>
> perl Makefile.PL PREFIX=/home/alphaworks/perl_modules
> make
> make test
> make install
>
> But then when trying to use this module I get
> Can't locate Digest/SHA1.pm in @INC (@INC contains:
> /home/alphaworks/perl_modules ...
>
> The precise output from the terminal during installation and a check to see
> what was addedis shown below. I would have expected
> /home/alphaworks/perl_modules/Digest/SHA1.pm to exist though.
<snip>
> /home/alphaworks/perl_modules/lib/perl5/site_perl/5.6.1/i386-linux/Digest/SHA1.pm
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 22 Jan 2005 14:11:11 -0800
From: jim_van_donsel@nmss.com
Subject: Problem with PPC cross-compile
Message-Id: <1106431871.710714.69970@f14g2000cwb.googlegroups.com>
I'm doing a port of Perl 5.8.6 to PPC big-endian (QNX 6.3), cross
compiled on Linux x86. It seems to more or less work except for some
strange things. For example:
$x = 4;
$y = 5;
$z = $y - $x;
print "Interpolated z=$z\n";
print "Non-interpolated z=",$z,"\n";
print "Subtract as part of print: $y-$x=",$y-$x,"\n";
Results in:
Interpolated z=1
Non-interpolated z=1
Subtract as part of print: 5-4=1209256328
I'm assuming it's a config problem, but all my config values look OK to
me. I'm hoping someone with some knowledge of Perl internals can hazard
a guess as to what is wrong.
thanks,
Schrodycat
------------------------------
Date: Sat, 22 Jan 2005 23:01:51 GMT
From: "Antony" <nospam@cdtoday.co.uk>
Subject: Send mail question
Message-Id: <zXAId.2028$wD4.1145@newsfe1-win.ntli.net>
Hi,
I found this perl script on a website regarding sending emails.
#!/usr/bin/perl
use CGI;
my $query = new CGI;
my $sendmail = "/usr/sbin/sendmail -t";
my $reply_to = "Reply-to: foo@bar.org";
my $subject = "Subject: Confirmation of your submission";
my $content = "Thanks for your submission.";
my $to = my@email.co.uk;
runmeail {
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $reply_to;
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $content;
close(SENDMAIL);
}
print $query->header;
print "Confirmation of your submission will be emailed to you.";
However when I go and run the script from the browser, I don't recieve any
emails. Is this because the script must be posted too, or have I simply
missed something out? My aim is to incorporate it into a larger script which
processes an email automatically, however this part is obviously not
working.
thanks
Antony
www.cdtoday.co.uk
------------------------------
Date: Sat, 22 Jan 2005 15:20:01 +0100
From: peter pilsl <pilsl@goldfisch.at>
Subject: upgrade perl without reinstalling all modules?
Message-Id: <41f26164$3@e-post.inode.at>
I'm sorry if this is a FAQ. I searched the docs and did not find any
satisfying answer.
When upgrading my perl, is it possible to upgrade without need to remake
all my thousends selfinstalled modules that depend on each other and
will take me a day to find and reinstall.
I've asked myself this question very often (every time I wanted to upgrade)
In my actual case I only want to upgrade from 5.8.5 to 5.8.6 to get some
of the utf8-bugfixes. Is it possible just to set a symlink from
perl5/site_perl/5.8.5 to perl5/site_perl/5.8.6 ?
As far as I understand under perl/site_perl/VERSION are all the
user-installed modules and under perl/VERSION are all the core-modules
that comes with perl itself.
What can happen on such a minor upgrade (5.8.6 is only a bugfix to
5.8.5)? What about major upgrades (from 5.6.x to 5.8.x) ?
I dont ask about upgrade from 5.x to 6.x, cause this will be a bigger
project then, needing a lot of brain-upgrade as well :)
Any short tips and deep-insight-explanations are highly appretiated,
thnx,
peter
--
http://www2.goldfisch.at/know_list
------------------------------
Date: Sat, 22 Jan 2005 18:20:43 +0000
From: Andy Hassall <andy@andyh.co.uk>
Subject: Re: upgrade perl without reinstalling all modules?
Message-Id: <u465v01qk9re9rj20koo96egkvcs1km0ej@4ax.com>
On Sat, 22 Jan 2005 15:20:01 +0100, peter pilsl <pilsl@goldfisch.at> wrote:
>When upgrading my perl, is it possible to upgrade without need to remake
>all my thousends selfinstalled modules that depend on each other and
>will take me a day to find and reinstall.
>
>I've asked myself this question very often (every time I wanted to upgrade)
>
>In my actual case I only want to upgrade from 5.8.5 to 5.8.6 to get some
>of the utf8-bugfixes. Is it possible just to set a symlink from
>perl5/site_perl/5.8.5 to perl5/site_perl/5.8.6 ?
>
>As far as I understand under perl/site_perl/VERSION are all the
>user-installed modules and under perl/VERSION are all the core-modules
>that comes with perl itself.
>
>What can happen on such a minor upgrade (5.8.6 is only a bugfix to
>5.8.5)? What about major upgrades (from 5.6.x to 5.8.x) ?
>I dont ask about upgrade from 5.x to 6.x, cause this will be a bigger
>project then, needing a lot of brain-upgrade as well :)
>
>Any short tips and deep-insight-explanations are highly appretiated,
Here's the end of my perl -V :
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Dec 4 2004 01:59:15
@INC:
/usr/lib/perl5/5.8.6/i586-linux
/usr/lib/perl5/5.8.6
/usr/lib/perl5/site_perl/5.8.6/i586-linux
/usr/lib/perl5/site_perl/5.8.6
/usr/lib/perl5/site_perl/5.8.5/i586-linux
/usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl
.
I upgraded this from 5.8.5 - Configure picked up the library paths from the
previous version, and compiled them into this one - so I didn't have to
reinstall any of the 5.8.5 modules or mess around with symlinks.
If you go over a binary incompatibility boundary (i.e. a major version, or I
recall there was one in the early 5.8 versions) then you're likely to have to
recompile any non-pure-Perl modules.
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
------------------------------
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 7683
***************************************