[15950] in Perl-Users-Digest
Perl-Users Digest, Issue: 3362 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 14 21:05:29 2000
Date: Wed, 14 Jun 2000 18:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961031114-v9-i3362@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 14 Jun 2000 Volume: 9 Number: 3362
Today's topics:
Re: A Computer Programmers Profile (brian d foy)
Re: A Computer Programmers Profile <cmcurtin@interhack.net>
Average Salary? paul_maas@my-deja.com
Re: Bot for this group to auto-answer queries? <rootbeer@redcat.com>
Re: calculating date differences <mhc@Eng.Sun.COM>
Re: case sensitive pattern recognition.... <y-o-y@home.com>
Re: case sensitive pattern recognition.... <lr@hpl.hp.com>
Re: case sensitive pattern recognition.... <y-o-y@home.com>
Re: Client connection speed <rootbeer@redcat.com>
Re: Computer Programmer Profile <flavell@mail.cern.ch>
Re: conection speed (Clinton A. Pierce)
Re: conection speed (Craig Berry)
Error in Prepare in DBI <pratickm@my-Deja.com>
Re: Error in Prepare in DBI <jeff@vpservices.com>
Re: Error in Prepare in DBI <rootbeer@redcat.com>
Extracting Data From a File with Separate Sections <jimshep@mindspring.com>
Flushing STDOUT (Philip Taylor)
Re: Flushing STDOUT <lr@hpl.hp.com>
Re: Flushing STDOUT <rootbeer@redcat.com>
Re: Flushing STDOUT (Clinton A. Pierce)
Re: How to use LWP::UserAgent to get a zip file? <gnari@simnet.is>
Invoking Shell w/ Env. Variable <michaellewisNOmiSPAM@yahoo.com.invalid>
Re: Larry Rosler interview on perl.com! <henry@penninkilampi.net>
Re: OLE and CGI ?? Not working ! <rootbeer@redcat.com>
Re: OLE and CGI ?? Not working ! roeerubin@my-deja.com
Re: OLE and CGI ?? Not working ! rrubin@rotor.net
Re: OLE and CGI ?? Not working ! <rootbeer@redcat.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 14 Jun 2000 18:27:58 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: A Computer Programmers Profile
Message-Id: <brian-1406001827590001@176.sanjose-06-07rs16rt.ca.dial-access.att.net>
In article <073055cc.658194f0@usw-ex0106-048.remarq.com>, Employer <jenniferbNOjeSPAM@oreilly.com.invalid> wrote:
>I am looking for this information in the interest to be able to find
>computer programmers for employment when I need them. They have been
>hard to find (the good ones anyway), and I am trying to find them!!
pay them well and they will come. seriously.
--
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ
<URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: 14 Jun 2000 20:02:28 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: A Computer Programmers Profile
Message-Id: <xlxya47x14b.fsf@gold.cis.ohio-state.edu>
>>>>> "Employer" == Employer <jenniferbNOjeSPAM@oreilly.com.invalid> writes:
Employer> I am looking for this information in the interest to be
Employer> able to find computer programmers for employment when I
Employer> need them. They have been hard to find (the good ones
Employer> anyway), and I am trying to find them!!
You need to read The Jargon File, AKA the New Hacker's Dictionary,
online at http://www.tuxedo.org/~esr/jargon/html/index.html.
Start with the Introduction and cruise through the appendices and
bibliography. You'll get the picture before long.
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Thu, 15 Jun 2000 00:40:51 GMT
From: paul_maas@my-deja.com
Subject: Average Salary?
Message-Id: <8i98mg$q82$1@nnrp1.deja.com>
Hi,
I am trying to find out the average salary of a Web Developer
(CGI/PERL) and Database Administrator. So one person.
I have seen people asking/offering from $63,000 to $84,000.
Is that about right?
Thanks in advance,
Paul Maas
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 14 Jun 2000 16:21:40 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Bot for this group to auto-answer queries?
Message-Id: <Pine.GSO.4.10.10006141610440.5301-100000@user2.teleport.com>
On Thu, 15 Jun 2000, Henry wrote:
> Subject: Bot for this group to auto-answer queries?
Hey! :-)
> This bot is programmed to continuously scan a given newsgroup, looking
> for messages with the word "help" in the subject line.
Why "help" and not "newbie"? And "Windows"? :-)
> It then extracts any other words on the subject line, and uses them as
> keywords to search a local database. It ranks the matches, and then
> posts a summary of all the articles back to the newsgroup as a response
> to the original message.
A summary? Can you give an example? That is, if the subject line said,
"Help with CGI problem", what would the response look like?
> Each individual article has a number. To retrieve specific articles,
> all the poster need to is post another message and specify the article
> number(s). The bot then responds with the full text of the requested
> article(s).
So the bot will post many articles upon request? Why not just send them by
e-mail upon request? (In fact, why not have the bot do all of its work by
e-mail?)
Alternatively, the bot could post URLs; interested parties can follow
those, but they'd create minimal clutter for the rest of us.
> Any concerns/doubts as to the effectiveness of such a system?
Just a few. If it helps more than it hurts, I'm in favor of it - but
you'll have to sell me on that "if" part. Having a high level of relevance
in its replies would be a good start. If you follow that up with reference
to documentation which would be sent by e-mail upon request (or which can
be found on the web, say) that's even better.
> Would anyone object to their responses (in this forum) being
> integrated into the knowledge base (without additional
> correspondence)?
Uh-oh. You may be treading upon dangerous ground there. I would be
cautious about doing that. Still, it may be okay.
> I basically figure that it would be nice to give the gurus of the
> group the option of responding to a message with "Just ask the Bot".
How is that better than the response "See section ____ of the FAQ"? Bear
in mind that the FAQ is available in many more ways than the Bot is, and
the FAQ consumes very little Usenet bandwidth.
> All I need is content for the knowledge base, which is where you folks
> come in. Any time you answer a question, and think it belongs in the
> knowledge base, just let me know and it's in.
You should probably get together with the PerlFaq folks.
http://www.perlfaq.com/
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 14 Jun 2000 15:05:09 -0700
From: Mike Coffin <mhc@Eng.Sun.COM>
Subject: Re: calculating date differences
Message-Id: <8p6u2evc416.fsf@Eng.Sun.COM>
sumera.shaozab@lmco.com writes:
> Hello,
>
> I am trying to calculate the current date with the date from last week,
> last month etc...and find the difference in days. I looked into the
> perl manip:date module but learned that it was not efficient since I
> will be calculating thousands of dates. What do you recommend I should
> do?
"Thousands" will proably take a few tens of seconds. Is that going to
be the bottleneck?
-mike
------------------------------
Date: Wed, 14 Jun 2000 22:09:01 GMT
From: Andy <y-o-y@home.com>
Subject: Re: case sensitive pattern recognition....
Message-Id: <1oT15.2783$A%3.34357@news1.rdc2.pa.home.com>
Just curious,
Why did most of the solutions use the 'lc' instead of the 'uc' function?
------------------------------
Date: Wed, 14 Jun 2000 15:48:48 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: case sensitive pattern recognition....
Message-Id: <MPG.13b1aba811269c6098ab7f@nntp.hpl.hp.com>
In article <1oT15.2783$A%3.34357@news1.rdc2.pa.home.com> on Wed, 14 Jun
2000 22:09:01 GMT, Andy <y-o-y@home.com> says...
> Just curious,
>
> Why did most of the solutions use the 'lc' instead of the 'uc' function?
Some conjectures:
1. Tradition. So many other things in the Unix/C/Perl line of
computing are lower-case (commands, library function names, Uri
Guttman's posts, brian d foy's name, ...).
2. The comparison operand looks ugly in upper-case ('<SMILE>').
3. In some locales, the upper-case character set may be impoverished
relative to the lower-case character set.
I can use some native-speaker help on this one. Possible examples:
Metropolitan French conventionally maps accented lower-case letters
to unaccented upper-case letters (but I don't know if the uc() function
does that with French locale), so false matches might result.
German ß has no single-character upper-case equivalent, so either ß
or 'ss' would match upper-case 'SS'.
Any others?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 15 Jun 2000 00:23:08 GMT
From: Andy <y-o-y@home.com>
Subject: Re: case sensitive pattern recognition....
Message-Id: <MlV15.3350$A%3.39103@news1.rdc2.pa.home.com>
In article <MPG.13b1aba811269c6098ab7f@nntp.hpl.hp.com>, Larry Rosler
<lr@hpl.hp.com> wrote:
> In article <1oT15.2783$A%3.34357@news1.rdc2.pa.home.com> on Wed, 14 Jun
> 2000 22:09:01 GMT, Andy <y-o-y@home.com> says...
> > Just curious,
> >
> > Why did most of the solutions use the 'lc' instead of the 'uc' function?
>
> Some conjectures:
>
> 1. Tradition. So many other things in the Unix/C/Perl line of
> computing are lower-case (commands, library function names, Uri
> Guttman's posts, brian d foy's name, ...).
>
> 2. The comparison operand looks ugly in upper-case ('<SMILE>').
>
> 3. In some locales, the upper-case character set may be impoverished
> relative to the lower-case character set.
>
> I can use some native-speaker help on this one. Possible examples:
>
> Metropolitan French conventionally maps accented lower-case letters
> to unaccented upper-case letters (but I don't know if the uc() function
> does that with French locale), so false matches might result.
>
> German ß has no single-character upper-case equivalent, so either ß
> or 'ss' would match upper-case 'SS'.
>
> Any others?
Thanks, Larry!
From my newbie point of view, with all the curly-braces, parens and
square-brackets, the 'uc' version just seemed to me to be more easily
identfiable in the mix of things.
------------------------------
Date: Wed, 14 Jun 2000 15:44:15 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Client connection speed
Message-Id: <Pine.GSO.4.10.10006141539150.5301-100000@user2.teleport.com>
On Wed, 14 Jun 2000, Toshi Horie wrote:
> Anyone knows how to get client conection speed to the server ?
It's not clear what you mean. Do you mean web client and web server? Do
you mean NNTP client and NNTP server? Do you mean FTP client and FTP
server? Do you mean the time it takes for the connection to be
established, or the time it takes to make an initial request, or the
overall throughput of the link, or the maximum possible instantaneous
throughput, or the time it takes for a fixed quantity of data to be sent?
One way or two? Under typical load, no load, or maximal load?
Of course, whichever one you mean, it's probably not Perl-specific - the
"client connection speed to the server" would be the same whether the
client (or server) were programmed in Perl, C, or Fortran. So maybe this
question is really about the hardware or software that you're using.
Still, maybe you want to use Perl to measure the time that some operation
takes from start to finish. There's some information about measuring times
like that in the FAQ.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 15 Jun 2000 00:24:02 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Computer Programmer Profile
Message-Id: <Pine.GHP.4.21.0006150023110.858-100000@hpplus03.cern.ch>
On Wed, 14 Jun 2000, Employer wrote:
> I am looking for information so that I may create a "profile" for
> a computer programmer.
That reminds me, I'd been intending to score-down remarq postings
along with CNET.
------------------------------
Date: Wed, 14 Jun 2000 23:47:06 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: conection speed
Message-Id: <_PU15.986$fR2.13232@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <3947FE9F.F9C12AB4@litho.eecs.berkeley.edu>,
Toshi Horie <horie@litho.eecs.berkeley.edu> writes:
> When a user conects to web server through web browser,
> how can I know user's internet conection speed ?
The web doesn't work like that. Ever wonder why many multimedia web sites
and streaming video/audio sites have a "high speed" and a "low speed"
selection? This isn't because nobody before you thought to ask this
question. It's because it can't be done.
Anyone who claims to be able to do this is selling snake oil.
Good luck.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Thu, 15 Jun 2000 00:03:11 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: conection speed
Message-Id: <skg79v3pis412@corp.supernews.com>
Toshi Horie (horie@litho.eecs.berkeley.edu) wrote:
: When a user conects to web server through web browser,
: how can I know user's internet conection speed ?
You can't, if only because true available bandwidth varies instant to
instant (and is also typically different up- and downstream). This isn't
a Perl question, of course; I suggest you do some searching on terms like
"bandwidth sniffing" for ideas. But always take any results you get with
a grain of salt.
--
| Craig Berry - http://www.cinenet.net/users/cberry/home.html
--*-- "Beauty and strength, leaping laughter and delicious
| languor, force and fire, are of us." - Liber AL II:20
------------------------------
Date: Wed, 14 Jun 2000 15:41:12 -0700
From: "pratickm " <pratickm@my-Deja.com>
To: "comp.lang.perl.misc@list.deja.com" <comp.lang.perl.misc@list.deja.com>
Subject: Error in Prepare in DBI
Message-Id: <LHNEGGBJMCJJGBAA@my-deja.com>
Hello everyone,
I am using the following statement (snips):
use DBI;
...
$dbh=DBI->connect("dbi:ODBC:BANKS");
...
$statement=$dbh->prepare("SELECT * FROM Clients");
$statement->execute;
...
The script is failing at the prepare statement.
It does not even return the error message.
IE (5.0) just gives the standard error dialog and then outputs this:
"The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:"
I am running Windows 2000 Advanced Server and MS Access 2000.
Banks is the name of the DSN I'm using.
I'm using ActiveState ActivePerl.
Any help will be appreciated.
Thanks and regards,
Pratick
--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 14 Jun 2000 16:35:47 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Error in Prepare in DBI
Message-Id: <394816D3.D5067E78@vpservices.com>
pratickm wrote:
>
> Hello everyone,
>
> I am using the following statement (snips):
>
> use DBI;
> ...
> $dbh=DBI->connect("dbi:ODBC:BANKS");
Change that to
my $dbh=DBI->connect("dbi:ODBC:BANKS",'','',{RaiseError=>1})
or die $DBI::errstr;
The RaiseError turns on error reporting for all later DBI calls. The
errstr makes sure you find out if the connection itself failed.
> The script is failing at the prepare statement.
> It does not even return the error message.
That is because you didn't ask it to. DBI will only give error messages
if you turn RaiseError on, or if you explicitly call for an errstr.
If you are running in a CGI environment, you may need to use CGI::Carp
qw/fatalsToBrowser/; to see the error in your browser.
--
Jeff
------------------------------
Date: Wed, 14 Jun 2000 16:44:32 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Error in Prepare in DBI
Message-Id: <Pine.GSO.4.10.10006141642551.5301-100000@user2.teleport.com>
On Wed, 14 Jun 2000, pratickm wrote:
> The script is failing at the prepare statement.
> It does not even return the error message.
Betcha a buck that it did give an error message. Your other software just
hid it from you.
> IE (5.0) just gives the standard error dialog and then outputs this:
>
> "The specified CGI application misbehaved by not returning a complete
> set of HTTP headers. The headers it did return are:"
And was there an error message hidden in those headers? But even if there
wasn't, when you're having trouble with a CGI program in Perl, here's a
handy troubleshooting guide to get you back on track.
http://www.smithrenaud.com/public/troubleshooting_CGI.html
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 14 Jun 2000 20:18:55 -0400
From: Jim Shepherd <jimshep@mindspring.com>
Subject: Extracting Data From a File with Separate Sections
Message-Id: <394820EE.D51C7695@mindspring.com>
I am trying to parse a data file which contains sections of different
data types separated by heading lines. An example of the data would be:
HEADING
This is a sample data file
MATERIAL 3 2 Polymer
Elastic Modulus
Poisson's Ratio
Shear Modulus
5000 0.34 2400
---
ELEMENT
TRI 12 1 1 2 3
TRI 13 1 2 3 4
---
...
I have a Perl program that works, but it doesn't seem to be the cleanest
method. I currently open the file, then run a while loop on the file
handle. In the while loop, I use a set of if...elsif...else blocks to
check to see if the first word matches a known heading (such as HEADING,
MATERIAL, ELEMENT). Once such a heading is found, it sets a flag to the
section type. Then the subsequent lines are processed according to the
section type.
This code snippet may not be correct, since I have typed in it manually
and I do not have Perl on this machine to test it for typos and such
open (<FILE>, "<test.fil>") or die "Error opening file!\n";
$section = "header";
while (<FILE>){
($first, $second, $third, @junk) = split;
if ( $section =~ "header" ){
if ( $first =~ "MATERIAL" ){
$section = "material";
$skiplines = $second;
}
elsif ( $first =~ "ELEMENT" ) {
$section = "element";
}
else {
}
}
elsif ( $section =~ "material2" ){
($E, $v, $G) = split;
$section = "header";
}
elsif ( $section =~ "material" ){
$skiplines--;
if ($skiplines = 0.) {
$section = "material2";
}
}
elsif ( $section =~ "element" ){
if ( $first =~ "----" ){
$section = "header";
}
else {
$i++;
($type[$i], $group[$i]; $node1[$i], $node2[$i], $node3[$i]) =
split;
}
}
else {
}
}
close(FILE);
See, this isn't elegant at all and is becoming quite a mess as I add
more section types. I'm pretty new to Perl and have not been able to
find any better method in any of the books I have or on-line. Any code
suggestions or references would be much appreciated.
Jim Shepherd
jimshep at mindspring dot com
------------------------------
Date: Wed, 14 Jun 2000 22:08:54 GMT
From: phil.taylor@bigfoot.com (Philip Taylor)
Subject: Flushing STDOUT
Message-Id: <39480100.6968472@news.demon.co.uk>
I have a perl/cgi program which builds the output by printing to
STDOUT as it goes along. However on error I want to clear everything
written to STDOUT so that a standard error page can be written. How do
I do this? I have considered building the output in a variable and
only printing to STDOUT on completion but it doesn't seem as clean, is
this a preferred approach?
Any help appreciated
Phil
------------------------------
Date: Wed, 14 Jun 2000 16:00:00 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Flushing STDOUT
Message-Id: <MPG.13b1ae4b3efe148698ab80@nntp.hpl.hp.com>
In article <39480100.6968472@news.demon.co.uk> on Wed, 14 Jun 2000
22:08:54 GMT, Philip Taylor <phil.taylor@bigfoot.com> says...
> I have a perl/cgi program which builds the output by printing to
> STDOUT as it goes along. However on error I want to clear everything
> written to STDOUT so that a standard error page can be written. How do
> I do this? I have considered building the output in a variable and
> only printing to STDOUT on completion but it doesn't seem as clean, is
> this a preferred approach?
You have little choice, as buffered output to a stream may be flushed at
any time, according to the will of the gods.
You can concatenate to a string, push onto an array, or write to a
temporary file, which you can then close and copy to STDOUT on success.
The last approach trades I/O time for memory.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 14 Jun 2000 16:09:44 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Flushing STDOUT
Message-Id: <Pine.GSO.4.10.10006141559120.5301-100000@user2.teleport.com>
On Wed, 14 Jun 2000, Philip Taylor wrote:
> I have a perl/cgi program which builds the output by printing to
> STDOUT as it goes along. However on error I want to clear everything
> written to STDOUT so that a standard error page can be written. How do
> I do this?
Just unprint() it until it's all gone. :-)
No, once it's been printed, it's out of your hands. It may be in the
output buffer, but it may have already been flushed.
> I have considered building the output in a variable and only printing
> to STDOUT on completion but it doesn't seem as clean, is this a
> preferred approach?
Yes. In fact, here's the structure I generally recommend for programs like
this, in pseudocode.
unless (open ERROR_LOG, ">>/home/me/my_error_file") {
print "Can't report errors - $!";
}
my $output = '';
eval {
$output .= something;
$output .= something while something;
$output .= something;
};
if ($@) {
my $id = "Error$0.$$.$^T";
print ERROR_LOG "$id: $@\n";
print "Oops: Tell Tom to find '$id' in the error log";
} else {
print $output;
}
Of course, for a CGI program, you'll want to output some headers, you
should probably lock the error log, and so on. The point of sending the
error to the log file, though, is so that you don't give away details of
your program's bugs to a potential cracker.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 14 Jun 2000 23:44:41 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Flushing STDOUT
Message-Id: <JNU15.984$fR2.13232@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <39480100.6968472@news.demon.co.uk>,
phil.taylor@bigfoot.com (Philip Taylor) writes:
> I have a perl/cgi program which builds the output by printing to
> STDOUT as it goes along. However on error I want to clear everything
> written to STDOUT so that a standard error page can be written. How do
> I do this? I have considered building the output in a variable and
> only printing to STDOUT on completion but it doesn't seem as clean, is
> this a preferred approach?
Have you ever accidentally dropped something in a sink as it's draining?
Or maybe a toilet that's already started flushing? What are the chances
that what you dropped (and now want back) will be in the drain trap?
It depends on how fast you stop the water, how dense the object was,
how clean your drains are. Even then you'll need special tools to
take apart the drain to check.
Standard IO works like that. When you write something out, the chances
that it didn't go past the trap are proportional to how large the data
was and how much has gone down before and since then. Even then,
you need to tinker in stdio's innards to get it back. This is not a job
for Perl, and certainly not a job you want to do regularly.
Buffer your stuff ahead of time and then scribble it out when you're
sure you don't need an error message.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Wed, 14 Jun 2000 22:50:02 -0000
From: "Gnari" <gnari@simnet.is>
Subject: Re: How to use LWP::UserAgent to get a zip file?
Message-Id: <39486f93.0@news.isholf.is>
"§dªF½å" <tonywu@sonix.com.tw> wrote in message
news:8i7al2$1ehg$1@news.is.net.tw...
> Hi:
>
> The following Perl Script can get an HTML page, but if I use the same
> script
> to get a zip file, the zip file format is not correct. Does anyone know
how
> to use
> LWP::UserAgent to get a zip file? Thanks a lot.
>
> use LWP::UserAgent;
> my $ua = new LWP::UserAgent();
>
> $ua->agent("Mozilla/3.0");
>
> my $req = new HTTP::Request("GET" => $command);
>
> $req->header("Accept" => "text/html");
Are you not here specifically telling the server that you expect
the content to be text/html ? I don't know what HTTP specs say
about this, but I would include the expected content type here.
in what way was the zip file the wrong format? did you inspect it ?
>
> my $res = $ua->request($req);
>
> if ($res->is_success)
> {
> open( OUT, "> yahoo.html" );
> print OUT $res->content();
> close( OUT );
> }
>
gnari
------------------------------
Date: Wed, 14 Jun 2000 17:20:42 -0700
From: mlewis <michaellewisNOmiSPAM@yahoo.com.invalid>
Subject: Invoking Shell w/ Env. Variable
Message-Id: <1167bb98.3aa381dd@usw-ex0106-047.remarq.com>
When creating a script that invokes a shell the first
line of the file should contain a #! command in csh.
My question is... how can I pass an environment
variable to this command in order to invoke a soft
path.
For example, simply using the variable doesn't work
in ANY of the following:
#! ${PERL_PATH}/perl
#!${PERL_PATH}/perl
#! $PERL_LOCATION
#!$PERL_LOCATION
# !${PERL_LOCATION}
#!${PERL_LOCATION}
(where PERL_PATH = /usr/local/bin,
and PERL_LOCATION = /usr/local/bin/perl)
but the absolute path does:
#! /usr/local/bin/perl
As you can see, I tried massaging it in several
different ways, since I supposed there was a
syntax issue, but nothing I though of worked.
Can anyone provide a way to pass env variables
to the shell invocation command?
Thanks,
Michael Lewis
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Thu, 15 Jun 2000 07:40:51 +0930
From: Henry <henry@penninkilampi.net>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <henry-511DE2.07405115062000@news.metropolis.net.au>
In article <MPG.13b1678b27700fda98ab74@nntp.hpl.hp.com>, Larry Rosler
<lr@hpl.hp.com> wrote:
> Because the ANSI/ISO C Standard isn't available on-line (to my
> knowledge; a matter of copyright protection for the standards
> organizations),
Rules are made to be broken.
http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.htm
http://wwwold.dkuug.dk/JTC1/SC22/WG14/www/docs/n843.pdf.gz
Henry.
------------------------------
Date: Wed, 14 Jun 2000 15:33:23 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: OLE and CGI ?? Not working !
Message-Id: <Pine.GSO.4.10.10006141532230.5301-100000@user2.teleport.com>
On Wed, 14 Jun 2000 rrubin@rotor.net wrote:
> The script runs great from the command line but once I
> embed the CGI calls into the script it doesn't work.
When you're having trouble with a CGI program in Perl, here's a handy
troubleshooting guide to get you back on track.
http://www.smithrenaud.com/public/troubleshooting_CGI.html
> $ie = CreateObject OLE "InternetExplorer.Application.1" ||
> die "CreateObject: $!";
Are you sure that you have the precedence correct?
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 14 Jun 2000 22:44:52 GMT
From: roeerubin@my-deja.com
Subject: Re: OLE and CGI ?? Not working !
Message-Id: <8i91t0$l7b$1@nnrp1.deja.com>
Is this done by design or is the code wrong?
In article <8i8rr5$gjv$1@nnrp1.deja.com>,
rrubin@rotor.net wrote:
> Hello,
>
> I am trying to run a CGi script that performs a certain function
> using OLE. The script runs great from the command line but once
I
> embed the CGI calls into the script it doesn't work.
>
> The following code is just an example. This is true to any OLE or
> COM object I use. I am currently running this on WIndows NT and
> Personal Web Server.
>
> Working command line version:
>
> =============
>
> use OLE;
>
> $ie = CreateObject OLE "InternetExplorer.Application.1" ||
> die "CreateObject: $!";
> $ie->{Visible} = 1;
> $ie->Navigate("http://www.cnn.com");
>
> ==============
>
> Not working CGI version
>
> ===============
>
> use OLE;
> use CGI;
> $co=new CGI;
>
> print $co->header();
>
> print $co->start_html;
>
> $ie = CreateObject OLE "InternetExplorer.Application.1" ||
> die "CreateObject: $!";
> $ie->{Visible} = 1;
> $ie->Navigate("http://www.cnn.com");
>
> print $co->end_html;
>
> Any help is appreciated.
>
> RR
>
> rrubin@rotor.net
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 14 Jun 2000 23:46:14 GMT
From: rrubin@rotor.net
Subject: Re: OLE and CGI ?? Not working !
Message-Id: <8i95g1$nrj$1@nnrp1.deja.com>
It's very strange, I have tried three different COM objects (Excel, IE,
SourceSafe) and all work from the command line and yet none work
through the CGI.
Can you post a working example so I can test if it is a web server
problem rather then a script ...
Thanks.
In article <Pine.GSO.4.10.10006141532230.5301-
100000@user2.teleport.com>,
Tom Phoenix <rootbeer@redcat.com> wrote:
> On Wed, 14 Jun 2000 rrubin@rotor.net wrote:
>
> > The script runs great from the command line but once I
> > embed the CGI calls into the script it doesn't work.
>
> When you're having trouble with a CGI program in Perl, here's a
handy
> troubleshooting guide to get you back on track.
>
> http://www.smithrenaud.com/public/troubleshooting_CGI.html
>
> > $ie = CreateObject OLE "InternetExplorer.Application.1" ||
> > die "CreateObject: $!";
>
> Are you sure that you have the precedence correct?
>
> Hope this helps!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 14 Jun 2000 17:27:47 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: OLE and CGI ?? Not working !
Message-Id: <Pine.GSO.4.10.10006141725530.5301-100000@user2.teleport.com>
On Wed, 14 Jun 2000 rrubin@rotor.net wrote:
> Can you post a working example so I can test if it is a web server
> problem rather then a script ...
No; if you can't make any CGI programs work on your system, then it's a
webserver problem. The URL which I gave you before has some helpful
troubleshooting hints; have you tried them? Cheers!
http://www.smithrenaud.com/public/troubleshooting_CGI.html
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 3362
**************************************