[7450] in Perl-Users-Digest
Perl-Users Digest, Issue: 1075 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 25 00:18:01 1997
Date: Wed, 24 Sep 97 21:00:22 -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, 24 Sep 1997 Volume: 8 Number: 1075
Today's topics:
Re: Array or Hash? <sriram@weblogic.com>
Can't See Pattern (Steve Bowen)
Re: Deleting Files (Jeff Stampes)
Determining if a method is defined for an object <mgregory@asc.sps.mot.com>
Re: File name changing under NT <jefpin@bergen.org>
get DOS perl to ignore EOF/SUB chars (Eric Pement)
Re: Getting backreferences from global pattern match? (Sean McAfee)
Re: Getting backreferences from global pattern match? <bholzman@mail.earthlink.net>
Re: Help! <mcohen@acm.org>
Re: Ignoring text in tags with ~s <bholzman@mail.earthlink.net>
incrementing array names <gary@econ.Berkeley.EDU>
Insecure dependency in unlink while running with -T swi (Faust Gertz)
Re: Learning Perl for CGI on the WWW (Faust Gertz)
List of aliases <joegottman@worldnet.att.net>
Need Help With Search/Replace sysdev5@hotmail.com
Re: Perl <=> C Server (dave)
Re: Reading files (newb) (Mike Stok)
Re: Regular Expressions: Negating bracketed strings <jefpin@bergen.org>
system call on NT 4.0 <sght@intouch-software.com>
Where is HTTP::Request::Common ? <byron@teleport.com>
win32 perl gpfs on windows exit <moore@access.digex.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 24 Sep 1997 18:25:34 -0700
From: Sriram Srinivasan <sriram@weblogic.com>
To: Andy Smith <asmith@hsonline.net>
Subject: Re: Array or Hash?
Message-Id: <3429BD8E.F5813743@weblogic.com>
Andy Smith wrote:
>
> Why is perl trying to make a hash out of @services?
>
> @services={"witha","smile","anda","one","two",};
You are assigning a hash-reference to a list. You need
parentheses, not curlies:
@services=("witha","smile","anda","one","two");
- Sriram
________________________________________________________________________
Principal Engineer WebLogic, San Francisco www.weblogic.com
"Advanced Perl Programming" : http://www.ora.com/catalog/advperl/
------------------------------
Date: Thu, 25 Sep 1997 01:25:12 GMT
From: steveb@cottagesoft.com (Steve Bowen)
Subject: Can't See Pattern
Message-Id: <342abd71.2366539@news.cottagesoft.com>
I'm pulling my hair out, trying to figure why Perl can't see the following:
open (IN, $ARGV[0]) or die "Can't open $ARGV[0].\n";
while (<IN>) {
if (/.+(..):(..):(..)/s) { # This is proving FALSE (with or without
# /s), thus
$hour = $1; #can't see
$minute = $2; #ditto
$second = $3; #ditto
}
...more stuff that all parses without error.
The line I'm trying to match is this:
Sat Jun 7 14:14:53 1997
which is almost an exact match to the example given in both man perlre, and
Programming Perl:
if (/Time: (..):(..):(..)/) {
I need the exact time from this line, and I can't get it. This has got to
be simple, but I just don't see it! Help please.....
Steve Bowen
steveb@cottagesoft.com
------------------------------
Date: 24 Sep 1997 23:46:07 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Deleting Files
Message-Id: <60c8nv$6rd$1@neocad.com>
Dan Kogai (dankogai@dan.co.jp) wrote:
: If you are uncontent with the name of the function (note delete()
: deletes a hash entry), You can still use system(). This is often
: convenient when you want to delete entire directory.
Or you could
use File::Path;
rmtree $foo;
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: 24 Sep 1997 13:35:13 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Determining if a method is defined for an object
Message-Id: <r8202fmk5i.fsf@asc.sps.mot.com>
Suppose you have (a reference to) and object in $obj and the name of a
method in $method.
I'm interested in how you could determine whether the method is
defined for the object. I'm especially interested if it can be done
without symbolic references.
I have seen one solution (which uses symbolic references and
catenation). But it doesn't feel that satisfying.
The fact that $obj->$method is an invocation and not a dereference is
so sad (in this context), because it means that you can't look and see
if the 'reference' is defined....
Is there some other way that I could have (a representation of) the
method (other than a name in a string) that would result in a
different problem that has a more satifying solution? ( :-) )
Martin.
------------------------------
Date: Wed, 24 Sep 1997 20:28:13 -0400
From: TechMaster Pinyan <jefpin@bergen.org>
To: Andrew <Andrew@here.com>
Subject: Re: File name changing under NT
Message-Id: <Pine.SGI.3.95.970924202558.2312A-100000@vangogh.bergen.org>
>I want to take the input filename, strip off the extension, and then put a
>new one on. I've included my solution below. It works, but I want to know
>how I could have done it better.
>
>#! /usr/bin/perl
># Usage: generic.perl <input_file>
>$input = $ARGV[0];
>$output = $input; # Get input filename from command line
>while ($strip ne ".") # Keep removing characters from the end of the
>filename until
> { # the file extension is gone
> $strip = chop($output);
> }
>$output = ">" . $output . ".txt";
#! /usr/bin/perl
# Usage: generic.perl <input_file>
$input = $ARGV[0];
$output = $input;
# simplified could be $output = $input = shift;
$output =~ s/\..+$/.txt/;
$output = ">$output";
I think this is a nicer one... any comments?
----------------
| "WYSIWYG? More like WUSSIWYG... Text Editors Rule!!!"
| - Jeff Pinyan
----------------
Jeff Pinyan | http://users.bergen.org/~jefpin | jefpin@bergen.org
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
** I can be found on #perl on irc.ais.net as jpinyan **
- geek code -
GCS/IT d- s>+: a--- C+>++ UAIS+>$ P+++$>++++ L E--->---- W++$
N++ !o K--? w>+ !O M>- V-- PS PE+ !Y !PGP t+ !5 X+ R tv+ b>+
DI+++ D+>++ G>++ e- h- r y?
------------------------------
Date: 25 Sep 1997 00:21:43 GMT
From: epement@ripco.com (Eric Pement)
Subject: get DOS perl to ignore EOF/SUB chars
Message-Id: <60caqn$n4j$2@gail.ripco.com>
I'm using the MS-DOS port of perl v 4.0M4 and 5.003, and have discovered
that perl stops processing when it finds an EOF char (SUB, Ctrl-Z, 0x1A)
embedded in a textfile. I would like perl to ignore the EOF/SUB character
and not stop when it encounters it. Any ideas of how to do this with
perl? I'm using 4DOS v5.52 if it means anything. A reply by e-mail, in
addition to a post to this newsgroup, would be appreciated.
--
Eric Pement <epement@jpusa.chi.il.us>
------------------------------
Date: 25 Sep 1997 03:23:50 GMT
From: mcafee@stargate.rs.itd.umich.edu (Sean McAfee)
Subject: Re: Getting backreferences from global pattern match?
Message-Id: <60clg6$8u3$1@newbabylon.rs.itd.umich.edu>
In article <60bggt$sm1$1@newbabylon.rs.itd.umich.edu>, I wrote:
>My code was eventually going to look like what I posted above. To reassure
>myself that it worked, I entered this on the command line:
>perl -ne 'while (/A:(\S+) B:(\S+)/g) { print "'$1', '$2'\n"; }'
[insert sound of anguished, echoing "D'OHHH!!!"]
As was pointed out to me in e-mail, my mistake was in using single quotes
on the command line within a Perl script which was already being set off
with single quotes. Thus, the shell got to interpret the variables $1 and
$2 instead of Perl, and dutifully replaced them with null strings.
Shame on me! I should know better than that.
--
Sean McAfee | GS d->-- s+++: a25 C++ US+++$ P+++ L E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ | mcafee@
| R+ tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: Wed, 24 Sep 1997 22:16:52 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: Sean McAfee <mcafee@gorf.rs.itd.umich.edu>
Subject: Re: Getting backreferences from global pattern match?
Message-Id: <3429C994.209EDE09@mail.earthlink.net>
> myself that it worked, I entered this on the command line:
>
> perl -ne 'while (/A:(\S+) B:(\S+)/g) { print "'$1', '$2'\n"; }'
^::::::::::::::::::::::::::::::::::::^ ^::^ ^::::::^
The parts with the ::s are what perl is seeing. The stuff outside is
what the _shell_ is seeing. $1 and $2 were being interpolated by the
shell, since the ' character was ending the string, as far as the shell
was concerned...
Hope this helps!
Benjamin Holzman
------------------------------
Date: Wed, 24 Sep 1997 22:02:51 -0400
From: Martin Cohen <mcohen@acm.org>
To: Christopher Pieper <cmpiep@maila.wm.edu>
Subject: Re: Help!
Message-Id: <3429C64B.157@acm.org>
The bulk of the book is Chapter 3 Perl Functions in Alphabetical Order.
Start with opendir on page 195, then readdir. Or, you could open a pipe
to find (if you are using a unix system); see the open function. When
you have a file (whose name is in $file) to process, use something like
this:
open(FILE,"<$file") or die "Can't open $file - $!\n";
open(NEW,">$file.new") or die "Can't open $file - $!\n";
while(<FILE>) {
print NEW "<li> $_ </li>\n"; # or whatever
}
Definitely read about the print function.
Christopher Pieper wrote:
>
> I am a beginner when it comes to the perl language and well I have already
> been asked to write my first program to help out a professor. Anyway he
> wants me to write a script that will convert a whole group of files located
> within a large and complex directory tree from text files to html.
> Basically he has a ton of files spread out over several directories and he
> wants be to put the appropriate html tags in front and at the end of these
> documents and then rename the final file to include the html extension. Now
> I know how to change the file but it is the process of going through all
> the files in a directory and then switching directories that has me
> baffled. I know that I could find it in my newly acquired text "Programming
> Perl" by Orielly, however I just can't seem to find it amongst the other
> stuff.
>
> Please help a blind man out! (That is just figurative by the way!)
>
> Chris
--
Martin Cohen, 900 Valley Rd #D203, Melrose Park, PA 19027-3228,
mcohen@acm.org
------------------------------
Date: Wed, 24 Sep 1997 22:08:50 -0400
From: Benjamin Holzman <bholzman@mail.earthlink.net>
To: minibbjd@cs.tu-berlin.de
Subject: Re: Ignoring text in tags with ~s
Message-Id: <3429C7B2.91A8A66F@mail.earthlink.net>
[posted & mailed]
> After the search is done, the user gets the pages with hits as
> the result and the search terms are colored in red:
>
> $mline =~ s#$QS_query#<FONT COLOR="red">$&</FONT>#go;
>
> This works fine, but unfortunetly this is always done, even
> when the search term is inside a tag, e.g.
> Is there a simple way (regular expresions?) to color only
> search terms that are outside tags?
Well, you could append '(?=[^>]*<)' at the end of $QS_query, which would
constrain the match to things which are not inside tags (because it
_must_ match an open angle bracket _before_ matching a close angle
bracket). Because HTML documents should end with </html>, it should
work even for the last piece of text you want to match. But there's a
few small problems. Newlines will totally screw it up, in two separate
ways. For one, if there is a possible match but no start tag on that
line, we won't find it. That we could fix by changing the appended
pattern to '(?=[^>]*(?:<|$))', but that leads us right into the second
problem-- what if there's a possible match _inside_ a tag, and the tag
doesn't close until the next line. If you think about that for a
moment, you'll see that no matter what we do, we need to be matching
against the WHOLE string, not a line-at-a-time. Well, actually, we
could keep state information between invocations that said whether or
not we were in the middle of a line, but I think that might be a tad
more complicated, albeit possibly more efficient. In any event, this
should give you the desired effect, assuming that $html contains the
entire text:
$html =~ s#($QS_query)(?=[^>]*<)#<FONT COLOR="red">$1</FONT>#gosi;
Hope this helps!
Benjamin Holzman
------------------------------
Date: Wed, 24 Sep 1997 19:39:05 -0700
From: Gary Richardson <gary@econ.Berkeley.EDU>
Subject: incrementing array names
Message-Id: <Pine.SOL.3.95q.970924192410.12308A-100000@emily8.Berkeley.EDU>
Help!
I am a new Perl user.
I am trying to figure how to increment array names in a for loop.
I want to make 1000 arrays labled @output1 to @output1000.
@output1 is a split line of text from another array, @input.
The lama and camel books tell me how to access each element
of the @input array, but they don't tell me how to increase
the number of my output array each time I pass through the loop.
The following works for one line
@output1 = split(/\s/,@input[1]) ;
I am hoping that a command like
for $i (0..1000) {@output$i = split(/\s/,@input[$i])} ;
would work for all 1000 lines.
Thanks for any light you could shed on my problem.
Perl novice
Gary Richardson
gary@econ.berkeley.edu
------------------------------
Date: Thu, 25 Sep 1997 01:38:04 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Insecure dependency in unlink while running with -T switch
Message-Id: <3429bdce.15626437@news.wwa.com>
The following is a bit of code from a larger CGI script that seems to
cause an 'Insecure dependency in unlink while running with -T switch'
error.
:#!/usr/local/bin/perl -Tw
:use strict;
:$ENV{'PATH'} = '/user/bin:/bin'; # Set PATH for the kids
:my ($STATE_DIR) = './STATES/state.'; # Set place for state maintaining files
:
:&clean_up;
:
:exit (0);
:
:sub clean_up {
:
:# Iterate over the $STATE_DIR glob (state maintaining files begin with 'state.'),
:# if the file hasn't been modified in over a day, delete it or warn.
:
: for (glob ("$STATE_DIR*")) { (-M $_ < 1) || unlink || warn "$0 is having trouble deleting $_: $!" }
:}
It seems to do what I want when taint checking is disabled, but I
would prefer to rewrite it to work with taint enabled. Is there any
way to do that and, if not, what is the safest way to handle this kind
of subroutine?
BTW . . . Deleting the files in a cron job is probably not an option
for me. :-)
TIA
Faust Gertz
Philosopher at Large
------------------------------
Date: Thu, 25 Sep 1997 01:56:55 GMT
From: faust@wwa.com (Faust Gertz)
Subject: Re: Learning Perl for CGI on the WWW
Message-Id: <342ac15d.16536983@news.wwa.com>
On Tue, 23 Sep 1997 21:09:51 +0000, idiot
<copright_infringement@jerk.com> wrote:
>I am a complete novice when it comes to Perl. Although I understand a
>few of the basic HTML tags I am also not a programmer of any sort.
You are not alone and nice name.
>I wish to learn some Perl in order to write cgi scripts for a website
>and am looking for resources for the rank beginner. Everything I have
>seen so far is way over my head. I did find one book--Introduction to
>CGI/Perl by Brenner and Aoki that was great, at least up to page 28
>where it became incomprehensible to me.
Hmmm . . . . Have you considered hiring a consultant?
>Can anyone recommend some ultra basic resources: books, websites or
>classes (I9m in Berkeley California)?
The fast and dirty way is to look at _CGI Programming Techniques in
Perl_
(http://www.eff.org/%7Eerict/Scripts/Book/Mis/appendix_a.html), Nick
Kew's 'CGI Programming FAQ'
(http://www.webthing.com/page.cgi/cgifaq), and 'CGI.pm - a Perl5 CGI
Library'
(http://www-genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html).
These are the resources which will give you the most help getting off
the ground with perl for CGI, but I can't say I recommend starting or
stopping there. You need to understand both CGI and perl. So, as far
as the perl goes (even for CGI stuff), I still recommend Randal and
Tom's _Learning Perl_ (known as the Llama book). The second edition
ends with a chapter on Lincoln Stein's CGI module. Please note, the
book *ends* with the CGI module and the book was designed to be read
from the front to the back. Thus, it is going to take some non-CGI
work to get your perl skills up to speed so you can do CGI scripting
in perl. Also, Eric Johnson's _Cross Platform Perl_ is an excellent
book and has a chapter (towards the end) devoted to CGI scripting and
the Lincoln Stein's CGI module. If you are too cheap to buy books,
the Perl Reference Page has a list of some online tutorials at
http://reference.perl.com/query.cgi?tutorials
The best of the bunch, IMHO, are _Introduction to Perl Programming (
perl 5 )_ at http://www.erdw.ethz.ch/~kistler/perl/intro.html and
_Introduction to Perl or, Learn Perl in Two Hours_ at
http://www.cclabs.missouri.edu/things/instruction/perl/perlcourse.html
Yet, I still think you should buy the books. :-)
As far other recommendations for learning perl go, I like the
recommendations in the FAQ
(http://language.perl.com/faq/index.html).
At this point, I usually quote from the FAQ, but I'll let you look it
up on your own. The only other thing I'll mention is that _Camel
Critiques_, as mentioned in the FAQ, has moved from
http://www.perl.com/perl/critiques/index.html to
http://language.perl.com/critiques/index.html
HTH
Faust Gertz
Philosopher at Large
------------------------------
Date: Wed, 24 Sep 1997 21:51:25 -0400
From: Joe Gottman <joegottman@worldnet.att.net>
Subject: List of aliases
Message-Id: <60cg93$o1q@bgtnsc03.worldnet.att.net>
Hello,
I'm writing a perl script and I need to get a list of the aliases
that are defined for the shell I am calling the script from. I tried
using `alias` with backticks, but this resulted in a list of aliases
completely different from what I got when I called alias from the
command line (apparently Perl starts a new shell and defines its own
aliases). How do I get Perl to list the aliases I want?
Joe Gottman
------------------------------
Date: Wed, 24 Sep 1997 19:41:21 -0600
From: sysdev5@hotmail.com
Subject: Need Help With Search/Replace
Message-Id: <875147379.18850@dejanews.com>
I am designing a program that opens HTML files, strips away the HTML
tags,
and prints the result. Stripping body tags, break tags, and paragraph
tags
is easy. However, if the tags have attributes such as <TABLE
WIDTH="20"
BORDER="3">, it becomes more difficult. Sometime the tags are broken
by
newline characters, leaving the begining portion on one line and the
reamining portion on other lines. Harder still.
Any ideas on how to strip away all HTML from a file?
Please respond to sysdev5@hotmail.com. Any help would be great.
Thanks.
Jerry Bradenbaugh
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Thu, 25 Sep 1997 00:23:53 GMT
From: over@the.net (dave)
Subject: Re: Perl <=> C Server
Message-Id: <3429ade4.1080319@news.one.net>
Doug Seay <seay@absyss.fr> wrote:
>Andrew M. Langmead wrote:
>>
>> gmui@jpmorgan.com (Gary Mui) writes:
>>
>> >Is it possible to have a perl program talk to a server written
>> >in C that reads and writes normal C structures (as opposed
>> >to parseable text)?
>>
>> Otherwise take a look at the "pack" and "unpack" functions. Something
>> like this:
>>
>> struct foo {
>> char name[32];
>> int id;
>> };
>>
>> could be converted like this:
>>
>> ($name, $id) = unpack 'A32I', $data;
>
I'm surprised that this works for you. Exactly how does Perl know the
last valid character in the name?
Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________
------------------------------
Date: 25 Sep 1997 00:38:03 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Reading files (newb)
Message-Id: <60cbpb$hu4@news-central.tiac.net>
In article <60c6tm$bsu$1@news.interlog.com>,
Tom MacMillan <richmacr@interlog.com> wrote:
>Sorry to bother you with this but I'm really confused about reading files... I
>know how to open it in Input mode, etc... but what I'd like to do is open a
>file, and read each line of the file into a separate variable or element of an
>array. If you could help me I'd really appreciate it.
If FH is a successfully opened input file handle then
@line = <FH>;
will read each record in the file into an element of @line, so $line[0]
will be the first line of the file (assuming you hadn't read from FH yet)
as perl's default record separator is the end of line sequence.
chomp (@line = <FH>);
will chomp off the end of line sequeence from the elements of @line for
you too.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Wed, 24 Sep 1997 20:33:06 -0400
From: TechMaster Pinyan <jefpin@bergen.org>
To: John Edwards <jde@tomedii.demon.co.uk>
Subject: Re: Regular Expressions: Negating bracketed strings
Message-Id: <Pine.SGI.3.95.970924202907.2312C-100000@vangogh.bergen.org>
>I want to find every occurrence of ABC _not_ followed by XX\d+ (e.g.
>ABCXX123 is fine, ABCXY123 is not). I tried using this:
>
>/ABC[^(XX\d+)]/
>
>which doesn't work - I guess everything within [] is just being treated
>as a character class, so the parentheses and + lose their meta-ness.
um... ABCXX123 is FINE? but by your regex, it looks like you DON'T want
XX\d+
well... this should work:
/ABC(?!XX\d+)/
The (?!...) is the negative look-ahead operator... it means: when whatever
is NOT followed by whatever is here in parens ().
The opposite is (?=...). it means: when whatever IS followed by whatever
is here in parens ()...
check out "man perlre" for more on this.
----------------
| "I don't contemplate it, I just sit and think about it."
| - Sonia Balsky
----------------
Jeff Pinyan | http://users.bergen.org/~jefpin | jefpin@bergen.org
webXS - the new eZine for WebProgrammers! TechMaster@bergen.org
Visit us @ http://users.bergen.org/~jefpin/webXS
** I can be found on #perl on irc.ais.net as jpinyan **
- geek code -
GCS/IT d- s>+: a--- C+>++ UAIS+>$ P+++$>++++ L E--->---- W++$
N++ !o K--? w>+ !O M>- V-- PS PE+ !Y !PGP t+ !5 X+ R tv+ b>+
DI+++ D+>++ G>++ e- h- r y?
------------------------------
Date: Wed, 24 Sep 1997 18:20:00 -0700
From: Steve Tom <sght@intouch-software.com>
Subject: system call on NT 4.0
Message-Id: <3429BC3F.3307B029@intouch-software.com>
We trying to execute a CGI script:
system ("dir > out");
and we get "no file or directory". We also tried, system("dir >");
so it looks like the shell is not interpeting the ">"?
Any idea how we can fix this problem?
Seems to work when it's not run as a cgi script.
We're using Netscape fasttrack 2.0.1.
Thanks,
steve
--
Steve Tom
Intouch Software, Inc.
Voice: 408-278-9457; Fax: 408-975-0663
sght@intouch-software.com; http://www.intouch-software.com
------------------------------
Date: Wed, 24 Sep 1997 16:54:28 -0700
From: Byron Stuart <byron@teleport.com>
Subject: Where is HTTP::Request::Common ?
Message-Id: <3429A834.694DBBF9@teleport.com>
This isn't a CGI script yet, but I'm working up to it. I
modified an example script from lwpcook (pointed out to me by
Gisle Aas). I've used LWP::Simple, and that works. I've used
LWP::UserAgent, and that works. But for this script, I need to
use the POST method to send a "form" to a CGI application on
another web site, so I need to use HTTP::Request::Common. I'm
trying to test it using Seattle Times web site, but every time I
try to execute, I get this error:
Can't locate HTTP/Request/Common.pm in @INC at wwwtest.pl line
8.
BEGIN failed--compilation aborted at wwwtest.pl line 8.
Where is HTTP::Request::Common ? What am I doing wrong? Any
help/debuging would be great.
Byron
Here is the script: (it's also at
http://www.teleport.com/~byron/wwwtest.pl)
1: #!/usr/bin/perl -w
2:
3: # This script should search Seattle Times classified ads,
4: # automotive section, for any ads containing the word
'truck'.
5: # This script should work exactly like the search form on
the
6: # web site (http://www.seattletimes.com/classified/autos/).
7:
8: use HTTP::Request::Common qw(POST);
9: use LWP::UserAgent;
10:
11: $UsrAgnt = new LWP::UserAgent;
12:
13: my $req = POST 'http://www.seatimes.com/bin/iatoc',
14: [ NS-max-records = 25, #Number of ads to return.
15: NS-search-type = 'boolean', #Find ads with exact
matches.
16: NS-collection = 'autos', #Find ads in 'autos'
section.
17: NS-query.1 = 'truck', #Find ads with 'truck' in
them.
18: NS-query-op.2 = 'AND', #'AND' search words
together.
19: NS-query.2 = 'checked' #Search all ads since
Sunday.
20: ];
21:
22: print $UsrAgnt->request($req)->as_string;
------------------------------
Date: Wed, 24 Sep 1997 20:12:30 -0400
From: "Jim A. Moore" <moore@access.digex.net>
Subject: win32 perl gpfs on windows exit
Message-Id: <3429AC6E.5945@access.digex.net>
I'm runinng a perl program as a system monitor
on a Windows95 box.
while (1) {
print "Pinging\n";
system("ping my.host.com");
sleep(60*60);
}
When Windows95 goes to reboot, this process terminates
with a GPF (for winoldap??).
Is anyone using win32 perl in such a way and rebooting
while a win32 program is in execution?
Also, how can I run my win32 perl without getting a console
window generated so it is treated like a MSDOS process?
Tyring to use perl the Right Way instead of conforming
to Win95....
Jim
------------------------------
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 1075
**************************************