[14021] in Perl-Users-Digest
Perl-Users Digest, Issue: 1431 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 19 14:20:59 1999
Date: Fri, 19 Nov 1999 11:20:46 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <943039246-v9-i1431@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 19 Nov 1999 Volume: 9 Number: 1431
Today's topics:
Re: html via perl <c4jgurney@my-deja.com>
Identifying email attachments mmclaug@my-deja.com
Re: Identifying email attachments <gellyfish@gellyfish.com>
Installing perl modules locally <spam@dev.null>
Re: Is there no length() function? <rick.delaney@home.com>
Re: Is there no length() function? (Philip 'Yes, that's my address' Newton)
Re: Is there no length() function? (Kragen Sitaker)
Re: Is there no length() function? <aqumsieh@matrox.com>
Re: Is there no length() function? (Martien Verbruggen)
Re: Is there no length() function? (Martien Verbruggen)
Re: Is there no length() function? <jxu@wcom.net>
Re: Javascript w/ Perl (Scott McMahan)
Re: legal names and about sorting <lr@hpl.hp.com>
Re: legal names and about sorting (Jaakko Puurunen)
Re: legal names and about sorting (Anno Siegel)
Re: legal names and about sorting (M.J.T. Guy)
Re: Longest match (Abigail)
Re: MD5 encryption <gehring.u@zdf.de>
Re: MD5 encryption <gisle@aas.no>
Re: MD5 encryption <gehring.u@zdf.de>
Module for Netware NDS ? <cbeatson@mail.ci.lubbock.tx.us>
Re: Multiple file download (Scott McMahan)
my database <cure@texas.net>
Need some help in cluding perl in a C program <sgomes@channelcom.fr>
Re: Need some help in cluding perl in a C program (Kragen Sitaker)
Re: No Fork in NT Perl and Print to socket (Scott McMahan)
Re: No Fork in NT Perl and Print to socket (Bart Lateur)
Re: Oracle via the web <cpcollin@wam.umd.edu>
Re: Oracle via the web <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 19 Nov 1999 09:17:30 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: html via perl
Message-Id: <8134j8$act$1@nnrp1.deja.com>
In article <38348F80.FB27ECEC@mail.cor.epa.gov>,
David Cassell <cassell@mail.cor.epa.gov> wrote:
> Alternatively Brian, you can cure that backslashitis with a
> brisk dose of qq() there. If you want lots of print lines, you
> might prefer to learn about here-docs in the perldata pages.
Good advice.
> But this is still not a Perl question, and as such you'll
> usually get better, more direct answers asking HTML questions
> in an HTML newsgroup. I hope.
I disagree. In this instace it didn't really matter what was being
printed it was the fact that the output needed both interpolated strings
and double quotes - which I would say was a Perl issue.
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
"If at first you don't succeed - use a bigger hammer"
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 19 Nov 1999 10:18:26 GMT
From: mmclaug@my-deja.com
Subject: Identifying email attachments
Message-Id: <81385h$ckh$1@nnrp1.deja.com>
Are there any perl modules or scripts that identify if an email has file
attachments?
I am working on something for wireless PDAs and I don't want large
emails to be downloaded over a slow link to the client -- I've got to
find some way to identify large emails (such as those with file
attachments) and block them off at the server.
Mail::POP3Client will tell me the message size but not if there are
attachments.
Any ideas welcomed.
Michael
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 19 Nov 1999 11:04:53 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Identifying email attachments
Message-Id: <38352ed5_1@newsread3.dircon.co.uk>
mmclaug@my-deja.com wrote:
> Are there any perl modules or scripts that identify if an email has file
> attachments?
> I am working on something for wireless PDAs and I don't want large
> emails to be downloaded over a slow link to the client -- I've got to
> find some way to identify large emails (such as those with file
> attachments) and block them off at the server.
>
> Mail::POP3Client will tell me the message size but not if there are
> attachments.
some MIME::* module at a guess ...
/J\
--
"Conservatives have called on Sports Minister, Tony Banks, to resign
after calling William Hague a foetus" - BBC News Website
------------------------------
Date: Fri, 19 Nov 1999 03:21:41 GMT
From: Steve <spam@dev.null>
Subject: Installing perl modules locally
Message-Id: <9n3Z3.1411$X5.197092@ptah.visi.com>
I'm trying to install perl modules in my home directory. The perlfaq8
has a section explaining how to do this but after multiple attempts
with multiple modules I still haven't gotten it to work.
Following the FAQ, I create my Makefile like:
perl Makefile.PL PREFIX=/home/me/lib/perl
make, make test, and then run 'make install' and I get:
mkdir /usr/local/lib/perl5/site_perl/5.005/i386-freebsd:
Permission denied at /usr/libdata/perl/5.00503/ExtUtils/Install.pm line 57
Anyone know why it isn't following my PREFIX?
Thanks,
sk
------------------------------
Date: Fri, 19 Nov 1999 04:32:14 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Is there no length() function?
Message-Id: <3834D2EC.127BEA8E@home.com>
[posted & mailed]
Kragen Sitaker wrote:
>
> In article <dfwk8nf7dp3.fsf@martens.math.ntnu.no>,
> Bård Skaflestad <bardsk@math.ntnu.no> wrote:
> >while (defined(<>)) {
>
[snip good bits]
> this will keep <> from assigning to $_, and I'm not sure what context
> <> is going to get from defined(), so it might end up reading the whole
> file.
Well, that's easy enough to test.
sub foo {
print wantarray;
}
print defined(foo);
Also, I believe that EXPR means scalar context in functions documented
as such.
perldoc -f defined
=item defined EXPR
=item defined
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Fri, 19 Nov 1999 05:24:28 GMT
From: nospam.newton@gmx.li (Philip 'Yes, that's my address' Newton)
Subject: Re: Is there no length() function?
Message-Id: <3834dcae.467974848@news.nikoma.de>
On 18 Nov 1999 21:24:41 GMT, Erik van Roode
<newsposter@cthulhu.demon.nl> wrote:
>Erik van Roode <newsposter@cthulhu.demon.nl> wrote:
>
>> Also, why use while instead of foreach?
>
>Ignore that remark. It doesn't make sense to me, even though
>it did when I posted it.
Don't ignore that remark.
while(<>) goes through the file line by line, setting $_ to each line
in turn. foreach(<>) slurps in the entire file into memory (since <>
is in list context) and then iterates through the array thus created,
setting $_ to each array element in turn.
Use while(<>) [or, for older perls, while(defined($_=<>))].
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
------------------------------
Date: Fri, 19 Nov 1999 05:44:02 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Is there no length() function?
Message-Id: <Cs5Z3.27495$YI2.1244702@typ11.nn.bcandid.com>
In article <3834D2EC.127BEA8E@home.com>,
Rick Delaney <rick.delaney@home.com> wrote:
>Kragen Sitaker wrote:
>> this will keep <> from assigning to $_, and I'm not sure what context
>> <> is going to get from defined(), so it might end up reading the whole
>> file.
>
>Well, that's easy enough to test.
>
> sub foo {
> print wantarray;
> }
> print defined(foo);
It says '1', not '11'. Thanks -- I was possessed with false laziness
when I posted :)
Also, it doesn't seem to provide a scalar context to <DATA>:
#!/usr/bin/perl -w
use strict;
my $x = defined(<DATA>);
my $y = <DATA>;
print "$x, $y\n";
__DATA__
There was a little girl
Who had a little curl
Right in the middle of her forehead.
This outputs:
1, Who had a little curl
So we have scalar context for <> in this case. (It doesn't matter if
defined is in scalar context or list context.)
>Also, I believe that EXPR means scalar context in functions documented
>as such.
In this case, apparently. But my EXPR doesn't provide either a scalar
or a list context to EXPR. (Is it said to provide a void context to
it, or is it said to provide no context at all?)
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Fri, 19 Nov 1999 11:29:08 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Is there no length() function?
Message-Id: <x3yhfiizbqj.fsf@tigre.matrox.com>
"Jun Xu" <jxu@wcom.net> writes:
> Function length() takes an array or hash as argument, not scalar.
Do you have any idea what you're talking about?
Did you read the docs?
Please don't post nonsense again.
--Ala
------------------------------
Date: 19 Nov 1999 12:21:56 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Is there no length() function?
Message-Id: <slrn83ag7u.qs.mgjv@wobbie.heliotrope.home>
On 19 Nov 1999 10:27:22 GMT,
Martien Verbruggen <mgjv@wobbie.heliotrope.home> wrote:
> On Fri, 19 Nov 1999 05:24:28 GMT,
> Philip 'Yes, that's my address' Newton <nospam.newton@gmx.li> wrote:
>
> > Use while(<>) [or, for older perls, while(defined($_=<>))].
>
> In the case of assigning to $_ that is not necessary.
grumble. I meant to say 'in the case of the implicit assigment to $_'.
--
Martien Verbruggen |
Interactive Media Division | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: 19 Nov 1999 10:27:22 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Is there no length() function?
Message-Id: <slrn838c0f.qs.mgjv@wobbie.heliotrope.home>
On Fri, 19 Nov 1999 05:24:28 GMT,
Philip 'Yes, that's my address' Newton <nospam.newton@gmx.li> wrote:
> Use while(<>) [or, for older perls, while(defined($_=<>))].
In the case of assigning to $_ that is not necessary.
while(<>) {}
is equivalent to
while(defined($_ = <>)) {}
What you are thinking of is something like:
while (my $line = <>) {}
which in 5.004 versions of perl used to give a warning, which has been
removed again in 5.005.
Martien
--
Martien Verbruggen |
Interactive Media Division | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: Fri, 19 Nov 1999 09:40:59 -0500
From: "Jun Xu" <jxu@wcom.net>
Subject: Re: Is there no length() function?
Message-Id: <813nlm$9b6$1@news.cis.ohio-state.edu>
Erik van Roode <newsposter@cthulhu.demon.nl> wrote in message
news:811odp$2dr$1@internal-news.uu.net...
> Jun Xu <jxu@wcom.net> wrote:
>
> > Function length() takes an array or hash as argument, not scalar.
>
> Where did you read that ???
>
OK, I goofed. Sorry about that.
------------------------------
Date: Fri, 19 Nov 1999 18:10:54 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Javascript w/ Perl
Message-Id: <OogZ3.284$AQ2.22013@newshog.newsread.com>
brondsem@my-deja.com wrote:
> Could anyone tell me if and how perl can work with javascript (other
> than creating javascript from your perl code). Is it possible in
> anyway to exchange variables or anything like this?
Remember the "?" option to the GET method.
http://what.ever.com/cgi-bin/big-perl?parm=longstring
You can write JavaScript code to formulate longstring, which can be a parm
list for the CGI program, and then submit the form yourself. What I often
do is dynamically generate a <input type=hidden ....> and pass the parms
that way. You can pass just about anything to Perl using this method.
Perl, of course, can generate JavaScript. Just put it in a here document
or something.
Scott
http://autoperl.skwc.com Automating Windows With Perl
------------------------------
Date: Fri, 19 Nov 1999 09:51:40 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: legal names and about sorting
Message-Id: <MPG.129f2e0bc2c3d56298a23c@nntp.hpl.hp.com>
In article <slrn83a4an.cru.jaakko.puurunen@cimpc199.cimcorp.fi> on 19
Nov 1999 09:03:27 GMT, jaakko.puurunen@_iki <jaakko.puurunen@_iki>
says...
...
> ¹FYI: I catched a typo on section "Caching the sortkeys" in
> $cache{$a} cmp $cache{$b) where ) should propably be }
> (it's present at least three times).
Yes, I found three clones of that line. Thanks for the sharp-eyed
catch.
> I also noticed that the link to Sort::Records
> (http://www.sysarch.com/perl/sort/) returns a "File Not Found" error.
Until Uri posts the Sort::Records module, there is no extra stuff at
that site.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 19 Nov 1999 09:03:27 GMT
From: jaakko.puurunen@_iki . fi (Jaakko Puurunen)
Subject: Re: legal names and about sorting
Message-Id: <slrn83a4an.cru.jaakko.puurunen@cimpc199.cimcorp.fi>
On Thu, 18 Nov 1999 15:39:22 -0800, David Cassell <cassell@mail.cor.epa.gov>
wrote:
>This is not a good thing. This is a symbolic reference. There
Ok, I'll look into this and try to learn correct ways to use them.
It's nice to know the name of the subject too (I've just been
doing things with the knowledge I have and these issues have not
surfaced before).
>Good. But you should use 'use strict;' too. Even though
>it will complain bitterly about your symrefs.
It seems it's time to start using it (I've been on the edge
already since it's just commented out).
>> sub by_asi_bus {
>>
>> @alist = (split (/-\D+/, $a))[-1];
>> @blist = (split (/-\D+/, $b))[-1];
>>
>> return $alist[$#alist] <=> $blist[$#blist];
>>
>> } # end of by_asi_bus
>
>Ewww. Sorry, but a complex expression like this is really
>going to slow down your sort when you get more lines in your
>array. And you're doing something odd with your indexing,
>since you've already made @alist and @blist into single-element
>arrays. Right?
Looking at it now: yes. Building an array from this makes no
sense ... in the example in FMTEYEWTK/sort.html they had several
colums where the splitting was useful. I'm glad you pointed this out.
>Umm, this is *exactly* what you told sort() to do. It is
>treating 102.20 as the value 102 + 1/5 instead of what you
>had in mind. It then sorted on that single non-integer
>number.
Ok, this was new to me.
>Well, you did great by getting as far as the FMTEYEWTK on
>sorting. But try this doc:
>http://www.hpl.hp.com/personal/Larry_Rosler/sort/sorting.html
I read this document¹ once and will read it again later to digest
more of it. I also read "More about the Scwartzian Transform" so
I can understand something about the solution kindly provided
by Mr. Larry Rosler.
Thanks again!
Jaska
¹FYI: I catched a typo on section "Caching the sortkeys" in
$cache{$a} cmp $cache{$b) where ) should propably be }
(it's present at least three times).
I also noticed that the link to Sort::Records
(http://www.sysarch.com/perl/sort/) returns a "File Not Found" error.
------------------------------
Date: 19 Nov 1999 12:41:40 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: legal names and about sorting
Message-Id: <813gi4$6a2$1@lublin.zrz.tu-berlin.de>
David Cassell <cassell@mail.cor.epa.gov> wrote in comp.lang.perl.misc:
[...]
>to get the error messages explained a bit. Then take the
>'use diagnostics' bit back out before you put the code into
>production, since it is a performance hit.
It is? That comes somewhat as a surprise, since it doesn't really
have to do anything unless errors (or warnings) occur.
Anno
------------------------------
Date: 19 Nov 1999 13:16:54 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: legal names and about sorting
Message-Id: <813ik6$reg$1@pegasus.csx.cam.ac.uk>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>David Cassell <cassell@mail.cor.epa.gov> wrote in comp.lang.perl.misc:
>
>[...]
>
>>to get the error messages explained a bit. Then take the
>>'use diagnostics' bit back out before you put the code into
>>production, since it is a performance hit.
>
>It is? That comes somewhat as a surprise, since it doesn't really
>have to do anything unless errors (or warnings) occur.
It isn't a performance hit at runtime. But it does slow down
loading your script a *lot*. This is because at compile time, it
locates and preprocesses the perldiag.pod file.
Obviously, that could be improved. Once upon a time, I experimented
with moving the processing to when the messages were first wanted.
But the main thing I achieved was to discover in how many ways Perl
could go bananas if you have elaborate stacks of require inside
eval inside $SIG{__DIE__} ...
At least some of these bugs have since been fixed. But if I were
experimenting again, I'd do the preprocessing at perl build time.
If only I could find a tuit ...
Mike Guy
------------------------------
Date: 19 Nov 1999 12:35:18 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Longest match
Message-Id: <slrn83b69g.l1a.abigail@alexandra.delanet.com>
Bart Lateur (bart.lateur@skynet.be) wrote on MMCCLXIX September MCMXCIII
in <URL:news:383369f6.2817487@news.skynet.be>:
$$ Rick Delaney wrote:
$$
$$ >Bart Lateur wrote:
$$ >>
$$ >> How can you easily find the longest substring of only spaces (at least
$$ >> two)? Maybe even using only one regex?
$$ >
$$ > print "($1)\n" if /( +)(?!.*\1)/s;
$$
$$ That is the same regex I came up with, just a little while ago (except
$$ for the //s). It looks like it will work. Note that this will find the
$$ *last* longest string of spaces, if there are more of the same length.
The disavantage of that is that it's supralinear [1] in the length of
the string.
my $substr = do {my @s = / +/g;
my $l = 0;
foreach (@s) {$l = length () if $l < length}
" " x $l};
[1] Probably quadratic.
Abigail
--
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} # Yet Another silly JAPH by Abigail
sub A::FETCH {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 19 Nov 1999 13:03:03 +0100
From: "Uwe W. Gehring" <gehring.u@zdf.de>
Subject: Re: MD5 encryption
Message-Id: <38353C77.E92E01A3@zdf.de>
David Cassell schrieb:
> Uwe W. Gehring wrote:
> >
> > Hi,
>
> Howdy,
>
> > I am running Apache on NT and build AuthFiles with htpasswd.exe which
> > uses MD5 encryption. How can I create the same strings using Perl?
> > Digest::MD5 does not create the same strings. I am using the ActiveState
> > Port of Perl 5, Build 522.
>
> Umm, are you aware that there is more than one way of returning
> MD5-encrypted info? Digest::MD5 has three such functions.
> If you read the docs you'll see that you may need to try all
> three to see which one matches the strings your program is
> generating.
>
None of the three results is matching.
>
> If none of them match what your program generates, you may
> need to delve into the manual for htpasswd.exe on your
> system and find out how it does MD5.. then implement it in
> Perl. If that's the case, please send your work to the
> author of Digest::MD5 so the module can be updated.
>
There is no documentation, only the C Source, but I am not a C Wizard. If
there would be a formula or something else, I should be able to implement it.
------------------------------
Date: 19 Nov 1999 10:51:57 +0100
From: Gisle Aas <gisle@aas.no>
Subject: Re: MD5 encryption
Message-Id: <m3r9hm7qrm.fsf@eik.g.aas.no>
"Uwe W. Gehring" <gehring.u@zdf.de> writes:
> I am running Apache on NT and build AuthFiles with htpasswd.exe which
> uses MD5 encryption. How can I create the same strings using Perl?
> Digest::MD5 does not create the same strings. I am using the ActiveState
> Port of Perl 5, Build 522.
Apache use an algorithm very similar to the one of in the
Crypt::PasswdMD5 module.
--
Gisle Aas
------------------------------
Date: Fri, 19 Nov 1999 11:38:24 +0100
From: "Uwe W. Gehring" <gehring.u@zdf.de>
To: Gisle Aas <gisle@aas.no>
Subject: Re: MD5 encryption
Message-Id: <383528A0.3E1E17E7@zdf.de>
Gisle Aas schrieb:
> "Uwe W. Gehring" <gehring.u@zdf.de> writes:
>
> > I am running Apache on NT and build AuthFiles with htpasswd.exe which
> > uses MD5 encryption. How can I create the same strings using Perl?
> > Digest::MD5 does not create the same strings. I am using the ActiveState
> > Port of Perl 5, Build 522.
>
> Apache use an algorithm very similar to the one of in the
> Crypt::PasswdMD5 module.
>
> --
> Gisle Aas
Thanks for this hint. Does "very similar" mean that it produces the same
results?
Uwe
------------------------------
Date: Fri, 19 Nov 1999 10:33:20 -0600
From: "Chris Beatson" <cbeatson@mail.ci.lubbock.tx.us>
Subject: Module for Netware NDS ?
Message-Id: <813u94$goh$1@spider.ci.lubbock.tx.us>
I'm looking for the Netware::NDS module. It is listed under CPAN as an
available module, but I could not find a place to download it. Emailed the
author, but no reply. If anyone knows where I can get hold of this module,
or any other solutions to interface with NDS, I would appreciate it.
TIA
Chris Beatson
------------------------------
Date: Fri, 19 Nov 1999 18:12:43 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: Multiple file download
Message-Id: <vqgZ3.285$AQ2.22013@newshog.newsread.com>
Jean-Charles Savelli (jcs@netexpansion.com) wrote:
> Now I have to let the visitor choose more than one file, so that
> he can
> download several files, filing out the form only once.
> How can it be done ?
Zip them first, and let the user download the zip file.
Scott
------------------------------
Date: Thu, 18 Nov 1999 22:11:14 -0600
From: Cure <cure@texas.net>
Subject: my database
Message-Id: <3834CDE2.83821EBF@texas.net>
i have a database that allow me to delete a user and the code works but
it doesnt make sense to me, basically what im saying is that i d/l this
cgi and i dont see how this code could delete a user out of the
database. could soembody explain it to me or give me a better code
{
open(LIST,"$logfile" || &error('Could not open log file.'));
@logs = <LIST>;
close(LIST);
foreach $i (@logs) {
chop($i);
($username,$name,$email,$pwd) = split(/\|/,$i);
if($FORM{'user'} eq $username && $FORM{'passwd'} eq $pwd) {
open(LIST,">$logfile" || &error('Could not open log file.'));
foreach $i (@logs) {
@userd = split(/\|/,$i);
unless($userd[0] eq $FORM{'user'}) {
print LIST "$i\n";
}
}
close(LIST);
}
------------------------------
Date: Fri, 19 Nov 1999 10:53:25 +0100
From: "Steph" <sgomes@channelcom.fr>
Subject: Need some help in cluding perl in a C program
Message-Id: <8136n0$m2i$1@buggy.easynet.fr>
Hello,
I want to include a perl script in a C program but when I use a mdoule
in my perl script such as IO::Socket, how can I tell the C compiler to take
care of the perl library.
I'm in a hurry so can someone responde to my question asa soon as
possible !!!
sgomes@channelcom.fr
------------------------------
Date: Fri, 19 Nov 1999 18:38:59 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Need some help in cluding perl in a C program
Message-Id: <7PgZ3.28543$YI2.1314888@typ11.nn.bcandid.com>
In article <8136n0$m2i$1@buggy.easynet.fr>, Steph <sgomes@channelcom.fr> wrote:
> I'm in a hurry so can someone responde to my question asa soon as
>possible !!!
Have you considered that it might be rude to ask someone who is, by
definition, volunteering to help you for free, to respond to your
question as soon as possible? No? Well, it is.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Fri, 19 Nov 1999 18:18:42 GMT
From: scott@aravis.softbase.com (Scott McMahan)
Subject: Re: No Fork in NT Perl and Print to socket
Message-Id: <6wgZ3.288$AQ2.22013@newshog.newsread.com>
Mark Ruedy (mruedy@alidian.com) wrote:
> can't fork for any known windows implemetation
A discussion of why you can't fork() in Windows can be found in my book
Automating Windows With Perl. Like I say there, there are some packages
which emulate fork() in Windows, but you have to use the provided runtime
systems which do the emulation. ActiveState is working on a fork() which
is based (as I understand it) on the fact Perl is an interpreter that can
be cloned among Win32 threads so each interpreter instance gets its own,
independent state walled off from the others. It will be an interpreter
fork and not an OS fork, if that makes any sense. (I think this is
a rather extreme case of anything being solvable by another layer of
indirection -- if you can't fork, copy the whole interpreter. I'm really
interested to see if it is more or less efficient to fork an interpreter
than a whole process.)
The way to do this is to get rid of the fork() paradigm and use threads,
if Perl's threads are stable enough. Threads, in Perl and Java, are the
way to go for cross-platform server portability. Any OS which does not
support the UNIX fork/exec kernel model will have a clumsy emulation
layer, while all modern OSes support threads natively. (Although in
different ways, but the interpreted language hides that in both cases.)
Scott
http://autoperl.skwc.com Automating Windows With Perl
------------------------------
Date: Fri, 19 Nov 1999 18:55:07 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: No Fork in NT Perl and Print to socket
Message-Id: <38399c2e.2101760@news.skynet.be>
Mark Ruedy wrote:
>Since there is no fork() in my version of Perl, is there another way to
>accomplish this:
No. :-/ It's not your Perl version, it's the underliying OS that
doesn't support fork(). You might be able to work around it by starting
external programs, but it won't be easy. And threads are not the future.
--
Bart.
------------------------------
Date: Thu, 18 Nov 1999 23:28:19 -0500
From: "Chris Collins" <cpcollin@wam.umd.edu>
Subject: Re: Oracle via the web
Message-Id: <812jmn$coj$1@hecate.umd.edu>
I've tried this and it hasn't seemed to help. The script works fine when
run from the shell so I looked into my webserver logs, here's the error I've
found.
at /home/cpcollin/httpd/cgi-bin/con.pl line 14
install_driver(Oracle) failed: Can't load
'/usr/local/lib/perl5/site_perl/alpha-dec_osf/auto/DBD/Oracle/Oracle.so' for
m
odule DBD::Oracle: dlopen: cannot load
/usr/local/lib/perl5/site_perl/alpha-dec_osf/auto/DBD/Oracle/Oracle.so at
/usr/lo
cal/lib/perl5/alpha-dec_osf/5.00404/DynaLoader.pm line 166.
at (eval 1) line 2
at /tmp_mnt/home/fcmsc424sc/sc42410/httpd/cgi-bin/con.pl line 14
my executable script is con.pl and line 14 is the DBI->connect(...) call.
I have no idea why it can't load these modules, I checked the permissions on
all of these files and they seem to check out.
Does anyone know what is going on here?
Chris
Makarand Kulkarni <makkulka@cisco.com> wrote in message
news:383485E2.42736DA7@cisco.com...
> Chris Collins wrote:
>
> > This script works fine when I run it in the shell, but when I run it via
the
> > web, it never gets past connecting to Oracle.
>
> Try setting $ENV{'ORACLE_HOME'} = your oracle_home ;
> --
>
------------------------------
Date: 19 Nov 1999 10:29:08 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Oracle via the web
Message-Id: <38352674_1@newsread3.dircon.co.uk>
Chris Collins <cpcollin@wam.umd.edu> wrote:
> I've tried this and it hasn't seemed to help. The script works fine when
> run from the shell so I looked into my webserver logs, here's the error I've
> found.
>
> at /home/cpcollin/httpd/cgi-bin/con.pl line 14
> install_driver(Oracle) failed: Can't load
> '/usr/local/lib/perl5/site_perl/alpha-dec_osf/auto/DBD/Oracle/Oracle.so' for
> m
> odule DBD::Oracle: dlopen: cannot load
> /usr/local/lib/perl5/site_perl/alpha-dec_osf/auto/DBD/Oracle/Oracle.so at
> /usr/lo
> cal/lib/perl5/alpha-dec_osf/5.00404/DynaLoader.pm line 166.
>
> at (eval 1) line 2
>
> at /tmp_mnt/home/fcmsc424sc/sc42410/httpd/cgi-bin/con.pl line 14
>
>
AHAH ! You will need to set the environment variable LD_LIBRARY_PATH (or
whatever the moral equivalent is on your system) so the DBD module knows
where to find the Oracle client libraries (at a guess) - I have become
a bit blase about this with Linux putting this in ld.so.conf globally ...
/J\
--
"Malcolm, what have I told you about putting chocolate near your
crotch?" - Mrs Merton
------------------------------
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 1431
**************************************