[6854] in Perl-Users-Digest
Perl-Users Digest, Issue: 479 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 15 01:03:47 1997
Date: Wed, 14 May 97 22:00:24 -0700
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, 14 May 1997 Volume: 8 Number: 479
Today's topics:
Re: Decoding CyberSitter in 1 line - but how long a lin (John L. Allen)
Re: inclu-OR in regex (Chipmunk)
Interrupted System Call in open Tim.Middleton@health.wa.gov.au
Re: Is perl too slow? (Jordyn A. Buchanan)
Re: need to send form data to file <mlw@zot.ncsc.navy.mil>
Re: NO NO PERL is NOT CGI and CGI is NOT PERL (was: Re: (B. Mathis)
Parsing a Text File by Perl??? <swsung.bbs@cis.nctu.edu.tw>
Parsing HTTP header <jmscott@ainet.com>
PERL script autoresponder problems...please take a look (K. Hawkins)
Re: Regex problem - removing trailing form input (Tad McClellan)
Rounding Off <brian@shepmark.com>
Re: Rounding Off (Michael Fuhr)
Re: Rounding Off (Tad McClellan)
running ftp in a Perl script. <Florence=Kuan%Design%Eng=Sin@netgate.compaq.com>
running ftp in Perl script <cedric=tio%design%eng=sin@bangate.compaq.com>
setuid script problems <poldrack@psych.stanford.edu>
Sorting Records (James Ringrose)
Re: String Float to Machine Float <mlw@zot.ncsc.navy.mil>
Re: type casting <mlw@zot.ncsc.navy.mil>
Re: Undump Question... <rootbeer@teleport.com>
Re: Weather Forecasts via perl (I R A Aggie)
Re: Weather Forecasts via perl (I R A Aggie)
Re: Weather Forecasts via perl (Jack Siler)
Re: Weather Forecasts via perl <usenet-tag@qz.little-neck.ny.us>
What is "socket.ph" and where can I get it? <levass@gdesystems.com>
Re: Year 2000 compliance <csc80@amdahl.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 May 1997 09:38:36 -0400
From: allen@gateway.grumman.com (John L. Allen)
Subject: Re: Decoding CyberSitter in 1 line - but how long a line?
Message-Id: <5l9qss$nce@gateway.grumman.com>
In article <jamie-2904972350040001@clmx24.dial.voyager.net>,
Jamie McCarthy <jamie@voyager.net> wrote:
>Can you beat this?
>
> perl -lne '$,=$/;print grep/.{5}/,split/[^ ,-9A-}]+/,$_^="\224"x length'
Sure,
perl -lne '$,=$/;$_^="\224"x y///c;print /[ -~]{5,}/g'
or
perl -lne '$_^="\224"x y///c;map{print}/[ -~]{5,}/g'
John.
------------------------------
Date: 15 May 1997 00:34:38 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: inclu-OR in regex
Message-Id: <5ldlmu$sa0$1@dartvax.dartmouth.edu>
In article <ebohlmanEA613y.8r3@netcom.com>
ebohlman@netcom.com (Eric Bohlman) writes:
> alex (alex.t.silverstein@bender.com) wrote:
> : I want to match the letters a b and c in a string at least once
> : but in any order. The part I don't get is how to say "in any order"
> : in a regex (I can't seem to find this explained well in
> : "Learning Perl"). I tried the following:
>
> /(a.*b.*c)|(a.*c.*b)|(b.*a.*c)|(b.*c.*a)|(c.*a.*b)|(c.*b.*a)/
>
> You can factor it a bit, though that may make it less readable.
Silly silly silly.
/a/ && /b/ && /c/;
Chipmunk
------------------------------
Date: Wed, 14 May 1997 22:41:44 -0600
From: Tim.Middleton@health.wa.gov.au
Subject: Interrupted System Call in open
Message-Id: <863666866.32481@dejanews.com>
Hi.
I have the following code in one of my perl procedures.
open(WCO,"wc -l $INDIR/$dir/$file |") || do_exit(1,"Cannot run wc");
$t = <WCO>;
if (! $t) {
print STDERR "Failed to read: $!";
etc...
I know that the input file always have one record in it but
ocasionally, every 3rd or so record the $t=<WCO> line fails and $! =
"Interrupted system Call".
Has anyone got any thought's on what it could be??
TIA.
Tim Middleton
PS
I am running perl 5.003 on Digital Unix 3.2G.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Tue, 13 May 1997 13:20:15 -0400
From: jordyn@bestweb.net (Jordyn A. Buchanan)
Subject: Re: Is perl too slow?
Message-Id: <jordyn-ya02408000R1305971320150001@nntp.bestweb.net>
Jan "Yenya" Kasprzak wrote:
> In article ebohlman@netcom.com (Eric Bohlman) writes:
> : When you take a language with built-in sophisticated string processing
> : features and try to use them as primitives for something like sorting,
> : you're always going to get a major slowdown, simply because there's a
> : fair amount of overhead inside the sophisticated string processing
> : routines. When you use the sophisticated routines for sophisticated
> : processing, that overhead is a small percentage of the total run time,
> : but when you use them to do lots of little steps instead of a few big
> : steps, the overhead becomes large. This isn't unique to Perl, or to
> : string processing. If you were to use Mathematica or Matlab to write a
> : step-by-step matrix inversion routine, it would be horribly slow, because
> : those languages are designed to do "big step" operations on matrices, and
> : have lots of overhead when used in a "little step" manner.
>
> Well, the above does explain why the code is slower than
> code using builtin sort, but this also apply to the other programming
> languages in that test. The question in not "Why that code is slow",
> but "Why that Perl code is slower than Elisp or Java code".
> Note that he does not measure "the fastest sorting algorithm in those
> languages", but "how fast are loops, string compares, etc. in those
> languages".
I think it does point to the answer, actually. While Java is an
interpreted language, it does not have the same level of built-in
sophistication that perl does. Write some code that does sophisticated
work with strings using regular expressions in perl. Now write that same
code in Java. Compare--obviosly perl comes out substantially ahead in
terms of ease of development and its built-in capabilities in this regard.
Similarly, there are things that Java can do that perl cannot easily
accomplish (for example, stuff using the AWT), but I think that perl has a
substantially larger number of features built-in than Java does, which
means there is more overhead involved.
This points us to a more fundamental question--is perl an appropriate tool
for writing code like sort loops? Probably not, especially if your goal is
to optomize for execution speed. Is it an appropriate tool to use for
string processing? Probably, and performance on these operations is
typically very good. Using the appropriate tool for the appropriate task
is always a good idea.
Perhaps even more importantly, there is a lot about perl that makes it
exceptionally quick and easy to create code, but these features (context
strikes me as a good example) almost certainly add to execution overhead
and slow perl down. In many cases, this is not important--if I'm writing
code that I'm only ever going to use once a month to generate a report, for
example, the time that I save generating the code vastly exceeds the few
extra seconds that I may wait waiting for the code to execute. In other
cases, execution speed may be the most important consideration for me. If
this is the case, I probably wouldn't use perl, but I would pay the price
up front developing the code to make the most efficient use of my system's
resources.
Jordyn
|---------------------------------------------------------------|
|Jordyn A. Buchanan jordyn@bestweb.net|
|Bestweb Corporation http://www.bestweb.net|
|Senior System Administrator +1.914.271.4500|
|---------------------------------------------------------------|
------------------------------
Date: Wed, 14 May 1997 13:32:12 -0500
From: "Mark L. Williams" <mlw@zot.ncsc.navy.mil>
Subject: Re: need to send form data to file
Message-Id: <337A052C.2F92@zot.ncsc.navy.mil>
cc003862@mindspring.com wrote:
>
> I am new to Perl. I have been using a cgiemail program (provided by the
> web hosting service I use) in conjunction with my HTML form to have
> customer-submitted information emailed to me. Since I will soon be
> accepting credit card information, I now need to have the customer data
> stored in a file(s) on the secured server and only email me a notice
> that it has arrived. Are there any form-processor scripts available on
> the Internet that are designed to store form data in files? If not, can
> you give me any tips on how I can accomplish this task in a relatively
> short period of time. This is my only Perl need right now. I am not
> expecting a finished script but one that I can learn from and customize
> without needing to design from scratch. Thanks.....Roger
--
CGI::Form module comes to mind. Check CPAN. If you can't find it, go to
www.perl.org and look for the link there.
--
Mark L. Williams
Naval Surface Warfare Center, Dahlgren Division
Coastal Systems Station
------------------------------
Date: 15 May 1997 03:57:03 GMT
From: bcmdco@osfmail.isc.rit.edu (B. Mathis)
Subject: Re: NO NO PERL is NOT CGI and CGI is NOT PERL (was: Re: Private area using Perl/CGI)
Message-Id: <5le1if$5hh$1@news.isc.rit.edu>
In article <337e4c00.391630244@news1.telenordia.se>,
Magnus Bodin <Magnus.Bodin@tychonides.se> wrote:
>Apparantely most people are of just your misunderstanding; namely that
> cgi is totally equivalent to perl and
> perl is totally equivalent to cgi
>
>This is _NOT_ the case.
>There are
>
> * other cgi applications and languages
> * __MANY__ other objects for perl
>
It might be more constructive to explain the difference, rather than
just yelling and screaming that "you are wrong!!"
Perl is a programming language. Something that you use to write a
program. The program is then compiled and run on your machine.
CGI is an application interface specification. It is a *way* to do
something, not the means. You need a specification so you can use
different programming languages to make programs that can talk to each
other.
A good analogy might be that a spoken language (or written) is
English, where the sentence structure [noun, adjective, ...] is the
application interface spec (api). It is conceivable to use the same
sentence structure with different spoken languages.
Brian Mathis
------------------------------
Date: 15 May 1997 03:02:24 GMT
From: $j,u?OE" <swsung.bbs@cis.nctu.edu.tw>
Subject: Parsing a Text File by Perl???
Message-Id: <5lduc0$885@netnews.hinet.net>
Is it easy to write a Perl program for parsing a text file?
If yes, is there a sample program?
Any answers will be highly appreciated.
Truman
------------------------------
Date: Tue, 13 May 1997 10:54:12 -0700
From: "Joseph M. Scott" <jmscott@ainet.com>
Subject: Parsing HTTP header
Message-Id: <3378AAC4.4ADB@ainet.com>
I've been playing with a script that simply requests a web page from
Microsoft's IIS webserver on NT. Interesting enough it returns the HTTP
header only when requesting .idc's. I talked this over with the other
tech here and we thought that it was doing that because there was no
mime-type given for .idc's, where there are for .html's. Anyway, what I
needed to do was to modify my script so that IF an HTTP header was
returned then dump it and return the normal html. After banging my head
for awhile and making serveral assumptions that I'm sure won't always
work, I came up with the following, and thus far it has worked:
while($line = <S>) {
if(($line =~ m/HTTP/i) && ($line !~ m/\</)) {
$header = 1;
while($header) {
$line = <S>;
if($line !~ /\:/) {
$line = <S>;
break;
$header = 0;
}
}
}
print("$line");
}
The thing that really got to me is that it just felt like I should have
been able to do the checking a little bit tighter, but my mastery of
regular expressions is yet to be ( time for another trip to Barnes &
Noble for another O'Rielly book ). Does anyone have some suggestions
for tighting up the testing for this header? Ideally I'd like to be as
fast as possible as far as the perl code is concerned. If that means I
leave it as is, then fine, but I've got a gut feeling that's not the
case.
-=joseph
jmscott@ainet.com=-
------------------------------
Date: Mon, 12 May 1997 16:14:14 GMT
From: c9@pyramid.net (K. Hawkins)
Subject: PERL script autoresponder problems...please take a look.
Message-Id: <5l7fek$7fo2@cirrus.pyramid.net>
I've put together a script that basically reads in form fields and
then depending on what fields are there & their content, will send out
various mail responses to 1,2, or 3 individuals at the same time.
The script seems to run fine...no errors..the page redirects
fine...but no email goes thru. I know the address I'm using to locate
the mail program on my system is correct as I am using it in another
(working) script. Here's an example with one of my subroutines...is
the problem in my "IF" statement? or should I post the entire script?
Thanks...
Kevin
sub per_mail {
if ($remote_mail eq '1' && $FORM{'username'} && $FORM{'perad' eq '1'})
{
open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";
print MAIL "To: $CONFIG{'email'}\n";
print MAIL "From: $CONFIG{'recipient'}\n";
print MAIL "Subject: Thank you .\n\n";
print MAIL
"------------------------------------------------------\n";
print MAIL "Thank you .\n";
print MAIL "Please allow up to 48 hours for a response.";
print MAIL " - $date\n";
print MAIL
"------------------------------------------------------\n";
close (MAIL);
}
}
------------------------------
Date: Wed, 14 May 1997 19:24:45 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Regex problem - removing trailing form input
Message-Id: <d4ldl5.to3.ln@localhost>
Chipmunk (Ronald.J.Kimball@dartmouth.edu) wrote:
: In article <EA4JLC.C9y@ciba-geigy.ch>
: david.holmes@bigfoot.com (David M Holmes) writes:
: > my $testurl = "http://www.here.com/path/to/file/me.html?a=b&c=d";
: > $testurl =~ m/.*?(\?.*)/;
: Once you work out the error you mention below, you'll have another one.
: This line sets $testurl to 1 if the match is successful, '' if not,
^^^^^^^^^^^^^^^^^^^^^^^
-----------------
#! /usr/bin/perl -w
my $testurl = "http://www.here.com/path/to/file/me.html?a=b&c=d";
$testurl =~ m/.*?(\?.*)/;
print "$testurl\n";
-----------------
$testurl looks unchanged to me... ;-)
: because in a scalar context m// returns true(1) or false('').
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 14 May 97 19:48:12 GMT
From: "Brian Shepard" <brian@shepmark.com>
Subject: Rounding Off
Message-Id: <01bc60a8$e65c1d60$0d9dcdcd@default>
I using Windows NT with Perl 5.0.
How do I round off 34.4567 to 34.45?
thanks
Brian Shepard, ShepMark
(416) 267-5985
email: brian@shepmark.com WWW: http://www.shepmark.com
Mail: 18 Ridgemoor Ave, Scarborough, Ontario, Canada M1N 1M4
------------------------------
Date: 14 May 1997 20:46:31 -0600
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Rounding Off
Message-Id: <5ldte7$60m@nova.dimensional.com>
"Brian Shepard" <brian@shepmark.com> writes:
> How do I round off 34.4567 to 34.45?
See the Perl FAQ:
http://www.perl.org/CPAN/doc/manual/html/pod/perlfaq.html
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: Wed, 14 May 1997 22:12:06 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Rounding Off
Message-Id: <6uudl5.rb4.ln@localhost>
Brian Shepard (brian@shepmark.com) wrote:
: I using Windows NT with Perl 5.0.
: How do I round off 34.4567 to 34.45?
That's truncating, not rounding off.
34.4567 rounded off to two decimal places would be 34.46
^
^
s/..$//; # this should truncate it if $_ contains the number to be truncated.
see sprintf() in the perlfunc man page if you want to
really do rounding...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 15 May 1997 03:26:19 GMT
From: "Florence Kuan" <Florence=Kuan%Design%Eng=Sin@netgate.compaq.com>
Subject: running ftp in a Perl script.
Message-Id: <01bc6155$19c9c7e0$a27813ac@FlorenceKuan.asia.compaq.com>
I need to ftp a file from another server while running a Perl program. Does
anyone know how I can pass arguments to the ftp program while running a
Perl program? Is it possible for the Perl program to supply the user
account name, password, and ftp commands to the ftp program so that the
user does not have to enter anything.
I am working on a Unix X-terminal.
Thanx.
------------------------------
Date: Thu, 15 May 1997 04:02:05 GMT
From: "cedric tio" <cedric=tio%design%eng=sin@bangate.compaq.com>
Subject: running ftp in Perl script
Message-Id: <01bc60e4$bf78b460$5378238a@pc1.asia.compaq.com>
I need to ftp a file from another server while running a Perl program. Does
anyone know how I can pass arguments to the ftp program while running a
Perl program? Is it possible for the Perl program to supply the user
account name, password, and ftp commands to the ftp program so that the
user does not have to enter anything.
I am working on a Unix X-terminal.
Thanx.
------------------------------
Date: Tue, 13 May 1997 11:03:27 -0800
From: Russ Poldrack <poldrack@psych.stanford.edu>
Subject: setuid script problems
Message-Id: <3378BAFE.134D@psych.stanford.edu>
I am trying to run a perl script from a bourne shell script that has a
setuid wrapper written in C (in Solaris). Looking at the perlsec man
page and FAQ, it is not clear how to set up the perl script so that it
can do file operations with the proper setuid characteristics. Right now
I get insecure path and insecure dependency errors. any suggestions
would be most appreciated.
Russ Poldrack
poldrack@psych.stanford.edu
------------------------------
Date: Thu, 15 May 1997 01:55:45 GMT
From: Jamesr@tiac.net (James Ringrose)
Subject: Sorting Records
Message-Id: <337a6cf1.2364363@news.tiac.net>
Hi,
I am stuck with a curious problem, see below, any thoughts?
I have a script that uses 'records' to read a text file consisting of
several lines of associated data. This gives me a very controllable
way of accessing each 'record' and it's associated 'fields'.
My problem is in getting the sort function to work on the data. I
previously stored the data in an array and then sorted that array.
However no matter how I fiddle I can not get 'sort' to return a sorted
set of records i.e.
@database = (
{ "Time" => $logdata[0],
"l1" => $logdata[1],
"l2" => $logdata[2],
"l3" => $logdata[3],
"l4" => $logdata[4],
"l5" => $logdata[5]
}
);
$temp = -1;
for ($i=1; $i <= $num_recs; $i++) {
$temp++;
$database[$temp] = {
"Time" => $logdata[($temp*5)+0],
"l1" => $logdata[($temp*5)+1],
"l2" => $logdata[($temp*5)+2],
"l3" => $logdata[($temp*5)+3],
"l4" => $logdata[($temp*5)+4],
"l5" => $logdata[($temp*5)+5]
};
}
sub byalpha {
%{$database[$a]}->{"Time"} cmp %{$database[$b]}->{"Time"}
};
@sorteddatabase = sort byalpha @database;
The result has no particular order, although it is different from the
original order (sorting the pointers perhaps).
Any suggestions or rude remarks about my density welcomed!!! <g>
Regards
James Ringrose :-)
===============================================================
Email: jringrose@tiac.net
===============================================================
------------------------------
Date: Wed, 14 May 1997 13:29:56 -0500
From: "Mark L. Williams" <mlw@zot.ncsc.navy.mil>
Subject: Re: String Float to Machine Float
Message-Id: <337A04A4.2843@zot.ncsc.navy.mil>
sgtrupia wrote:
>
> How can the ASCII string version of a single
> precision floating point number be converted
> to its actual value?
>
> Thank you,
> sgtrupia@oakland.edu
--
A quick test makes it look like PERL will do what you need all by itself
based on context, which is what I thought but a test is always nice. I
keep a little try-it-out spot around for answering my own questions like
this.
--
Mark L. Williams
Naval Surface Warfare Center, Dahlgren Division
Coastal Systems Station
------------------------------
Date: Wed, 14 May 1997 12:34:04 -0500
From: "Mark L. Williams" <mlw@zot.ncsc.navy.mil>
Subject: Re: type casting
Message-Id: <3379F78C.260@zot.ncsc.navy.mil>
John Doe wrote:
>
> Is there any way to type cast a variable as double precision? - not
> "bigflaot".
The Blue Camel book says "Perl stores numbers as signed integers if
possible, or as double-precision floating-point values in the machine's
native format otherwise." [copyright ORA and all that] Sounds like you
can get what you want by having fractional or big (maybe not huge)
values.
--
Mark L. Williams
Naval Surface Warfare Center, Dahlgren Division
Coastal Systems Station
------------------------------
Date: Tue, 13 May 1997 13:29:31 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Sarah Burcham <sarah@ecl.wustl.edu>
Subject: Re: Undump Question...
Message-Id: <Pine.GSO.3.96.970513132459.4466G-100000@kelly.teleport.com>
On Sun, 11 May 1997, Sarah Burcham wrote:
> I'm trying to speed up some of my perl code by getting it into an
> executable binary and am looking for some advice if anybody can help.
That's not a very good way to make it faster; you're likely to increase
the speed much more by improving any slow algorithms. Of course, you could
then compile your improved code.... :-)
You also might consider making a module for any time-consuming operation.
That will give you more flexibility as well as speed.
> As found in the perlrun docs, perl has a -u option which supposedly will
> dump core. That's great -- where does it leave this core file? I'm on
> a Solaris system and have looked in the current working directory, the
> root directory, /var/tmp, and /tmp.
You're ulimit is probably set to keep you from saving core dumps. Check
how your shell sets ulimit (some shells call it 'limit'). "man limit" may
work for you.
Of course, you may not get anywhere with undump. I'd use the compiler
instead, if you must. Good luck!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Wed, 14 May 1997 21:04:49 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Weather Forecasts via perl
Message-Id: <fl_aggie-ya02408000R1405972104490001@news.fsu.edu>
In article <82zptx3gk2.fsf@shell2.shore.net>, Jay Rogers <jay@rgrs.com> wrote:
+ $t = new Net::Telnet (-host => "rainmaker.wunderground.com");
This script gives me the following error:
Can't locate object method "new" via package "Net::Telnet" at
forecast.pl line 6
I just installed libnet 1.0502, along with Data Dumper 2.07. Apparently
no problems where encountered. Did I goof something??
James
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Wed, 14 May 1997 21:09:03 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Weather Forecasts via perl
Message-Id: <fl_aggie-ya02408000R1405972109030001@news.fsu.edu>
In article <33766345.1166A14D@cs.rpi.edu>, "G. Bowden Wise"
<wiseb@cs.rpi.edu> wrote:
+ has anyone any weather forecast scripts in perl?
No, but I do have a script that fetches the NHC marine hurricane
advisories, makes a plot (by way of IDL program) of the previous
positions and the forecast track, and puts it on the web.
Its probably not as smooth and elegant as it could be, tho. But if any
one wants it, they may have it.
James
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: 15 May 1997 01:16:31 GMT
From: siler@compstat.wharton.upenn.edu (Jack Siler)
Subject: Re: Weather Forecasts via perl
Message-Id: <5ldo5f$1pk@netnews.upenn.edu>
I went to some trouble to get rid of extraneous matter.
#!/usr/bin/perl
use lib "/home/siler/CPAN/lib/site_perl";
$URL=qq!http://www.wunderground.com/forecasts/PHL.html!;
$MAP=qq!\<img src="http://www.cnn.com/WEATHER/accu.data/nesat.gif"\>!;
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$res=$ua->request(new HTTP::Request 'GET',$URL);
$str=$res->content;
$str =~ s/\/webtv/http:\/\/www.wunderground.com\/webtv/g;
$str =~ s/\/graphics/http:\/\/www.wunderground.com\/graphics/g;
$str =~ s/\/forecasts/http:\/\/www.wunderground.com\/forecasts/g;
$str =~ s/\<p\>\<center\>\<hr\>Back.*vania\<\/a\>\<hr\>\<\/center\>//s;
$str =~ s/\<!-- AD --\>.*\<!-- AD--\>//s;
$str =~ s/\<hr\>\nView the.*forecast\.//s;
$str =~ s/\<hr\>\<A HREF=.*ISMAP\>\<\/a\>\<hr\>/\<br\>/s;
$str =~ s/\<\/center\>\<hr\>\<\/body\>/\<br\>\<hr\>$MAP\<\/center\>\<\/body\>/;
print "Content-Type: text/html\n\n";
print $str;
siler@wharton.upenn.edu
------------------------------
Date: 15 May 1997 03:45:55 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Weather Forecasts via perl
Message-Id: <5le0tj$jgi$1@news.netusa.net>
Jack Siler <siler@compstat.wharton.upenn.edu> wrote:
>I went to some trouble to get rid of extraneous matter.
This is my favorite out-of-context quote of the week.
Elijah
------
wondering the wisdom of perl meteorology
------------------------------
Date: Wed, 14 May 1997 16:43:20 -0700
From: Michael Levasseur <levass@gdesystems.com>
Subject: What is "socket.ph" and where can I get it?
Message-Id: <337A4E18.4830@gdesystems.com>
I'm trying to do some FTP inside of a Perl script. When
I try running the script "ftp.pl" in perl 5, I get an
error that it can't find "socket.ph". I've gone to CPAN
and read the notes on IPC. Is "socket.ph" part of Perl
or is it part of my OS? If it's part of perl, does anyone
know of where I can get it?
Thanx for the help....
------------------------------
Date: Tue, 13 May 1997 19:40:02 GMT
From: "Carol C. Kankelborg" <csc80@amdahl.com>
To: sysmm@smtp.ais.ucla.edu
Subject: Re: Year 2000 compliance
Message-Id: <3378C392.41C67EA6@amdahl.com>
Susan Malisch wrote:
>
> We have several scripts in production using perl 5.001. Has anyone seen
> any mention of Year 2000 compliance or issues with perl? We are trying
> to determine how much work/installations/upgrades we have outstanding in
> preparation for the millenium change. I'd appreciate a direct response
> to my email address so I don't miss any postings.
>
> Thanks for any information on this,
> Susan Malisch
> sysmm@smtp.ais.ucla.edu
Susan,
I believe the new FAQ addresses this one. The localtime function
in perl returns a year value which is (year - 1900), so the year
2001 will return 101. (Nowhere does it say it has to be a two-digit
number.) The place to look out for Year 2000 problems is in code
which assumed a two-digit field. For example:
$year = (localtime(time))[5];
$year_four_digit = "19$year"; # This will give 19101 for 2001.
$year_four_digit = 1900 + $year; # This will give the right answer
Good luck.
**********************************************************************
*** Carol C. Kankelborg csc80@amdahl.com ***
*** Amdahl Corporation The above opinions are uniquely mine. ***
**********************************************************************
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 479
*************************************