[8098] in Perl-Users-Digest
Perl-Users Digest, Issue: 1717 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 23 20:08:20 1998
Date: Fri, 23 Jan 98 17:00:22 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 23 Jan 1998 Volume: 8 Number: 1717
Today's topics:
Re: /x regex mystery (John M. Klassa)
Re: @ == @, comparing arrays (Mark-Jason Dominus)
Re: @INC on winNT (Andy Lester)
`dir`command in IIS3.0 gives no output <peterson@cns.uni.edu>
Re: Beginner question re: evaluating home directories (Mark-Jason Dominus)
Re: Beginner question re: evaluating home directories (Tad McClellan)
Browser Identification? <bazaillion@primary.net>
CGI.pm and server errors <sanjay@cis.ohio-state.edu>
Re: chown -h <doug@tc.net>
Re: conditionally use a module <rootbeer@teleport.com>
DBI::Oracle question ("Verma Kakarlapudi")
email address (G. E. Terry)
extraction out of variable lenght records <philipv@leland.Stanford.EDU>
Re: finding file name from partial information (Greg Bacon)
Re: Hashes w/ case-insensitive keys (Jonathan Feinberg)
Re: Help with Stripping charactes from strings based up <cberry@cinenet.net>
Re: Help!!! simple problem (Mark-Jason Dominus)
Re: I need a man to lick me in to a frenzy!!! (Andy Lester)
Re: Logical 'and' in regex? (Jonathan Stowe)
multithread perl <ctc@cisco.com>
Re: nested +?* in regexp (Greg Bacon)
Re: nested +?* in regexp (Tad McClellan)
Re: New DBD-Oracle <zenin@best.com>
Re: Perl 5.004_04 memory bug <zenin@best.com>
Problems with sockets connect() on NT port jtolley@es.com
Re: Sort help please (Andy Lester)
Re: xs with 3rd party static libs dwatson@netguide.com
Re: xs with 3rd party static libs (Greg Bacon)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 23 Jan 1998 23:51:51 GMT
From: klassa@aursgh.aur.alcatel.com (John M. Klassa)
Subject: Re: /x regex mystery
Message-Id: <6abaen$6o1$1@aurwww.aur.alcatel.com>
On Fri, 23 Jan 1998, brian d foy wrote:
->it makes all the whitespace go away. are you try to match
->TomChristiansen? :)
Yup... Another *duh* on my part (I posted a similarly stupid,
in retrospect, question a couple of weeks ago). I'm 0-for-2 now.
Sigh. :-)
Sorry to bother y'all...
John
--
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><
------------------------------
Date: 23 Jan 1998 18:23:57 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: @ == @, comparing arrays
Message-Id: <6ab8qd$gnb$1@monet.op.net>
Keywords: hornwort magma pandemic wristband
In article <En9AuB.L6y@bcstec.ca.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
>The following array equality test works well for small
>arrays that don't contain code or anonymous array refs:
>
>
>if (@array1 == @array2 and "@array1" eq "@array2" and
> "@{[reverse @array1]}" eq "@{[reverse @array2]}") {
> # arrays are same
>}
Holy cow. It certainly does not.
@array1 = ("", " ", " ", "");
@array2 = ("", " ", "", "");
Please let go of this stupid idea before you hurt yourself.
You cannot fix a broken hack by piling two more broken hacks on top of
it.
------------------------------
Date: 23 Jan 1998 23:10:37 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: @INC on winNT
Message-Id: <6ab81d$cl5$2@usenet76.supernews.com>
: for some reason when perl is run from the command line it has the
: correct paths in @INC, yet when i execute cgi/perl scripts through the
: web server @INC is empty. and i can't seem to assign to it.
: does anyone know what i am talking about?
: any help much appreciated
That's right. When you're running scripts from the command line, you have
the PERLLIB or PERL5LIB env vars set. When the web server runs them, it
doesn't. You need to set the system-wide PERLLIB variable. Right click
on My Computer and go to the Environment tab. Set PERLLIB as a System
Variable.
xoox,
Andy
--
--
Andy Lester: <andy@petdance.com> http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com> http://ChicagoMusic.com/
------------------------------
Date: Fri, 23 Jan 1998 16:57:56 -0600
From: Kerry Peterson <peterson@cns.uni.edu>
Subject: `dir`command in IIS3.0 gives no output
Message-Id: <34C92074.A0C7BE75@cns.uni.edu>
We're trying to implement a search script in perl using IIS3.0 . It is
an adaptation of Matt Wright's Simple-Search script. It should be able
to read through the wwwroot directory tree, and output the names of all
files containing the searched-for string of characters.
When the script is called from a web page, the dir command should be
able to read in the contents of the directory for processing, as in:
$ls = `dir\/b $directory_name`; #which should put the output of dir
command in $ls
However, the $ls variable contains nothing.
This method seems to work fine from the command line, but when run via
the internet, it reads nothing.
For the sake of testing, I've given full permissions to the files and
directories via NTFS and IIS, but it still won't work. What else might
we try?
Thank you,
Kerry Peterson
Graduate College
University of Northern Iowa
------------------------------
Date: 23 Jan 1998 18:06:31 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Beginner question re: evaluating home directories
Message-Id: <6ab7pn$gjj$1@monet.op.net>
Keywords: angst arcsine Connors involutory
In article <17EE7E8B6S86.LSEAMANS@mu3.millersv.edu>,
Lynne Seamans <LSEAMANS@mu3.millersv.edu> wrote:
>The short form of the question is how do I do the csh
>equivalent of " ~userid" ? In other words, I've got
>a userid and I need to get his home directory.
($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell)
= getpwnam($username);
$dir is the home directory.
------------------------------
Date: Fri, 23 Jan 1998 17:51:07 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Beginner question re: evaluating home directories
Message-Id: <bdaba6.d8j.ln@localhost>
Lynne Seamans (LSEAMANS@mu3.millersv.edu) wrote:
: Sorry to post such a beginner question, but I've had this
: plopped on me to be done by monday and I've never perled
: before.
You're in luck!
You are not used to having a _whole bunch_ of documentation, written
by the people who write/maintain the compiler/interpreter itself,
if you only have experience with non-Perl languages.
The perl distribution _comes with_ hundreds of pages of documentation.
Find out where it is on your system, and grep freely and often ;-)
You could have answered this yourself in 60 seconds this way...
When you're in a hurry, the docs that come with perl are a life saver!
: The short form of the question is how do I do the csh
: equivalent of " ~userid" ? In other words, I've got
: a userid and I need to get his home directory.
^^^^^^^^^^^^^^
cd /dir/with/pod/files/
grep 'home directory' *.pod
finds two lines.
Opening up perlop.pod we see (my underlining):
---------------------------
=head2 C-style Logical Or
Binary "||" performs a short-circuit logical OR operation. That is,
if the left operand is true, the right operand is not even evaluated.
Scalar or list context propagates down to the right operand if it
is evaluated.
The C<||> and C<&&> operators differ from C's in that, rather than returning
0 or 1, they return the last value evaluated. Thus, a reasonably portable
way to find out the home directory (assuming it's not "0") might be:
^^^^^^^^^^^^^^
$home = $ENV{'HOME'} || $ENV{'LOGDIR'} ||
(getpwuid($<))[7] || die "You're homeless!\n";
---------------------------
*That's* productivity!
: we've trying to clean up our automated account maintenance
: before the beginning of the semester (ie, MONDAY) and the
: person who wrote it is of course long gone.
What's the emoticon for a tiny little violin ;-)
Been there. Done that.
: Thanks for any assistance.
You're welcome.
Use the power of the docs only for Good.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 23 Jan 1998 17:38:16 -0600
From: darkcyde <bazaillion@primary.net>
Subject: Browser Identification?
Message-Id: <34C929E8.3C17@primary.net>
Hello,
I am writing a Perl script to do browser identification, does anyone
know of a web site that has all the latest UserAgent variables for all
the latest browsers.
I need them for Netscape Navigator 3.0, Netscape Communicator 4.0,
Internet Explorer 3.0, and Internet Explorer 4.0.
Thanks,
Michael Bazaillion
--
So Brain, whatdya wanna do tonight?
Same thing we do every night, Pinky. Try to take over the world!
------------------------------
Date: Fri, 23 Jan 1998 18:58:39 -0500
From: Sanjay Vohra <sanjay@cis.ohio-state.edu>
Subject: CGI.pm and server errors
Message-Id: <34C92EAE.F297E6D@cis.ohio-state.edu>
hi
i'm just running a simple script that does nothing but put something in
HTML with CGI.pm however i get
this problem when i run the script as such and the following if i check
for errors on the server (nes)
-------------------------------------------
(offline mode: enter name=value pairs on standard input)
Content-type: text/html
Undefined subroutine CGI::isa
--------------------------------------------
(some IP stuff)... trying to GET /~cue/ue-cgi-bin/ugly.cgi,
handle-processed reports: no way to service request for
/~cue/ue-cgi-bin/ugly.cgi
--------------------------------------------
any comments ?
thanks
sv
and here is the script
use Sybase::DBlib;
use UNIVERSAL;
use CGI qw(:standard);
print header;
print start_html(-title=>'The Great Application... tada!!!');
print h1('Entering Your Social Security Number');
print hr;
print end_html;
------------------------------
Date: 23 Jan 1998 18:38:44 -0500
From: Douglas McNaught <doug@tc.net>
Subject: Re: chown -h
Message-Id: <m2g1me69rv.fsf@ono.tc.net>
Mark Moe <mark.moe@medtronic.com> writes:
> I'm using Solaris 2.5... and yes, it is "cosmetic",
> but I thought if /bin/chown had -h, then why not
> perl. But, I guess it doesn't really matter...
The reason /bin/chown has '-h' is to control whether the '-R' option
recurses through symlinked subdirectories (something you usually don't
want). Perl's chown() (and the corresponding system call) don't
recurse so they have no equivalent.
-Doug
--
sub g{my$i=index$t,$_[0];($i%5,int$i/5)}sub h{substr$t,5*$_[1]+$_[0],1}sub n{(
$_[0]+4)%5}$t='encryptabdfghjklmoqsuvwxz';$c='fxmdwbcmagnyubnyquohyhny';while(
$c=~s/(.)(.)//){($w,$x)=g$1;($y,$z)=g$2;$w==$y&&($p.=h($w,n$x).h($y,n$z))or$x==
$z&&($p.=h(n$w,$x).h(n$y,$z))or($p.=h($y,$x).h($w,$z))}$p=~y/x/ /;print$p,"\n";
------------------------------
Date: Fri, 23 Jan 1998 14:51:31 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Hendrik Klompmaker <Hendrik.Klompmaker@net.iend.wau.nl>
Subject: Re: conditionally use a module
Message-Id: <Pine.GSO.3.96.980123144620.17597e-100000@user2.teleport.com>
On Fri, 23 Jan 1998, Hendrik Klompmaker wrote:
> Is it possible to conditionally USE a module or not ?
BEGIN {
if ($some_condition) {
eval {
require 'Foo.pm';
};
if ($@) {
warn "Guess we can't use Foo: $@";
} else {
import Foo qw/params to Foo/;
}
}
}
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Fri, 23 Jan 1998 18:43:37 -0500
From: vkakarla@adelphia.net ("Verma Kakarlapudi")
Subject: DBI::Oracle question
Message-Id: <001d01bd2858b9e704c0de123018@default.pha.adelphia.net>
First I want to thank everyone who helped me to solve my problem using
Exporter module. It works. Thanks again..
Here is the scenario where I need some help..
#!/usr/local/bin/perl
use DBI;
@array = (1,2,3) # array can have more than 3 items..
$str = join(',', @array);
$dbh = $DBI->connect('database', 'user', 'passwd');
my $cur = $dbh->prepare(q{
SELECT f_name, l_name
FROM tbl1, tbl2
WHERE tbl1.sex = ?
AND tbl2.previous_positions in (?)
AND tbl1.id = tbl2.id
});
$cur->execute('M', $str);
(while ($first_name, $last_name) = $cur->fetchrow) {
print "first_name $last_name\n";
}
$cur->finish;
$dbh->disconnect;
exit;
PROBLEM: I get a database handle but can't prepare the statement. I don't
get a value for $cur, so it doesn't execute. Where seems to be the problem,
can somebody please help??
------------------------------
Date: Fri, 23 Jan 98 20:55:21 GMT
From: admin@net-ops.net (G. E. Terry)
Subject: email address
Message-Id: <6ab03p$2gj$1@ns2.adult-host.net>
What would be the best way to test a variable called $emailaddress to see if
it contains an email address in the correct format?
------------------------------
Date: Fri, 23 Jan 1998 15:54:11 -0800
From: Philip Rene Denis Vermeulen <philipv@leland.Stanford.EDU>
Subject: extraction out of variable lenght records
Message-Id: <34C92DA3.62FE@leland.Stanford.EDU>
Hi,
I'm trying to solve the following problem with Perl.
I have multiple ASCI files (ten) with records of the following format.
Each record has a fixed lenght beginning (144 positions) and then a
variable lenght which looks like this (code (4 positions) value (6
positions) code (4 positions) value (6 positions) code value code
value, and so on).
That's how the variable lenght part of e.g. 3 records looks like :
There are no blanks between code and value.
0010001145001100076500120067650014000546
001000065600110065230012000456
001000887600120004330014005678
In the first record code 0010 has a value of 1145, code 0011 has a value
of 765, code 0012 has a value of 6765, code 0013 is missing, code 0014
has value 546.
Now I need to extract only the value of some codes (for each record the
same codes), to construct a file like this :
(Suppose I want to extract code 0011 and code 0014)
0011 000765 0014 000546
0011 006523 0014 ......
0011 ...... 0014 005678
I can scan each record within a loop and get a code out with substr
and see if it matches the code I want. But this seems to be not an
efficient solution.
Also a regular expression won't help me, I suppose, since e.g. 0011 can
appear within value 450011 e.g. .
Any suggestions are really very much appreciated.
I do need efficiency since I have more than 150,000 records in each file
, and each record can be as long as 14,000 characters . There are really
a lot of codes and values !
Thank you,
Philip
Suggestions can be mailed to :
philipv@leland.stanford.edu
------------------------------
Date: 23 Jan 1998 23:32:40 GMT
From: gbacon@adtran.com (Greg Bacon)
Subject: Re: finding file name from partial information
Message-Id: <6ab9ao$ssf$2@info.uah.edu>
[Posted and mailed]
In article <jc6btx3f7pb.fsf@abqn07.ato.sca.philips.com>,
Robert Lopez <Robert.Lopez@abq.sc.philips.com> writes:
: I need to find the complete name of a file when I only
: know some of the characters of the file name.
There are two possibilities.
Possibility the First: use opendir and grep, e.g.
opendir HERE, '.' or die "Failed opendir .: $!\n";
@files = grep { /$pattern/ } readdir HERE;
closedir HERE;
Possibility the Second: use glob, e.g.
@files = <*.{c,h,bak}>;
Currently, perl's builtin glob is not safe and should not be trusted,
even -T won't protect you. It's also pretty slow. The hope is that
this problem will be fixed Real Soon Now such that all platforms can
have safe, csh-compatible globbing.
Hope this helps,
Greg
--
open G,"|gzip -dc";$_=<<EOF;s/([0-9a-f]+)/print G pack"h*",$1/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Fri, 23 Jan 1998 18:00:50 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Hashes w/ case-insensitive keys
Message-Id: <MPG.f32eb29c55701b09896ae@news.concentric.net>
comdog@computerdog.com said...
> ah - a PoB situation. perhaps you want to hack that particular method to suit you :)
^^^
Please gloss for the slow-on-the-uptake (pronounced: "me").
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Fri, 23 Jan 1998 15:38:32 -0800
From: Craig Berry <cberry@cinenet.net>
To: "Russell S. Virgilio" <ccastrv@prism.gatech.edu>
Subject: Re: Help with Stripping charactes from strings based upon patterns
Message-Id: <Pine.GSO.3.95.980123151512.13836C-100000@hollywood.cinenet.net>
On Fri, 23 Jan 1998, Russell S. Virgilio wrote:
> what i am trying to accomplish is to take each line similar to the above,
> and then strip it down to just the hostname. I figured I had to use
> patterns as every line doens't have the exact same amount of spaces. Does
> this clear it up a little for you? Thanks for your help.
The form of split I suggested will split on any amount of whitespace (like
/\s+/, plus exclusion of leading spaces), so it should work fine for you.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 23 Jan 1998 18:33:29 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Help!!! simple problem
Message-Id: <6ab9c9$gpj$1@monet.op.net>
Keywords: Chevy goldfish measle referenda
In article <6ab38t$hv6@epx.cis.umn.edu>,
Hiu-Man Cheung <cheung@cs.umn.edu> wrote:
>I want to write a perl script to do `man $cmd |less`
>and my code will not stop at the first page, looks like `less`
>never get executed. How to do this?
>
>#!/usr/local/bin/perl -w
>$cmd=$ARGV[0];
>print (`man $cmd | less`);
What you have done here is similar to doing
man command | less | perl -pe ''
In such cases, `less' disables itself. In your program, `less' has
disabled itself for the same reason.
Try this:
$cmd = $ARGV[0];
system("man $cmd | less");
instead.
------------------------------
Date: 23 Jan 1998 22:55:21 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: I need a man to lick me in to a frenzy!!!
Message-Id: <6ab74p$cl5$1@usenet76.supernews.com>
Please, we've ignored some key elements of the requirements document: "I
need a man to lick me in to a frenzy!!!"
First, if we equate "need" and "require", then it's clear that our code
should start:
require "man.pm";
This can also be written as:
use man;
This seems self-explanatory.
We'll also need an instance of a man:
$man = man->new;
>From there, it's simple:
until ( $self->in( "frenzy" ) ) {
$man->lick( $self );
}
The construct "$self->lick( $self )" is technically possible, but not
recommended. Then again, TMTOWTDI.
xoxo,
Andy
--
--
Andy Lester: <andy@petdance.com> http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com> http://ChicagoMusic.com/
------------------------------
Date: 24 Jan 1998 00:11:26 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Logical 'and' in regex?
Message-Id: <6abbje$60h$1@uranium.btinternet.com>
In article <34C61D6A.5244@netserv.unmc.edu>, ptimmins@netserv.unmc.edu
says...
>
>Chipmunk wrote:
>>
>> Eli the Bearded wrote:
>> >
>> > has never seen the hip owls book in a bookstore
>>
Them hip owls lost boys allsort of wonderful birds.
I see Hip owls on books but what are they really?
Now we have Cross bred Camels & llamas ( and I saw a llama on the
wa7y to have my proximal interphalangeal stiffness treated earlier)
what can I read ???
/J\
------------------------------
Date: Fri, 23 Jan 1998 15:00:43 -0800
From: Chuck Chiang <ctc@cisco.com>
Subject: multithread perl
Message-Id: <34C9211B.57FF@cisco.com>
I heard that there has been some work done to make Perl multithreaded.
Could anyone tell me where to find information about this?
Please send email directly to me at ctc@cisco.com.
thanks very much
-chuck
------------------------------
Date: 23 Jan 1998 23:25:04 GMT
From: gbacon@adtran.com (Greg Bacon)
Subject: Re: nested +?* in regexp
Message-Id: <6ab8sg$ssf$1@info.uah.edu>
[Posted and mailed]
In article <6ab2uo$ao4$1@henson.cc.kzoo.edu>,
k96rk01@cc.kzoo.edu (Robert J. Kent) writes:
: $testStr = 'C++ is';
:
: if($longStr =~ /$testStr/){
: # do "success" case...
: }
:
: because the 'C++' has a nested quantifier. how do i work around this?
$testStr = quotemeta 'C++ is';
...or use \Q\E. Read the perlfunc entry on quotemeta for more details.
Hope this helps,
Greg
--
open G,"|gzip -dc";$_=<<EOF;s/([0-9a-f]+)/print G pack"h*",$1/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Fri, 23 Jan 1998 17:59:21 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: nested +?* in regexp
Message-Id: <psaba6.59j.ln@localhost>
Robert J. Kent (k96rk01@cc.kzoo.edu) wrote:
: the following program, compiled AS-IS, doesn't work.
: #!/usr/bin/perl
Where's your -w switch?
You should ALWAYS use the -w switch.
Really.
: $testStr = 'C++ is';
: $longStr = 'i think C++ is bloated and slow.';
: if($longStr =~ /$testStr/){
: # do "success" case...
: }
[snip]
: because the 'C++' has a nested quantifier. how do i work around this?
The way the Perl FAQ says to work around it. What else?
: moreover, the string is ACTUALLY coming from a file, so i can't just type
: 'C\+\+' even if that WOULD work. which i don't think it would.
That *would* work. Tedious though ;-)
(you didn't even try it, did you?)
: so, long
: story short: how do i match nested quantifiers in strings?
You don't _want_ to have nested quantifiers.
You want to have literal characters (without their usual regex meta-meaning)
: BTW, i HAVE browsed a couple of faqs to no avail. if there's a section i'm
: missing, PLEASE enlighten me!
There is a section you're missing.
What method of searching do you use?
from Perl FAQ, part 6:
--------------------------
=head2 How can I quote a variable to use in a regexp?
The Perl parser will expand $variable and @variable references in
regular expressions unless the delimiter is a single quote. Remember,
too, that the right-hand side of a C<s///> substitution is considered
a double-quoted string (see L<perlop> for more details). Remember
also that any regexp special characters will be acted on unless you
precede the substitution with \Q. Here's an example:
$string = "to die?";
$lhs = "die?";
$rhs = "sleep no more";
$string =~ s/\Q$lhs/$rhs/;
# $string is now "to sleep no more"
Without the \Q, the regexp would also spuriously match "di".
--------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 23 Jan 1998 23:48:20 GMT
From: Zenin <zenin@best.com>
Subject: Re: New DBD-Oracle
Message-Id: <885599522.780418@thrush.omix.com>
Daniele Scarpa <scarpa@mall.it> wrote:
: I have these software: Perl 5.003 , Oracle 7.311 , os Irix 6.4
^^^^^^^^^^
Upgrade your perl to 5.00404. I've had *much* better luck getting
the DBD::* modules to work under it.
After that, try it again and post the output of "perl -V" with the
error messages so we can know the exact details of your compiling
environment. It's hard to know what's going on when we don't even
know what compiler you're using and it's exact version. -Gcc would
probably be the best choice over the joke of a compiler that SGI
ships. If you can, compile everything in 32 bit mode and use 32
bit Oracle libs if they have different versions (I'm not sure they
ship two versions or not). Also make sure your LD_LIBRARY_PATH and
friends can all find the Oracle junk, err I meen librarys. :-)
--
-Zenin
zenin@best.com
------------------------------
Date: 24 Jan 1998 00:02:51 GMT
From: Zenin <zenin@best.com>
Subject: Re: Perl 5.004_04 memory bug
Message-Id: <885600392.149793@thrush.omix.com>
Rohan Oberoi <rohan.oberoiTAKETHISOUT@cornell.edu> wrote:
: I seem to have uncovered a bug in Perl, based on the fact that I'm getting
: SEGV core dumps, which I believe I shouldn't get under any circumstances.
Hehe, you haven't really been programming perl then! :-)
J/k, but to tell you the truth I manage to SEGV perl at least 3 or
4 times a month. 90% of the time it's just me forgetting what a
total piece of trash Solaris and SysV in general really is. -Long
live BSD!
Are you doing anything vaguely interesting with sig handlers?
Pipes? Almost anything with networking that isn't just cut and
paste from the perlipc man page? Shared memory?
Can you list the system calls, if any, that you're making? eg,
socket() and friends, four arg select(), shm*() stuff. Basically
anything more interesting then open("filename"), <FH>, and
unlink().
You might want to try making a debug version of perl. See the
documentation in the source for setting the correct flags. This
will allow you to use gdb on the core file to know what went bang.
--
-Zenin
zenin@best.com
------------------------------
Date: Fri, 23 Jan 1998 17:11:40 -0600
From: jtolley@es.com
Subject: Problems with sockets connect() on NT port
Message-Id: <885596987.1322385431@dejanews.com>
I'm using the Perl5 Windows NT port, and trying to get used to network
programming with Perl. I'm trying to run sample client/server programs,
and the server works fine (at least, as far as I've been able to test it)
but the client won't connect. It creates and binds the socket (with
socket() and bind ()) just fine, but the connect call never succeeds. It
dies, printing out the error message: Unknown Error: 0x00002741 Can
anyone help me through this problem? Please e-mail any responses to
jtolley@es.com, rather than posting them, because I don't get much time
to look at newsgroups. Thanks in advance.
Josh Tolley
Evans & Sutherland
Salt Lake City, UT
(801) 588-1443
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 23 Jan 1998 23:13:24 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: Sort help please
Message-Id: <6ab86k$cl5$3@usenet76.supernews.com>
: : for $name1 (sort { $temp{$a} cmp $temp{$b} } keys %total) {
: cmp compares strings.
: <=> compares numbers.
I believe the -w flag would have caught this.
xoxo,
Andy
--
--
Andy Lester: <andy@petdance.com> http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com> http://ChicagoMusic.com/
------------------------------
Date: Fri, 23 Jan 1998 17:22:02 -0600
From: dwatson@netguide.com
To: dwatson@netguide.com
Subject: Re: xs with 3rd party static libs
Message-Id: <885597290.1349779471@dejanews.com>
Hello again,
This is an update to my earlier message about extending Perl with C
function which uses a 3rd party vendors static C libaries. I was able to
get it to work, but it seems like a hack.
My current solution is to combine the efforts of my previouse two
tries. First I create a Makefile.PL like this:
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'MyName::ModuleName',
'VERSION_FROM' => 'ModuleName.pm',
'DEFINE' => '',
'XSPROTOARG' => '-noprototypes',
'LIBS' => ['-L./lib -lfoo -lbar -lsocket -lnsl -lthread'],
'INC' => '-I./inc',
);
../lib has the 3rd party vendors static C libaries and ./inc has the
header files for those libs. socket, nsl and thread are "standard"
libraries in normal lib dirs. At this point I can 'make' and get a
ModuleName.o file. I move this into ./obj directory.
Then I make a Makefile.PL like this:
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'MyName::ModuleName',
'VERSION_FROM' => 'ModuleName.pm',
'DEFINE' => '',
'LIBS' => ['-lsocket -lnsl -lthread'],
'XSPROTOARG' => '-noprototypes',
'OBJECT' => 'obj/foo_func.o obj/bar_func.o obj/ModuleName.o',
);
I have unarchived the .a files into their respective .o files and put
them all in the ./obj directory. In my previouse attempt, this MakeMaker
did not produce a ModuleName.c or ModuleName.o, but it did create a
ModuleName.so that ld was able to deal with (except for the bootstrap
function which was should be provided by XS)
If I 'make' and 'make test' this it works. Notice that ModuleName.o
file which was compiled previousely.
This is a two step process right now and it would be really nice if it
could be done as one step. The MakeMaker documentation suggests that
there should be a way to create ModulName.o in a subdir and have it
placed in the ./obj dir. Isn't there a way to include object files in
MakeMaker, but have it create ModuleName.c and ModuleName.o files. In my
(limited) experience, this does not happen. FWIW...
Dennis
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 23 Jan 1998 23:50:15 GMT
From: gbacon@adtran.com (Greg Bacon)
Subject: Re: xs with 3rd party static libs
Message-Id: <6ababn$ssf$3@info.uah.edu>
[Posted and mailed]
In article <885534094.926613505@dejanews.com>,
dwatson@netguide.com writes:
: I have a C function which uses a 3rd party vendors C libaries. The
: libraries were supplied as a set of static .a files (libfoo.a, libbar.a,
: &Etc) and a set of header files (foo.h, bar.h,...). I must use their API
: to do a remote procedure call and get a scalar string result back.
Have you looked at Example 4 in the perlxstut manpage? The manpage for
ExtUtils::Embed may also be useful to you.
Hope this helps,
Greg
--
open G,"|gzip -dc";$_=<<EOF;s/([0-9a-f]+)/print G pack"h*",$1/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
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 1717
**************************************