[16689] in Perl-Users-Digest
Perl-Users Digest, Issue: 4101 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 23 00:05:43 2000
Date: Tue, 22 Aug 2000 21:05:23 -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: <967003521-v9-i4101@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 22 Aug 2000 Volume: 9 Number: 4101
Today's topics:
Re: Building Anonymous Hashes <philipg@atl.mediaone.net>
Re: CGI.pm - object-oriented - file upload problem (David Efflandt)
Re: CGI.pm - object-oriented - file upload problem <timewarp@shentel.net>
Re: Direct screen access <philipg@atl.mediaone.net>
Re: flock() does not work on HP-UX <bwalton@rochester.rr.com>
Re: help with simple regexp - does my head in <tina@streetmail.com>
Re: how can I use perl to get a website? <feiyun-arthur.wang@nokia.com>
Re: HTTP redirection problem (David Efflandt)
Re: HTTP redirection problem <philipg@atl.mediaone.net>
Re: I =?iso-8859-1?Q?haven=B4t?= exleined the problem c <bwalton@rochester.rr.com>
Re: long-to-short dir/filenames (Eric Bohlman)
Re: Lotsa difiiculties - need help with my Perl !! <mischief@motion.net>
multi-line reg exp deletion <betsamaarcra@mindspring.com>
Re: multi-line reg exp deletion <bwalton@rochester.rr.com>
Re: Problem with PPM working <bwalton@rochester.rr.com>
Re: regexing html-like tags <callgirl@la.znet.com>
Re: regexing html-like tags <blair@geo-NOSPAM-soft.org>
Re: regexing html-like tags <blair@geo-NOSPAM-soft.org>
Re: Sitescooper in Mandrake <philipg@atl.mediaone.net>
Re: Sitescooper in Mandrake <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Aug 2000 02:16:44 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Building Anonymous Hashes
Message-Id: <guGo5.10095$km2.2230217@typhoon-news2.southeast.rr.com>
Steven Merritt <smerr612@mailandnews.com> wrote in message
news:8nutsi$ieq$1@nnrp1.deja.com...
<snip>
> $Record = ();
As Marcel pointed out, you are mixing hash syntax with hashref syntax. To
create an empty hashref, assign an empty set of curly braces ({}) to a
scalar, not an empty set of parentheses.
hth
Philip
------------------------------
Date: Wed, 23 Aug 2000 01:06:43 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: CGI.pm - object-oriented - file upload problem
Message-Id: <slrn8q68st.dvu.efflandt@efflandt.xnet.com>
On Wed, 23 Aug 2000 02:29:13 +0200, Peter Mooring <peterpm@xs4all.nl> wrote:
>Hi,
>I want to upload files using CGI.pm in object-oriented style, i.e. using:
>new CGI, $query->param, etc.
>(the function-oriented style works but I cannot use it)
>The documentation says that it can be done if you get the upload param in
>the same module
>where the use CGI.pm statement is.
>Still I just don't get a value returned from $query->param('upload') after
>submitting a file from a
>browser.
>I'm stuck here.
>Anybody any suggestions?
Not sure why you say function method works, but you cannot use it.
If you are using object oriented style, the question is do you have the
following statement somewhere between the 'use CGI;' and retieving the
$query->param?
$query = new CGI;
I saw someone that made the mistake of repeatedly doing that in a loop,
but you only do the 'new CGI' once to get all of the form data, regardless
of how many file upload fields you have in the form.
Also note that $query->param('upload') can be accessed any number of times
as a filename, but can only be read once as a filehandle, so save it when
you read it.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Tue, 22 Aug 2000 22:03:46 -0400
From: Albert Dewey <timewarp@shentel.net>
Subject: Re: CGI.pm - object-oriented - file upload problem
Message-Id: <39A33102.C2ACE2CA@shentel.net>
Here is a sample page in html that will upload a single file to the server -
Note the enctype=multipart/form-data
-------------------------------------------------------------------------
<html>
<head>
<title>Upload A File</title>
</head>
<body>
<br>
<center>
<h1>Upload a file</h1>
<form name=form1 method=post enctype=multipart/form-data action=uploadfile.cgi>
<b>Select a file to upload</b>
<br>
<input type=file name=file size=40>
<br><br>
<input type=submit value=Upload File>
</form>
</body>
-------------------------------------------------------------------------
Here is a Perl script to receive this file and name it to filename.txt. Ideally
you would use some server side method to create a unique name for the file as
you do not want to depend on the user having an acceptable name for the file
they are uploading.
-------------------------------------------------------------------------
#!/usr/bin/perl
use CGI qw/:standard/;
$CGI::POST_MAX=1024 * 450;
## The above limits the file size to 450K
## Useful to prevent a DoS attack on your server
## and it just plain makes sense.
print "Content-type: text/html\n\n";
$File = param('file');
open(FILE,">../files/filename.txt") or print "ERROR 404: Error uploading file
because $!<br>";
while(read($File,$data,1024))
{
print FILE $data;
}
close(FILE);
print ("<html><head><title>Success</title></head><body>\n");
print ("<font size=+1><b>You have succeessfully uploaded a
file!</b></font>\n");
print ("</body></html>");
exit;
-------------------------------------------------------------------------
Okay to you flamers out there - I know that I don't use strict here and my error
message is not what some of you like to use. I use my methods and you use yours.
If you find a genuine syntax error then post a correction please.
Thanks -
Albert Dewey
David Efflandt wrote:
> On Wed, 23 Aug 2000 02:29:13 +0200, Peter Mooring <peterpm@xs4all.nl> wrote:
> >Hi,
> >I want to upload files using CGI.pm in object-oriented style, i.e. using:
> >new CGI, $query->param, etc.
> >(the function-oriented style works but I cannot use it)
> >The documentation says that it can be done if you get the upload param in
> >the same module
> >where the use CGI.pm statement is.
> >Still I just don't get a value returned from $query->param('upload') after
> >submitting a file from a
> >browser.
> >I'm stuck here.
> >Anybody any suggestions?
------------------------------
Date: Wed, 23 Aug 2000 02:57:53 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Direct screen access
Message-Id: <R4Ho5.10111$km2.2233766@typhoon-news2.southeast.rr.com>
Eric Bohlman <ebohlman@netcom.com> wrote in message
news:8nut3a$dc0$6@slb3.atl.mindspring.net...
> Teodor Zlatanov (tzz@iglou.com) wrote:
> : <8nu1im$1b22$1@news2.vas-net.net>:Chris Denman
(chris@inta.net.uk):comp.lang.perl.misc:Tue, 22 Aug 2000 15:07:10
+0100:quote:
> : : I have tried to set a variable as an address to hex 0a000 and wrote a
> : : charater to that address, but perl came back with errors, saying that
this
> : : area of memory has forbiden access.
> :
> Win32 does provide a "DirectX" API for high-performance graphics
> applications, and using Inline to access *that* might be a possibility.
>
If you want to work some XS magic, there is a C/C++ game programming library
available called Allegro(http://www.talula.demon.co.uk/allegro/) you could
use as a base. The latest work in progress version has cross-platform
support for DOS/DJGPP, Windows/DirectX, and Unix/X.
------------------------------
Date: Wed, 23 Aug 2000 02:24:55 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: flock() does not work on HP-UX
Message-Id: <39A33626.F9ABE535@rochester.rr.com>
medi@cybershell.com wrote:
>
> I'm experiencing some difficulties with flock() on HP-UX.
> Has anyone else been here?
>
> OS = HP-UX mars B.11.00 A 9000/800
> Perl -v = 5.005_03 built for PA-RISC2.0
>
> The following is a test script to test locking on this OS. It
> works on Linux. The problem seem to be the functionality passed
> to flock() as in Exclusive Lock, vs Unlock, etc...
>
> open(LOCK, "> some.LOCK") || die $!; Note how HP mandates O_RDWR
> flock(LOCK, 1) || die $!;
> print "Locked \n";
> print "Hit return to continue..."; $junk = <STDIN>;
> flock(LOCK, 0) || die $!;
Make the above
flock(LOCK, 8) || die $!;
and it'll probably work.
> print "unlocked\n";
> close(LOCK);
>
> I get the following output....
>
> locked
> Hit return to continue....
> Invalid argument at ./goo line 12, <> chunk 1.
Yes, 0 is not a valid second argument to flock.
>
> So it works its way down to locking and prompting, then it
> fails on unlocking. I got the parameters to flock() from
> lockf(2) and "/usr/include/sys/unistd.h" which reads
>
I don't know much about HPUX, but I'll bet lockf and flock are two
different things. You can get your system's symbol values for LOCK_SH,
LOCK_EX, LOCK_UN, and LOCK_NB (the proper symbols for flock) by
importing them from the Fcntl module. Something like:
use Fcntl ':flock';
See
perldoc -q lock
for all kinds of good info.
> # define F_ULOCK 0 /* Unlock a previously locked region */
> # define F_LOCK 1 /* Lock a region for exclusive use */
> # define F_TLOCK 2 /* Test and lock a region for exclusive use */
> # define F_TEST 3 /* Test a region for a previous lock */
...
--
Bob Walton
------------------------------
Date: 23 Aug 2000 01:14:43 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: help with simple regexp - does my head in
Message-Id: <8nv8i3$9nhu1$3@ID-24002.news.cis.dfn.de>
hi,
Russ Jones <russ_jones@rac.ray.com> wrote:
> Marcel Grunauer wrote:
>> On Tue, 22 Aug 2000 11:20:48 -0500, Russ Jones <russ_jones@rac.ray.com> wrote:
>>
>> But in this case I'd rather use a slice:
>>
>> $attrval = (split("=", $orig_field, 2))[1]
> I like this better, too. The [-1] in Mike Stok's post is even MORE
> cute.
well, but since you know for sure that the array will
contain only 2 elements you should use the 1.
i don't know how that -1 is implemented, but I bet
it's more work for perl to find out the last
element.
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \__,_\___/\___/_| /__/ perception
please don't email unless offtopic or followup is set. thanx
------------------------------
Date: Wed, 23 Aug 2000 02:58:09 GMT
From: "Wang FeiYun" <feiyun-arthur.wang@nokia.com>
Subject: Re: how can I use perl to get a website?
Message-Id: <55Ho5.7574$AM5.127345@news1.nokia.com>
In the CPAN,in the directory LWP, there are many modules in it. Which one
should I use.
I click the "install module" by reponse a error.
How can install the module.
--
============================================
Wang FeiYun
feiyun-arthur.wang@nokia.com
============================================
<nobull@mail.com> wrote in message news:u9r97hjjzi.fsf@wcl-l.bham.ac.uk...
> Please qoute only relevant parts of the post you are replying to and
> qoute them _before_ your reply. If you can't play nice, then please
> go play elsewhere.
>
> "Wang FeiYun" <feiyun-arthur.wang@nokia.com> writes upside down:
> > "Joachim Pimiskern" <Joachim.Pimiskern@de.bosch.com> wrote in message
> > news:39A22F0B.7838CB7D@de.bosch.com...
> > > Wang FeiYun schrieb:
> > > > I heard that need the module "LWP:"
>
> True.
>
> > > > What 's that ,
>
> That is the module that you need. Go get it from CPAN.
>
> > > > how to use?
>
> Read the extensive documentation that comes with it, in particular
> "perdoc lwpcook".
>
> > > LWP is not necessary, IO::Socket is sufficient:
>
> Strictly true - but not very helpful. Actually IO::Socket is not
> necessary, the builtin functions are sufficient.
>
> > I tried it, there is a error:
>
> Don't try it to do it by hand. Use LWP.
>
> --
> \\ ( )
> . _\\__[oo
> .__/ \\ /\@
> . l___\\
> # ll l\\
> ###LL LL\\
------------------------------
Date: Wed, 23 Aug 2000 01:30:26 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: HTTP redirection problem
Message-Id: <slrn8q6a98.dvu.efflandt@efflandt.xnet.com>
On Tue, 22 Aug 2000 17:35:52 GMT, asmussen@home.com <asmussen@home.com> wrote:
>We are trying to move a bunch of perl code from an older version of
>Apache to a newer box running Stronghold 3.0 (A commercial version of
>Apache). On the way HTTP redirection broke, and I'm not sure if it's a
>difference in the perl setup on the new box or if it's in Apache. The
>code basically does something like this:
>
>$main::r->print("Location: $NewServer\n\n");
>
>This code worked fine on the old servers, even though it does not print
>a Status: 302 Found message. I assume that either some included perl
>module was handling the Status message, or Apache itself was supplying
>the 302 Found message on its own. Unfortunately the perl code in
>question is too large to easily debug. I was hoping that if it is a perl
>problem, somebody here might have an idea of what is going on...
Since you don't say what sort of broken response you get, how to you
expect anyone to help you even if you do post to the proper newsgroup?
How is your response different from this simple example:
#!/usr/bin/perl -w
print "Location: ./env.cgi\n\n";
Results in a response of:
HTTP/1.1 302 Found
Date: Wed, 23 Aug 2000 01:19:44 GMT
Server: Apache/1.3.9 (Unix) (Red Hat/Linux)
Location: ./env.cgi
Connection: close
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>302 Found</TITLE>
</HEAD><BODY>
<H1>Found</H1>
The document has moved <A HREF="./env.cgi">here</A>.<P>
</BODY></HTML>
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/ http://cgi-help.virtualave.net/
------------------------------
Date: Wed, 23 Aug 2000 02:38:53 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: HTTP redirection problem
Message-Id: <1PGo5.10101$km2.2232397@typhoon-news2.southeast.rr.com>
<asmussen@home.com> wrote in message news:8nudln$u54$1@nnrp1.deja.com...
>
> $main::r->print("Location: $NewServer\n\n");
>
> This code worked fine on the old servers, even though it does not print
> a Status: 302 Found message. I assume that either some included perl
Sounds like your assumption is probably right. Looks like you're running
under mod_perl (or were), and the HTTP status was getting set somewhere
else. If you need to change the status line, you might try something like
this:
use Apache::Constants ':response';
$r->status( REDIRECT);
hth
Philip
------------------------------
Date: Wed, 23 Aug 2000 01:53:10 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: I =?iso-8859-1?Q?haven=B4t?= exleined the problem clearly
Message-Id: <39A32EB5.4D1D5B5D@rochester.rr.com>
Paulino wrote:
>
> I need to change the table where is the program2.gif text by a table with
> other tags.
>
> <table>
> ..
> <table>
> ..
> <table>
> ..
> <td>program2.gif</td>
> ..
> </table>
> ..
> </table>
> ..
> </table>
>
> If i aply the Regular Expresion
> 's/<table>.*?program2.gif.*?\/table>/$tablenew/igs' i get it next:
>
> <newtable>
> <td>program3.gif</td>
> ..
> </newtable>
> ..
> </table>
> ..
> </table>
>
> and i have lost the first part of the original text.
...
That's because Perl did exactly what you told it to do. It matches
<table> on the first table tag, then matches the shortest string of
anything (including a couple of other <table> 's) until it matches the
string program2.gif (noting carefully that the . matches any character,
including a . , so it could match program2agif, for example). Then it
matches the shortest string of anything until it finds /table> . Then
it replaces everything it just matched with the contents of $tablenew (I
assume that's something like <tablenew><td>program3.gif</td></newtable>
). That means everything from the first <table> tag through the first
/table> gets replaced, which, of course, isn't what you want.
Note that it is a much more difficult job to correctly parse HTML than
most folks think it is. You really need to get a parser, such as
HTML::Parser, and use that to take apart your HTML. One might be able
to get tricky and "solve" your specific problem above, but then a web
page would come along (maybe with something as simple as <table border>
) and make it not work. Maybe it might have <!-- <table> --> in it,
too. Or various other subtleties too numerous to mention.
--
Bob Walton
------------------------------
Date: 22 Aug 2000 22:13:07 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: long-to-short dir/filenames
Message-Id: <8nuttj$dc0$7@slb3.atl.mindspring.net>
[followups limited to comp.lang.perl.misc]
Giovanni Loc (newsgroup@pmairt 8.3-format
: filenames for input
:
: the problem is that I have this filelist.txt with LONG dir/filenames,
: like:
:
: c:\mydirectorya\subdirectorya\longfilename.txt
: c:\mydirectoryb\subdirectoryb\longfilenameb.txt
: c:\foobar\onetwothree.txt
:
:
: so I need to translate all the paths in @filelist.txt for example in:
:
: c:\MYDIRE~1\SUBDIR~1\LONGFI~1.TXT
: c:\MYDIRE~2\SUBDIR~2\LONGFI~1.TXT
: c:\FOOBAR\ONETWO~1.TXT
[snip]
: I'm on Windows 2000,
Very easy in Perl [UNTESTED CODE]:
#!perl -wi.bak
use strict;
use Win32;
while (<>) {
chomp;
print Win32::GetShortPathName($_),"\n";
}
------------------------------
Date: Tue, 22 Aug 2000 20:54:44 -0500
From: "Chris Stith" <mischief@motion.net>
Subject: Re: Lotsa difiiculties - need help with my Perl !!
Message-Id: <sq6bm1tt91158@corp.supernews.com>
<reg_exp@my-deja.com> wrote in message news:8nuaov$qa8$1@nnrp1.deja.com...
>
> open(F,$_) or die "Unable to open file : $!";
> $/="[START]";
> @file = <F>;
> close F;
> print $file[1];
> print "End of record\n";
> @nuggs = split $file[1], /\[NUGGET\]/;
> foreach (@nuggs) {
> print "Nugget Begin\n";
> print $_;
> print "Nugget End\n";
> }
> when i run this, i get the error :
> "regexp too big at splitter line 39."
>
> why do i get this error ??
First, you get the error because your arguments to split()
are out of order. You need the pattern to split on first,
then the expression to split. Try this:
split /\[NUGGET\]/, $file[1];
Second, switching the record separator to
"\n\[START\]\n" won't make your data come in all at
once. You'll get only from one "\n\[START\]\n" to the
next when you do the following:
$file[$foo] = <F>;
Only changing $/ to a null value turns off all record
separation. So I'd do something like:
$foo = 0;
while(<F>) {
$file[$foo] = $_;
$foo++;
}
which is pretty standard Perl. You could then separate
out everything else. A better approach if you really only
want the lines between [IN_DATA] and [IN_END],
though, might be this to leave the record separator alone
and do something like this:
$foo = 0;
$get_data = 0;
while(<F>) {
if(/^\[IN_DATA\]$/) {
$get_data = 1;
} elsif(/^\[IN_END\]$/) {
$get_data = 0;
$foo++;
} elsif($get_data == 1) {
$file[$foo] .= $_;
} else {
}
}
so you would then have everything between [IN_DATA]
and [IN_END] in one place in each element of @file for
what that's worth. If you instead wanted to keep that as
individual lines but be able to figure out where the records
end, try something like this instead:
$foo = 0;
$bar = 0;
@file = '';
$get_data = 0;
while(<F>) {
if(/^\[IN_DATA\]$/) {
$get_data = 1;
} elsif(/^\[IN_END\]$/) {
$get_data = 0;
$end_of_record[$bar] = $foo;
$bar++;
} elsif($get_data == 1) {
$file[$foo] = $_;
$foo++;
} else {
}
}
which gives you an array of every line that's after
[IN_DATA] up to and not including an instance of
[IN_END], and a second array showing on which
elements of the first array a record is completed.
Changing this to find the beginning instead is left as an
exercise for the reader.
As for getting down to the level of the [NUGGET]
sections, similar methods could be used, whether on
the file stream or on a loop through the above arrays.
Chris Stith
Motion Internet
mr_mischief1@hotmail.com
mischief@motion.net
------------------------------
Date: Tue, 22 Aug 2000 21:11:33 -0400
From: "Driver" <betsamaarcra@mindspring.com>
Subject: multi-line reg exp deletion
Message-Id: <8nv89e$vhd$1@nntp9.atl.mindspring.net>
I have mif files (text) generated by FrameMaker, long files. I want to
remove large chunks of text. For example:
...Lots of text
<Page
unwanted chunk of text
unwanted chunk of text
unwanted chunk of text
unwanted chunk of text
> # end of Page.
... Lots more of text....
I have a script that does substitution, and it works fine, but I'm trying to
eliminate the multi-line chunk and I'm missing something
the impt. part of my code is as follows:
...script...
if (=~ s/<Page .* Page//sm) {print result to OUTFILE}
close INFILE;
close OUTFILE
...more script
If I try to do anything except the multi-line delete, the script works fine.
Craig
------------------------------
Date: Wed, 23 Aug 2000 02:48:37 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: multi-line reg exp deletion
Message-Id: <39A33BB3.734DCAFF@rochester.rr.com>
Driver wrote:
>
> I have mif files (text) generated by FrameMaker, long files. I want to
> remove large chunks of text. For example:
>
> ...Lots of text
>
> <Page
> unwanted chunk of text
> unwanted chunk of text
> unwanted chunk of text
> unwanted chunk of text
> > # end of Page.
>
> ... Lots more of text....
>
> I have a script that does substitution, and it works fine, but I'm trying to
> eliminate the multi-line chunk and I'm missing something
>
> the impt. part of my code is as follows:
>
> ...script...
>
> if (=~ s/<Page .* Page//sm) {print result to OUTFILE}
> close INFILE;
> close OUTFILE
>
> ...more script
>
> If I try to do anything except the multi-line delete, the script works fine.
>
> Craig
Well, you don't say *exactly* what is going wrong (you say you're
"missing something"). So I'll speculate: Your regex matches the first
<Page it encounters. Then it matches the longest possible string of any
characters until it finds Page . Then it replaces all that with the
empty string. That means it will delete everything from the first <Page
though the last Page in the document. Probably not what you want.
Maybe you want something more like the non-greedy version of *:
=~ s/<Page .*? Page//s
(noting that the m is unneeded since you don't use ^ or $ in your
regex).
But I would guess that the text you want to skip over might just contain
the word Page . So maybe you could search for > # end of Page. instead.
However, all this requires the file be sucked in as one big long string,
so you can operate on it all at once. Since the file is big, you might
not want to do that. Maybe you could do instead:
while(<INFILE>){
print OUTFILE unless /^>Page$/../^> # end of Page\.$/;
}
which would remove everything from each >Page line through its next > #
end of Page. line from the file.
--
Bob Walton
------------------------------
Date: Wed, 23 Aug 2000 02:08:51 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Problem with PPM working
Message-Id: <39A33261.DA31FE16@rochester.rr.com>
rita_nc@my-deja.com wrote:
...
> I've also tried downloading and the DBI zip file,
> unzipping it and then issuing
> ppm install DBI.ppd (in the same directory the
> unzipped file is).
>
> I then get "could not locate a PPM binary of
> 'DBI.ppd for this platform"
...
> Rita
...
You need to give the --location=c:/where/your/ppd/file/is switch to ppm,
as in:
ppm "--location=c:/temp"
In general, the quotes are needed, and no, the / is not a typo. Without
that, it will attempt to grab the stuff directly from ActiveState, which
you say isn't working for you.
Then give the
install DBI
command at PPM's prompt.
Be sure to unzip to whatever directory you specify in a fashion which
preserves the directory structure in the zip file. You may need to
check or uncheck a few checkboxes in your unzip program to make that
happen.
--
Bob Walton
------------------------------
Date: Tue, 22 Aug 2000 18:55:16 -0700
From: "Godzilla!" <callgirl@la.znet.com>
Subject: Re: regexing html-like tags
Message-Id: <39A32F04.1DAED32F@la.znet.com>
Larry Rosler wrote:
> Blair Heuer wrote:
> [Godzilla! attribution incorrectly omitted. Prefix is '> > '.]
You personally, Rosler, may call me God for short.
> > ... Though I do thank you for trying.
> Why? Do you perceive a net benefit? I don't, and I
> doubt anyone else does.
Well, he did receive code from me which works quite perfectly,
contrasting yours Mr. Rosler, which failed, quite perfectly.
My code constructed an absolutely perfect managable associative array
where your code, hmm.. well.. produced results much like what my
girl produced in her diapers, nearly two decades back.
> > > > What should I do to put the name/value pairs of that tag (name: bob,
> > > > age: 44, comment: This is my comment! ) into a hash.
> > > You do mean an associative array, correct?
> > > Hash is what I serve coyotes around here.
> > You say potato, I say hash.
> 'Associative array' is what this structure is called in awk, inherited
> by Perl. In Perl 5, it was decided[1] that seven syllables was too many
> for such an important concept, and the functionally-descriptive name was
> replaced by a one-syllable name more descriptive of the implementation.
> Too bad, IMO, but that's the way it is.
> [1] Note careful use of the passive voice to avoid imputing blame to any
> individual or group. :-]
> The criticism of 'hash' demonstrates the degree to which Godzilla!'s
> head (or whatever) is stuck in Perl 4.
Wait... wait... First you indicate changing this name, "associate array"
to coyote food "hash" is a mistake, in your opinion. Then you go on to
critique me for using this expression, associative array.
Out of one side of your mouth, you say, paraphrased,
"It should be called an associate array."
Out of the other side of your mouth, you say, paraphrased,
"Godzilla is wrong for calling it an associative array."
Whew....
Godzilla!
------------------------------
Date: Wed, 23 Aug 2000 01:48:39 GMT
From: "Blair Heuer" <blair@geo-NOSPAM-soft.org>
Subject: Re: regexing html-like tags
Message-Id: <X3Go5.68$7o6.365702@newsmaster1.prod.itd.earthlink.net>
> Well, he did receive code from me which works quite perfectly,
> contrasting yours Mr. Rosler, which failed, quite perfectly.
>
> My code constructed an absolutely perfect managable associative array
> where your code, hmm.. well.. produced results much like what my
> girl produced in her diapers, nearly two decades back.
Um, no. Larry Rosler's code was useful for what I needed, and I did use it
in my script.
Yours on the other hand was completely useless (the skeleton script. I did
not bother to try out the other because a) Larry Rosler's code was working
just fine {modified, but, and I paraphrase, why would I expect it to be
perfectly tailored (aka on a silver platter) and b) I don't like you. )
-Blair
------------------------------
Date: Wed, 23 Aug 2000 01:57:04 GMT
From: "Blair Heuer" <blair@geo-NOSPAM-soft.org>
Subject: Re: regexing html-like tags
Message-Id: <QbGo5.81$7o6.368193@newsmaster1.prod.itd.earthlink.net>
> There were some bugs in the code I posted. I was editing one of the blocks
for size, and screwed it up.
<fix snipped>
Thanks for pointing them out.
> > Also, thanks for being 100 times more polite than Godzilla. :)
> De nada.
En eso caso, mucho gusto. (Should mean "In that case..." but I could be
mixing words that don't go together. I'm a little rusty.)
> Elijah
> ------
> you're lucky I have /r(eg(ular)?.?)?exp?/ in my subject auto-selection
------------------------------
Date: Wed, 23 Aug 2000 02:10:26 GMT
From: "Philip Garrett" <philipg@atl.mediaone.net>
Subject: Re: Sitescooper in Mandrake
Message-Id: <moGo5.59107$rd1.10807717@typhoon-news1.southeast.rr.com>
<jpai@rocketmail.com> wrote in message news:8nuvbu$jtp$1@nnrp1.deja.com...
>
> Reading configuration from "/root/.sitescooper/sitescooper.cf".
> Can't locate LWP/UserAgent.pm in @INC (@INC contains:
> /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503
> /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005
> . /usr/bin/lib /usr/bin/site_perl /usr/bin/../share/sitescooper/lib
> /usr/bin/../share/sitescooper/site_perl) at Scoop.pm line 701.
>
>
> I know next to nothing about perl. I will appreciate if somebody can
> give me a hint on how to fix this and make it work.
>
There's a Perl module missing that your program needs. You can get the
Mandrake RPM from
ftp://ftp.twoguys.org/pub/linux/distributions/mandrake/current/Mandrake/RPMS
/perl-libwww-perl-5.47-3mdk.i586.rpm
(or any other mdk mirror)
Or, you can build it yourself:
perl -MCPAN -e 'install Bundle::LWP'
hth
Philip
------------------------------
Date: Wed, 23 Aug 2000 02:10:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Sitescooper in Mandrake
Message-Id: <39A332DF.165FDAE7@rochester.rr.com>
jpai@rocketmail.com wrote:
...
...
> Can't locate LWP/UserAgent.pm in @INC (@INC contains:
...
> I know next to nothing about perl. I will appreciate if somebody can
> give me a hint on how to fix this and make it work.
...
Sounds like you need to download the LWP module. Get it from CPAN.
--
Bob Walton
------------------------------
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 4101
**************************************