[17273] in Perl-Users-Digest
Perl-Users Digest, Issue: 4695 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 23 06:10:28 2000
Date: Mon, 23 Oct 2000 03:10: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: <972295814-v9-i4695@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 23 Oct 2000 Volume: 9 Number: 4695
Today's topics:
Re: Perl 5.005 or 5.6? (Ilya Zakharevich)
Re: Perl 5.005 or 5.6? (Logan Shaw)
Re: Perl 5.005 or 5.6? <bart.lateur@skynet.be>
Re: Perl 5.005 or 5.6? <marc@fearby.com>
Re: perl objects and methods <pdcawley@bofh.org.uk>
POD documantation <andreasn@sophia.siemens-scg.com>
Re: POD documantation <gellyfish@gellyfish.com>
Problem with LWP::UserAgent POST method (was Re: Is it <gellyfish@gellyfish.com>
Re: redirection Location help <gellyfish@gellyfish.com>
Re: still need help/beginner....pulling my hair ! <gellyfish@gellyfish.com>
Re: strange behaviour regular expression <krahnj@acm.org>
Re: why doesn't this work...... <gellyfish@gellyfish.com>
Re: why doesn't this work...... <miriamsmit@zonnet.nl>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Oct 2000 08:00:02 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl 5.005 or 5.6?
Message-Id: <8t0r62$kkq$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Logan Shaw
<logan@cs.utexas.edu>],
who wrote in article <8t0cmh$qq8$1@provolone.cs.utexas.edu>:
> >Windows can only run one program (or
> >DLL) with the same name at the same time. So this will also use the DLL
> >from 5.005. Net effect: crash.
>
> Hahahaha!!! Is windows *really* that broken? That's hilarious!
>
> I guess library interposition is completely unknown on Windows, then.
AFAIK, the situation is exactly the opposite. An average Unix uses
kitchen-grown hacks for its dynamic libraries. DOSish systems (and a few
Unices - probably designed by mainframe people - AIX and DGUX (?) come
to mind) use a different scheme.
This different scheme (name resolution at link time, no fixups at
runtime, etc) looks very developer-unfriendly and just plain stupid
when you first see it. [Well, you can immediately see advantages of
dynamic linking without any slowdowns...]
Fortunately, when time goes, you discover that it contains *no hacks*.
The things *just work*, which one cannot say about the Unix scheme...
Ilya
------------------------------
Date: 23 Oct 2000 03:43:36 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Perl 5.005 or 5.6?
Message-Id: <8t0tno$s86$1@provolone.cs.utexas.edu>
At some point in the past, in some article, someone wrote:
>> >Windows can only run one program (or
>> >DLL) with the same name at the same time.
In article <8t0r62$kkq$1@charm.magnus.acs.ohio-state.edu>,
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>AFAIK, the situation is exactly the opposite. An average Unix uses
>kitchen-grown hacks for its dynamic libraries. DOSish systems (and a few
>Unices - probably designed by mainframe people - AIX and DGUX (?) come
>to mind) use a different scheme.
>
>This different scheme (name resolution at link time, no fixups at
>runtime, etc) looks very developer-unfriendly and just plain stupid
>when you first see it.
Like for instance the fact that if application 1 wants to use a library
called ABC.DLL and application 2 (developed completely independently of
application 1, in a different country, by a different group of people)
also wants to install a library called ABC.DLL, then suddenly it would
be (if I understand correctly) impossible to have them both work at the
same time.
On a decent version of Unix, on the other hand, you can just install
the libabc.so in two different places and use the link editor to
hardwire the appropriate pathnames into the executables, and it just
works. (If you're fond of putting everything in /usr/local/lib and
just setting a global LD_LIBRARY_PATH or similar, this won't work, but
then you'll never get any duplicate libraries to work under any
circumstances anyway.) Alternately, if you don't like hardwiring the
pathnames to libabc.so into the executables, run scripts that set
environment variables and then run the executable, and it still works
reasonably well.
Of course, Unix is not perfect in this regard yet -- if you want to
distribute binary-only code and yet let the user have the ability to
install it anywhere and have it still find its library files, you need
to either have a program which can edit the library search path stored
in the executable (which no Unix yet has AFAIK), or you need to
distributed a big ".o" file (or ".a" file) and use that to build the
executable with the correct built-in library search path whenever you
install it. (And then there are those Unixes that still don't have the
ability to put the library search path into the executable, but
hopefully they'll get fixed one day.)
Having said all this, I should point out that we're probably suffering
from different definitions of "just works". For me, "just works" means
"doesn't throw away flexibility without a very, very good reason" in
addition to "requires no intervention from the user".
But I'll stop now lest I get into my rant about how all software
developers should be required to be system administrators for a few
years, so they will see how brain-damaged 99.9% of all software
installation procedures are.
Perl's installation procedure, by the way, is not exempt. It is IMHO
mildly broken. Not surprisingly, it's in a "do what I mean" sort of
way: if the installation directory already contains "perl", it doesn't
put the libraries in $prefix/lib/perl, just in $prefix/lib. As far as
I know, there is no real way to tell it not to do this. (I would love
for someone to prove me wrong!)
- Logan
------------------------------
Date: Mon, 23 Oct 2000 08:53:22 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl 5.005 or 5.6?
Message-Id: <gpu7vs45t3hlsa9gvbov4trrrkvfgv4ri5@4ax.com>
Logan Shaw wrote:
>>Windows can only run one program (or
>>DLL) with the same name at the same time. So this will also use the DLL
>>from 5.005. Net effect: crash.
>
>Hahahaha!!! Is windows *really* that broken? That's hilarious!
Yes it is. I'm not sure if the programs and DLL's are identified by
their file basename, or by their internal module name, but usually,
those are the same names anyway.
The problem that I see is in the camp of Perl. Why does Perl require a
different format for its DLL's, for 5.005 and for 5.6? That shouldn't
be. The DLL format should be a standard DLL format, with functions
exported in the normal way. The Perl version specific interface should
not be inside the DLL, but in Perl.exe, or, at worst, in a dedicated
interface DLL. It makes no sense that the same XS module, compiled for a
different Perl, results in a different DLL.
But, if Activestate had taken the precautions for the Win32 port, that
Ilya apparently took for the OS/2 port, all of this discussion would be
unnecessary.
--
Bart.
------------------------------
Date: Mon, 23 Oct 2000 19:59:27 +1000
From: Marc Fearby <marc@fearby.com>
Subject: Re: Perl 5.005 or 5.6?
Message-Id: <39F40BFF.D8968059@fearby.com>
Bart Lateur wrote:
> p.s. Personally I'm using 5.6. Only if there are some modules that you
> *really* need that haven't been recompiled for 5.6 yet, then I'd stick
> with 5.005.
So, apart from the fact that some modules might not have been recompiled
for 5.6, it's OK? I don't want to upgrade if it's full of holes or nasty
patches. In particular, PNGgraph hasn't isn't available on ActiveState's
site for 5.6 yet and I really need it. I don't really want to re-write
my code for Chart::Bars anything something else.
Thanks
Marc
------------------------------
Date: 23 Oct 2000 09:38:42 +0100
From: Piers Cawley <pdcawley@bofh.org.uk>
Subject: Re: perl objects and methods
Message-Id: <m1hf646jfx.fsf@rt158.private.realtime.co.uk>
Bart Lateur <bart.lateur@skynet.be> writes:
> Piers Cawley wrote:
>
> >> That's because of the explicit "return". If it is coded as
> >>
> >> sub id :lvalue {
> >> $_[0]{id};
> >> }
> >
> >Err... I think you mean '$_[0]->{id}'
>
> Err... what's the difference. If an array item (or hash item) is a
> reference, you may drop any following arrows. Under normal
> circumstances.
I realised this, ooh, seconds after I hit send. And my bloody
news server wouldn't let me withdraw it. A well.
--
Piers
------------------------------
Date: Mon, 23 Oct 2000 10:19:21 +0200
From: Andreas Nagel <andreasn@sophia.siemens-scg.com>
Subject: POD documantation
Message-Id: <39F3F489.505D3268@infineon.com>
HI,
I'm looking for a easy POD editor/writer or if it do not exist a
documentation about POD.
thanks
Franck
------------------------------
Date: Mon, 23 Oct 2000 08:27:34 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: POD documantation
Message-Id: <WDSI5.3113$7u4.60028@news.dircon.co.uk>
On Mon, 23 Oct 2000 10:19:21 +0200, Andreas Nagel Wrote:
> HI,
>
> I'm looking for a easy POD editor/writer or if it do not exist a
> documentation about POD.
>
Most people will use the same editor the use for their program code.
POD is documented in the perlpod manpage.
/J\
------------------------------
Date: Mon, 23 Oct 2000 08:56:56 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Problem with LWP::UserAgent POST method (was Re: Is it so difficult to help?)
Message-Id: <s3TI5.3117$7u4.60028@news.dircon.co.uk>
[Please use an informational subject line]
On Mon, 23 Oct 2000 09:11:53 +0200, Michel Wouterse Wrote:
> Hi group,
>
> I am trying to POST something into another script. It has to reach the
> script as if it were posted from an HTML-FORM.
>
> use LWP::UserAgent;
> use HTTP::Request::Common qw(POST);
> $url = 'http://www.myserver.com/cgi-bin/login.cgi';
> $browser = new LWP::UserAgent;
> @param ( 'username' -> 'myself' , 'password'-> 'mypass' );
> $htres = $browser->request(POST $url, \@param);
>
Hmm, I've seen this code before. Homework question ?
Except this has three syntax errors on the same line.
It really does help if you post your actual code rather than retyping it,
people will only notice the typos and you will get less help than you might.
> Now...this code:
>
> A is it correct, but won't it work, because it's not the way to do it?
> B is it not correct and won't it work, because it's total shit?
> C is it correct, but I should use it slightly different?
>
given that you fix the syntax errors :
@param = ( 'username' => 'myself' , 'password' => 'mypass' );
Then what do expect the program to do ? You are not printing out the
response nor are you checking for the success of the request method.
What do you get when print out $htres->content.
You will probably want to read the lwpcook manpage for more on this.
/J\
------------------------------
Date: 23 Oct 2000 08:37:44 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: redirection Location help
Message-Id: <8t0ps8$u56$1@orpheus.gellyfish.com>
On Fri, 20 Oct 2000 20:38:43 GMT metamp@my-deja.com wrote:
> I want to do redirection
> I'm useing the print "Location: http://mysite.com/\n\n";
>
> but I want to redirect to a web page and to a download file
>
> if I do second line Print "Location: http://myfile.zip\n\n"
> my first redirect is ignored.
>
> is here any way to do Location target =_blank or _self so I could
> redirect to 2 diferent locations
How can you redirect to 2 different locations ? A CGI program can
only make a single response.
Anyhow this isnt a Perl question. The answer would be the same whatever
language you were using.
You will probably want to ask in comp.infosystems.www.authoring.cgi about
how you might achieve a similar effect.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: 23 Oct 2000 07:50:17 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: still need help/beginner....pulling my hair !
Message-Id: <8t0n39$u17$1@orpheus.gellyfish.com>
On Sun, 22 Oct 2000 00:17:09 -0400 none wrote:
>
> And as for the Cgi.pm, we haven't covered that yet,
>
<That is CGI.pm by the way>
Then I would suggest that you tell your teacher that you ought to be using
the CGI module rather than cgi-lib.pl, you are using the latter as a black
box anyhow and so 'covering it' isnt an issue. You should be using
appropriate modern tools, being encouraged to use that library is like a
carpentry teacher suggesting you should use an adze rather than a bench-plane.
Oh and we dont do peoples homework for them here.
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Mon, 23 Oct 2000 02:45:08 -0700
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: strange behaviour regular expression
Message-Id: <39F408A4.1B0C5194@acm.org>
Jens-Uwe Rumstich wrote:
>
> Hello!
>
> I have a strange behavior neither I nor the PERL gurus here can explain. Since
> this is a VERY important routine, I don't want to have it doing things I
> can not explain!
>
> I have a list of Product, which I want to compare with a string. Strangely
> the found products change, if I change the list of products!!!
>
> The source in question:
>
> # compare with all products
> foreach $ProductArray (@$ProductList)
> {
> my $ProductNameStripped = $ProductArray->[0];
>
> # check, if SearchTextStripped contains ProductName
> print "try \"$ProductNameStripped\". Text = \"$SearchTextStripped\": ";
> if ($SearchTextStripped =~ /$ProductNameStripped/g)
> {
> print "found\n";
> } else
> {
> print "not found\n";
> }
> }
This works fine for me.
> I am using "version 5.005_03 built for i586-linux" on a Suse6.4.
Same here.
John
------------------------------
Date: 23 Oct 2000 07:07:54 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: why doesn't this work......
Message-Id: <8t0kjq$ttv$1@orpheus.gellyfish.com>
On Sun, 22 Oct 2000 19:36:06 GMT Chris Fedde wrote:
> In article <QSGI5.24794$tL4.292318@zonnet-reader-1>,
> Michel Wouterse <miriamsmit@zonnet.nl> wrote:
>>use LWP::UserAgent;
>>use HTTP::Request::Common qw(POST);
>>$url = 'http://www.myserver/login.html';
>>@param = (
>>'username' => 'myname',
>>'password' => 'mypwd' );
>>$browser = new LWP::UserAgent;
>>$htres = $browser->request(POST $url, \@param);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>print "content-type:text/html\n\n";
>>print "<HTML><BODY>";
>>print "</BODY></HTML>";
>>
>>Code above should post username and password to login.html
>>it, though....returns nothing.....
>>
>>What's wrong?????
>>
>
> This code is just odd. What do you expect it to do? It doesn't send
> anything to a server. It just creates a couple objects then prints out a
> bit of HTML.
>
> Somewhere in there you need an expression like
>
> $res = $browser->request($htres)
>
> Then you need to do something with the $res.
Er, he is doing that.
I would however recommend the HTTP::Request object is created eplicitly
outside the request method :
my $req = POST $url, [ username => 'myname', password => 'mypwd' ];
my $htres = $browser->request($req);
Then you can print the content of the result:
print $htres->content;
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Mon, 23 Oct 2000 11:27:59 +0200
From: "Michel Wouterse" <miriamsmit@zonnet.nl>
Subject: Re: why doesn't this work......
Message-Id: <GsTI5.25086$tL4.295471@zonnet-reader-1>
Thank you Jonathan. Your comment worked fine.
I think I got it now...
Michel
Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:8t0kjq$ttv$1@orpheus.gellyfish.com...
> On Sun, 22 Oct 2000 19:36:06 GMT Chris Fedde wrote:
> > In article <QSGI5.24794$tL4.292318@zonnet-reader-1>,
> > Michel Wouterse <miriamsmit@zonnet.nl> wrote:
> >>use LWP::UserAgent;
> >>use HTTP::Request::Common qw(POST);
> >>$url = 'http://www.myserver/login.html';
> >>@param = (
> >>'username' => 'myname',
> >>'password' => 'mypwd' );
> >>$browser = new LWP::UserAgent;
> >>$htres = $browser->request(POST $url, \@param);
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >>print "content-type:text/html\n\n";
> >>print "<HTML><BODY>";
> >>print "</BODY></HTML>";
> >>
> >>Code above should post username and password to login.html
> >>it, though....returns nothing.....
> >>
> >>What's wrong?????
> >>
> >
> > This code is just odd. What do you expect it to do? It doesn't send
> > anything to a server. It just creates a couple objects then prints out a
> > bit of HTML.
> >
> > Somewhere in there you need an expression like
> >
> > $res = $browser->request($htres)
> >
> > Then you need to do something with the $res.
>
> Er, he is doing that.
>
> I would however recommend the HTTP::Request object is created eplicitly
> outside the request method :
>
> my $req = POST $url, [ username => 'myname', password => 'mypwd' ];
>
> my $htres = $browser->request($req);
>
> Then you can print the content of the result:
>
> print $htres->content;
>
> /J\
> --
> Jonathan Stowe |
> <http://www.gellyfish.com> | This space for rent
> |
------------------------------
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 4695
**************************************