[24461] in Perl-Users-Digest
Perl-Users Digest, Issue: 6644 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 2 11:10:50 2004
Date: Wed, 2 Jun 2004 08:10:12 -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 Wed, 2 Jun 2004 Volume: 10 Number: 6644
Today's topics:
Re: LWP::UserAgent problem - 500 error <matthew.garrish@sympatico.ca>
Re: Newbie question: PERL proxies... <scobloke2@infotop.co.uk>
Re: Perl Installation on Darwin (Jim Keenan)
Why does IO::Pipe::END generate an EXCEPT pipe message? lvirden@gmail.com
Re: Why does IO::Pipe::END generate an EXCEPT pipe mess <usenet@morrow.me.uk>
Re: Why is this upload script not working (Mark Constant)
Re: Why is this upload script not working <ittyspam@yahoo.com>
Re: Why is this upload script not working <usenet@morrow.me.uk>
Re: Why is this upload script not working <noreply@gunnar.cc>
WinXP : Terminating on signal SIGALRM(14) <david@tvis.co.uk>
Re: WinXP : Terminating on signal SIGALRM(14) <usenet@morrow.me.uk>
Re: WinXP : Terminating on signal SIGALRM(14) <david@tvis.co.uk>
Re: YAPC::2004 <tadmc@augustmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 2 Jun 2004 09:39:12 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: LWP::UserAgent problem - 500 error
Message-Id: <4Mkvc.22195$Hn.798871@news20.bellglobal.com>
"RP" <izco@hotmail.com> wrote in message
news:9e7779b4.0406012228.13463a1b@posting.google.com...
> "Matt Garrish" <matthew.garrish@sympatico.ca> wrote in message
news:<St8vc.94346$tb4.3725677@news20.bellglobal.com>...
> > "RP" <izco@hotmail.com> wrote in message
> > news:9e7779b4.0406011336.4d82b45@posting.google.com...
> > > Hi, I'm trying to get the data off of a number of different pages, and
> > > I'm getting an error:
> > >
> > > 500 Can't connect to www.yahoo.com:80 (connect: Permission denied)
> > >
> > > My code is very simple, I'm just trying to get this to work:
> > >
> >
> > Did you try running it from the command line on your computer? Would
have
> > proven it's not a problem in the code and saved you some of the
headache.
> >
> > The usual guess is that you have to go through a proxy, but you'll have
to
> > ask your host why you can't connect out.
> >
> > Matt
>
> Yes, I tried running it from the command line, and I still receive the
> 500 error. I'll contact my web host and see why I can't connect out -
> do you have any idea why that might be? I looked at the Proxy
> attributes for LWP::UserAgent, and they are a little confusing.
> Thanks for your help - I'll post what I find from my host.
I get the yahoo page when I run it. Your host has either configured their
server not to allow any outbound requests, or as I said in my previous post,
they have a proxy you should be going through. No one here can help you with
that, though. If you have a problem running your script once you have the
details of how to connect out, you can always try back then.
Matt
------------------------------
Date: Wed, 2 Jun 2004 14:36:00 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Newbie question: PERL proxies...
Message-Id: <c9koke$piu$1@titan.btinternet.com>
Juha Laiho wrote:
> mike@enovative-solutions.net (mrmike) said:
>
>>I am in the design stages of developing a website that will allow a
>>user to log into my site, the site internally would log into a third
>>party site [...]
Looks like a proxy to me.
>>The problem is that I want to more or less spoof the user's IP address
>>and send it along to the third party server rather than use my own.
I wonder why?
> For the first, you can't hide your own IP -- because anyway it'll be
> your IP that will be connecting to the third site, and you need to
> have the return packets routed through your site.
>
> Also, there's a reason that the IP primarily is retrieved from the
> connection data (which you cannot alter if you wish to see the
> return packets).
>
> If you can agree with the third-party site(s) in question, you can
> of course build some scheme of your own to transmit the end-user
> IP addresses (but this of course requires that the admins of the
> third-party site(s) trust you). One such scheme would be to agree
> upon a specific X-... header that your site inserts to the requests
> and the backend sites inspect and honor _if_ the request is coming
> from your IP. Without the collaboration of admins of the third-party
> sites this is not doable.
Proxies such as squid add headers like this:
HTTP_VIA eve.cross-site.com (m_i_m_a.pl/0.1)
HTTP_X_FORWARDED_FOR 192.168.221.197
------------------------------
Date: 2 Jun 2004 07:27:25 -0700
From: jkeen_via_google@yahoo.com (Jim Keenan)
Subject: Re: Perl Installation on Darwin
Message-Id: <196cb7af.0406020627.4b473e43@posting.google.com>
Thanks to Ben, Sisyphus (as always) and Sherm for responding. I had
read the INSTALL but had overlooked README.macosx. The gist of your
comments was confirmed by Randal Schwartz at an ny.pm meeting last
night, and I successfully built Perl 5.8.4 from source this morning.
One note: From Ben's comments, echoed by both MacOS X Help and
Randal's comments, I was expecting to find the XTools software on 2
extra CDs. I couldn't locate those CDs, but after about 10 minutes on
the phone Apple Help was able to tell me that that software shipped on
the iBook G4 itself. It was located at /Applications/Installers/Xcode
Tools. It took 5-10 minutes for the Xcode Tools to install; then I
installed Perl with defaults by following the instructions in INSTALL,
modified only to say 'sudo make install' and provide a password.
I have further questions, but I'll start a new thread for those.
Thank you very much.
jimk
------------------------------
Date: 2 Jun 2004 13:55:23 GMT
From: lvirden@gmail.com
Subject: Why does IO::Pipe::END generate an EXCEPT pipe message?
Message-Id: <c9km8b$6jt$1@srv38.cas.org>
I've inherited a massive system which is written mostly
in perl. I'm slowing trying to figure out what the code is
doing.
Anyways, I keep seeing messages like this in the log file
that the application is creating.
IO::Pipe::End=GLOB(0x1c31624): EXCEPT pipe 0
I don't see anything in the application that would create this message,
but also, after googling for the message on both usenet and the regular
net, I don't see any mention of it either.
Does this message look familar to anyone? I'm trying to figure out
whether it is some sort of informatory message, a warning, an error, or
what...
--
<URL: http://wiki.tcl.tk/ > In God we trust.
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvirden@yahoo.com > <URL: http://www.purl.org/NET/lvirden/ >
------------------------------
Date: Wed, 2 Jun 2004 14:17:50 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Why does IO::Pipe::END generate an EXCEPT pipe message?
Message-Id: <c9knie$i1e$1@wisteria.csv.warwick.ac.uk>
Quoth lvirden@gmail.com:
>
> I've inherited a massive system which is written mostly
> in perl. I'm slowing trying to figure out what the code is
> doing.
>
> Anyways, I keep seeing messages like this in the log file
> that the application is creating.
>
> IO::Pipe::End=GLOB(0x1c31625): EXCEPT pipe 0
>
> I don't see anything in the application that would create this message,
> but also, after googling for the message on both usenet and the regular
> net, I don't see any mention of it either.
This message is what you would get if you printed out one of the ends of
an IO::Pipe. The ': EXCEPT pipe' bit is almost certainly in the source
literally, so you can search for that to find where the message is
coming from.
Ben
--
Like all men in Babylon I have been a proconsul; like all, a slave ... During
one lunar year, I have been declared invisible; I shrieked and was not heard,
I stole my bread and was not decapitated.
~ ben@morrow.me.uk ~ Jorge Luis Borges, 'The Babylon Lottery'
------------------------------
Date: 2 Jun 2004 07:10:17 -0700
From: constants@mix-net.net (Mark Constant)
Subject: Re: Why is this upload script not working
Message-Id: <ce43fdea.0406020610.6a179099@posting.google.com>
Well on Unix my script now works without the -T switch on. The error
says that the file is still tainted. On a Windows Apache Server it
complains about Unaccetable file name and doesn't even upload. I guess
there is still something wrong with the way I am stripping the path
off of the filename.
#!c:/perl/bin/perl
use CGI;
use CGI::Carp qw/fatalsToBrowser/;
use strict;
use warnings;
use Cwd;
use Cwd 'abs_path';
my $q = CGI->new();
my $file = $q->param('upfile');
$file =~ /^([\w.-]+)$/ or die "Unaccetable file name: $file";
my $filename = $1;
my $cdir = cwd;
chdir('c:/progra~1/apache~1/apache2/htdocs/quickbooks/') or die "Can't
cd to quickbooks dir: $!";
my $dir = cwd;
my $path = abs_path $file;
print $q->header, $q->start_html('Uploading File');
print $q->h1('Upload Results');
if(!$file){
print "Nothing Uploaded\n";
} else {
print "Filename: $file<br />\n";
print "Destination: $path<br />\n";
print "Original CWD was: $cdir<br />\n";
print "New CWD after chdir is: $dir<br />\n";
my $ctype = $q->uploadInfo($file)->{'Content-Type'};
print "MIME Type: $ctype<br />\n";
open(OUTFILE, ">$path") or die("Didn't work because of $! \n");
binmode(OUTFILE);
my ($read, $buffer);
print OUTFILE $buffer
while $read = read $file, $buffer, 1024;
defined $read or die "read failed: $!";
close OUTFILE or die "Close of uploaded file failed: $!";
close $file or die "Close of socked failed $!";
print "File saved\n";
}
$q->end_html;
------------------------------
Date: Wed, 2 Jun 2004 10:20:05 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Why is this upload script not working
Message-Id: <20040602101739.G8971@dishwasher.cs.rpi.edu>
On Wed, 2 Jun 2004, Mark Constant wrote:
> On a Windows Apache Server it
> complains about Unaccetable file name and doesn't even upload.
<snip>
> $file =~ /^([\w.-]+)$/ or die "Unaccetable file name: $file";
Is this where your script is dieing? If so, what is the actual output?
That is, what is the contents of the $file variable when printed here?
That should give some clue on how to proceed (for example, perhaps your
regexp needs modification?)
Paul Lalli
------------------------------
Date: Wed, 2 Jun 2004 14:28:16 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Why is this upload script not working
Message-Id: <c9ko60$i1e$2@wisteria.csv.warwick.ac.uk>
Quoth constants@mix-net.net (Mark Constant):
> Well on Unix my script now works without the -T switch on. The error
> says that the file is still tainted.
What does the error say *exactly*?
> On a Windows Apache Server it
> complains about Unaccetable file name and doesn't even upload. I guess
> there is still something wrong with the way I am stripping the path
> off of the filename.
Well, you aren't stripping it off at all...
> #!c:/perl/bin/perl
> use CGI;
> use CGI::Carp qw/fatalsToBrowser/;
> use strict;
> use warnings;
> use Cwd;
> use Cwd 'abs_path';
You can reduce these to
use Cwd qw/cwd abs_path/;
or, if you must,
use Cwd qw/:DEFAULT abs_path/;
(this is documented in perldoc Exporter).
> my $q = CGI->new();
> my $file = $q->param('upfile');
> $file =~ /^([\w.-]+)$/ or die "Unaccetable file name: $file";
> my $filename = $1;
If your windows server is returning the file with a full path, or
something, then this will fail. You could try something like:
$file =~ /([\w.-]+)$/ or die "Unacceptable file name: $file";
# ^^ no '^'
my $filename = $1 or die "Unacceptable file name: $file";
This way, if a filename of 'a:\path\to\file' is provided, the
unacceptable bits will be stripped off rather than causing the script to
fail.
> my $cdir = cwd;
> chdir('c:/progra~1/apache~1/apache2/htdocs/quickbooks/') or die "Can't
> cd to quickbooks dir: $!";
I would strongly recommend using the 'real' directory names here: those
~1 names are not completely reliable (or rather, the means by which they
are generated is not well defined, so you may find they stop pointing
where you think they do).
I would also recommend *not* using directory names with spaces in, but
that's up to you :).
> my $dir = cwd;
> my $path = abs_path $file;
>
> print $q->header, $q->start_html('Uploading File');
> print $q->h1('Upload Results');
>
> if(!$file){
> print "Nothing Uploaded\n";
> } else {
> print "Filename: $file<br />\n";
> print "Destination: $path<br />\n";
> print "Original CWD was: $cdir<br />\n";
> print "New CWD after chdir is: $dir<br />\n";
> my $ctype = $q->uploadInfo($file)->{'Content-Type'};
> print "MIME Type: $ctype<br />\n";
> open(OUTFILE, ">$path") or die("Didn't work because of $! \n");
Say what didn't work, and let Perl say where it didn't:
... or die "Can't create $path: $!";
(note the *lack* of "\n").
> binmode(OUTFILE);
Should you not binmode $file as well? (I don't know if CGI.pm does it
for you or not...)
Ben
--
We do not stop playing because we grow old;
we grow old because we stop playing.
ben@morrow.me.uk
------------------------------
Date: Wed, 02 Jun 2004 16:52:58 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Why is this upload script not working
Message-Id: <2i68daFjf2oiU1@uni-berlin.de>
Mark Constant wrote:
> Well on Unix my script now works without the -T switch on. The
> error says that the file is still tainted. On a Windows Apache
> Server it complains about Unaccetable file name and doesn't even
> upload.
This simple upload script:
http://groups.google.com/groups?selm=bqpqmd%24262n27%241%40ID-184292.news.uni-berlin.de
works fine on Windows, and can be run with tainting enabled. Since it
makes use of the upload() function instead of param() to grab the
filehandle, it may also be more robust.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 02 Jun 2004 14:28:37 +0100
From: zzapper <david@tvis.co.uk>
Subject: WinXP : Terminating on signal SIGALRM(14)
Message-Id: <d3lrb09tgmeivi9e766g66or7kh33rr4bi@4ax.com>
Hi,
I don't know how OT this is, please advise of a better NG as required.
I have a Perl App (ActiveState 5.8.3) from which I create an
executable with pp. I can create the exe fine but when I try to run it
I get "Terminating on signal SIGALRM(14)" on my new PC (XP Home)
This however works fine on my old PC (XP Prof)
(From Googling I suspect Norton Antivirus may be 2 blame (only on new
PC)
But how can I disable/make harmless signal SIGALRM(14) ???
zzapper (vim, cygwin, wiki & zsh)
--
vim -c ":%s.^.CyrnfrTfcbafbeROenzSZbbyranne.|:%s/[R-T]/ /Ig|:normal ggVGg?"
http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
------------------------------
Date: Wed, 2 Jun 2004 13:31:03 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: WinXP : Terminating on signal SIGALRM(14)
Message-Id: <c9kkqm$g1s$1@wisteria.csv.warwick.ac.uk>
Quoth zzapper <david@tvis.co.uk>:
> Hi,
> I don't know how OT this is, please advise of a better NG as required.
>
> I have a Perl App (ActiveState 5.8.3) from which I create an
> executable with pp. I can create the exe fine but when I try to run it
> I get "Terminating on signal SIGALRM(14)" on my new PC (XP Home)
>
> This however works fine on my old PC (XP Prof)
>
> (From Googling I suspect Norton Antivirus may be 2 blame (only on new
> PC)
>
> But how can I disable/make harmless signal SIGALRM(14) ???
At the top of your script put
BEGIN { $SIG{ALRM} = 'IGNORE' }
See perldoc perlvar. Note that this may interfere with any use of sleep.
Ben
--
I must not fear. Fear is the mind-killer. I will face my fear and
I will let it pass through me. When the fear is gone there will be
nothing. Only I will remain.
ben@morrow.me.uk Frank Herbert, 'Dune'
------------------------------
Date: Wed, 02 Jun 2004 14:41:58 +0100
From: zzapper <david@tvis.co.uk>
Subject: Re: WinXP : Terminating on signal SIGALRM(14)
Message-Id: <f6mrb0p6j361qe6r7tj0pu0h6p0k0okspc@4ax.com>
On Wed, 2 Jun 2004 13:31:03 +0000 (UTC), wrote:
>
>Quoth zzapper <david@tvis.co.uk>:
>> Hi,
>> I don't know how OT this is, please advise of a better NG as required.
>>
>> I have a Perl App (ActiveState 5.8.3) from which I create an
>> executable with pp. I can create the exe fine but when I try to run it
>> I get "Terminating on signal SIGALRM(14)" on my new PC (XP Home)
>>
>> This however works fine on my old PC (XP Prof)
>>
>> (From Googling I suspect Norton Antivirus may be 2 blame (only on new
>> PC)
>>
>> But how can I disable/make harmless signal SIGALRM(14) ???
>
>At the top of your script put
>
>BEGIN { $SIG{ALRM} = 'IGNORE' }
>
>See perldoc perlvar. Note that this may interfere with any use of sleep.
>
>Ben
Worked a treat!!! (super quick NG response as well)
zzapper (vim, cygwin, wiki & zsh)
--
vim -c ":%s.^.CyrnfrTfcbafbeROenzSZbbyranne.|:%s/[R-T]/ /Ig|:normal ggVGg?"
http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips
------------------------------
Date: Wed, 2 Jun 2004 08:21:26 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: YAPC::2004
Message-Id: <slrncbrl2l.2ur.tadmc@magna.augustmail.com>
Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:
>
>>>>>> "Tad" == Tad McClellan <tadmc@augustmail.com> writes:
> Tad> If you're going to be at YAPC this summer, consider setting aside
> Tad> Thursday to get about half of a Stonehenge Alpaca (Intermediate)
> Tad> class for free!
>
> Tad> http://yapc.org/America/day2.shtml
>
> Tad> I have a very high opinion of the presenter. (heh)
>
> RLS> Actually, I do too. (heh)
>
> i think he is a low down dirty rotten scoundrel and scalawag
You forgot "bully".
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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 6644
***************************************