[7016] in Perl-Users-Digest
Perl-Users Digest, Issue: 641 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 20 18:27:14 1997
Date: Fri, 20 Jun 97 15:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 20 Jun 1997 Volume: 8 Number: 641
Today's topics:
***How to get info from the HTML files in other server? <jpoon@iastate.edu>
Re: a perl mode in emacs that does a better job with qu <vladimir@cs.ualberta.ca>
back quote problem <Tony.Arnold@mcc.ac.uk>
Re: Can't find *** in @INC ....Help Please (Shelle)
Re: Crypt routine (brian d foy)
Re: Delete specific element from list <chewie@dtai.com>
Help: Opening a pipe to a non-ending process. <hankster@magmacom.com>
Help: Reading in from a pipe <hankster@magmacom.com>
interprets as shell instead of perl (AtaruM76)
Re: Linux,glibc-2,perl-5.004_1: make test fails <aj@arthur.rhein-neckar.de>
Re: Llama question <bmelson@phx.mcd.mot.com>
Re: Llama question (Andrew M. Langmead)
Re: MS SQL database connector for HTML??? (Mont Erickson)
Networking: does Perl know ICMP? (Grant Miller)
Novell IntranetWare PERL Set-up <breetai@westol.com>
Ordinary user id <davidc@wrs.com>
Re: Perl 5 regexps as independant package? (Kyzer)
Re: Perl 5.004 make test failed on Solaris 2.4 (socket (Quentin Fennessy)
Re: print "Hi", last ... (Craig Berry)
Problems running the embed example (interp.c) with Dyna (Dragomir R. Radev)
Re: Returning string with the XSUB mechanism <dada@divinf.it>
Re: scalar vs array (Charles DeRykus)
Re: Script to verify email addresses? (Terje Bless)
Re: Testing for the non-existence of a variable. <clark@s3i.com>
Re: Threads in perl ? (Budi Rahardjo)
Threads in perl (Budi Rahardjo)
Trouble Accessing ODBC Database <jjwansch@ingr.com>
Re: uc function for PERL4 <dbenhur@egames.com>
Verifying the modules version number <rst@Eng.sun.com>
Which DBM package provides file locking? and how to do (Yuan-fang Wang)
Why is system() failing when used as CGI? (Wade Williams)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 20 Jun 1997 15:34:00 -0500
From: Johnny <jpoon@iastate.edu>
Subject: ***How to get info from the HTML files in other server??***
Message-Id: <33AAE938.41C6@iastate.edu>
Hi,
Is there any ways to get information from a HTML files located in
other server (different from the one you are on)?? I want to be able to
grep info from HTML files in other server and use it in my own HTML
file. If you have any clue, please help me out.
The language used doesn't really matter, as long as it can achieve the
task.
Please also cc: to jpoon@iastate.edu
Thanks in advance.
------------------------------
Date: 19 Jun 1997 14:48:36 -0600
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
To: Shimpei Yamashita <shimpei@socrates.caltech.edu>
Subject: Re: a perl mode in emacs that does a better job with quotes?
Message-Id: <om67vaiajg.fsf@tees.cs.ualberta.ca>
In article <5o731j$n9@gap.cco.caltech.edu> Shimpei Yamashita <shimpei@socrates.caltech.edu> writes:
> s/'/'"'"'/g;
A workaround:
s/'/'"'"'/g; # ' pacify font-lock
------------------------------
Date: 20 Jun 1997 16:05:28 GMT
From: "Tony Arnold" <Tony.Arnold@mcc.ac.uk>
Subject: back quote problem
Message-Id: <01bc7d93$c27f04e0$96c95882@aca.mcc.ac.uk>
I am running Perl 5.001 on a Windows 95 system both in the office and on my
home machine and they behave differently! So far as I can I'm running the
same version of everything, but one machine is a Pentium 166MMX and the
other is a Cirix 586 33Mhz 4x system.
The following perl script shows up the problem:
$cd = `cd`;
print "CD = $cd\n";
On the Cirix system it does just what you would expect. On the 166 system,
the cd command gets executed but its output goes to the screen and the $cd
variable gets assigned an empty string.
Any ideas anyone?
--
-------------------------------------------------------------------------
Tony Arnold,
Head of Science & Engineering Support Unit, University of Manchester.
E-mail: Tony.Arnold@mcc.ac.uk Tel: +44 (161) 275 6093
URL: http://www.man.ac.uk/Tony.Arnold Fax: +44 (161) 275 6040
-------------------------------------------------------------------------
------------------------------
Date: Fri, 20 Jun 1997 19:58:40 GMT
From: shelle@interaccess.com (Shelle)
Subject: Re: Can't find *** in @INC ....Help Please
Message-Id: <5oendg$210_002@interaccess.interaccess.com>
deckers@man.ac.uk wrote:
> Shelle <shelle@interaccess.com> wrote:
>>Having been through all of the manuals, FAQs, and online documents regarding
>>Perl on Windows95, I have yet to find a suitable answer for why I get errors
>>such as:
>
>> Can't locate XXXXX/XXXX.pm in @INC at filename.pl line ##.
>In order to get around this problem you should "use lib 'XXXXX';" at
>the top of your script. Looks like you need to do some more RTFMing
>about "use lib" and @INC.
Well, I think the stores will soon be out of TFMs if I don't lay off. Anyhow,
despite finding a work-around I still wasn't satisfied (Jerri-rigging your
muffler to stay on is one thing...Perl isn't supposed to be like that I
thought.).
After many hours, lots of coffee, and rereading everyone's advice, I now have
it working the way it is supposed to. The problem apprearently was caused by
the direction of "\"s in the registry's PRIVLIB entries. They were all dos
standard "\" when they needed to be UNIXified as "/" instead.
NOW I am happy!
Michelle ----,-'-(@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Michelle Feigen ----,-'-(@ shelle@interaccess.com
MEAN PEOPLE SUCK!
http://homepage.interaccess.com/~shelle/
http://homepage.interaccess.com/~shelle/grafx/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Fri, 20 Jun 1997 15:12:45 -0500
From: brian@sri.net (brian d foy)
Subject: Re: Crypt routine
Message-Id: <brian-ya02408000R2006971512450001@news.walrus.com>
In article <5oe3du$srs@dilbert.tdg.mtu.edu>, swlaemmr@mtu.edu (Shawn
Laemmrich) wrote:
> Does anyone have a routine that will take an encrypted field (encrypted
> with crypt), strip out the salt characters, and encrypt a clear text
> password using them?
>
>
> Basically what I want to do is to be able to take a password out of the
> password file, and a clear text password, and see if they match.
crypt() will do that for you. you can use the encrypted password as
the salt since only the first two characters will be used by the
function.
PERLFUNC(1) Perl Programmers Reference Guide PERLFUNC(1)
crypt PLAINTEXT,SALT
Encrypts a string exactly like the crypt(3) function
in the C library (assuming that you actually have a
version there that has not been extirpated as a
potential munition). This can prove useful for
checking the password file for lousy passwords,
amongst other things. Only the guys wearing white
hats should do this.
Here's an example that makes sure that whoever runs
this program knows their own password:
$pwd = (getpwuid($<))[1];
$salt = substr($pwd, 0, 2);
system "stty -echo";
print "Password: ";
chop($word = <STDIN>);
print "\n";
system "stty echo";
if (crypt($word, $salt) ne $pwd) {
die "Sorry...\n";
} else {
print "ok\n";
}
Of course, typing in your own password to whoever
asks you for it is unwise.
--
brian d foy brian@sri.net
Smith Renaud, Inc.
------------------------------
Date: Fri, 20 Jun 1997 09:47:31 -0700
From: Rich Yumul <chewie@dtai.com>
To: Chris Mason <cmason@ros.res.cmu.edu>
Subject: Re: Delete specific element from list
Message-Id: <33AAB423.3D3D444C@dtai.com>
This is a multi-part message in MIME format.
--------------B44CB601AEDF4AA8001B6C11
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Your problem may lie in how you pass the array to your subroutine. I've
found that when you pass variables to a subroutine, it merges variables
into the @_ array. So when the subroutine sees that it's supposed to
get an array, it doesn't know how many elements are in the array so it
just grabs all the variables you pass to it. If you're just passing one
array, putting it at the end of your parameter list works.
For example,
instead of
---------------------
&listdel(@arr, $del);
.
.
.
sub listdel {
local (@arr,$del) = @_;
.
.
.
}
---------------------
change it around to:
---------------------
&listdel($del, @arr);
.
.
.
sub listdel {
local ($del, @arr) = @_;
.
.
.
}
---------------------
That way, your subroutine knows that the first element in the @_ array
goes into $del and the rest of the elements in @_ goes into @arr.
Alternatively, you could also pass the array by reference using the *
operator.
For example:
---------------------
&listdel (*arr, $del);
.
.
.
sub listdel {
local (*arr, $del) = @_;
.
.
.
}
---------------------
and I that should work as well.
Hope this works out for you.
Rich Yumul
--
|------------------------------------------------------------------|
| Richard M. Yumul | ///// ////// // //// |
| DTAI, Incorporated Java C++ | // // // / // // |
| 3900 Harney Street Windows 95 | // // // ////// // |
| Suite 210 CGI PERL HTML | ///// // // // //// |
| San Diego, CA 92110 Graphics | I N C O R P O R A T E D |
| (619) 542-1700 Unix DBMS | http://www.dtai.com/ |
| (FAX) 542-8675 | mailto:chewie@dtai.com |
|------------------------------------------------------------------|
--------------B44CB601AEDF4AA8001B6C11
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Richard Yumul
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Richard Yumul
n: Yumul;Richard
org: DTAI, Incorporated
adr: 3900 Harney Street;;Suite 210;San Diego;CA;92110;USA
email;internet: chewie@dtai.com
title: Web Master
tel;work: (619)542-1700
tel;fax: (619)542-8675
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
end: vcard
--------------B44CB601AEDF4AA8001B6C11--
------------------------------
Date: Fri, 20 Jun 1997 14:48:08 -0400
From: hankster <hankster@magmacom.com>
Subject: Help: Opening a pipe to a non-ending process.
Message-Id: <33AAD068.2EF7@magmacom.com>
Hi,
Earlier I posted a message asking why I was unable to read the output
from an open process using a pipe. I found out that the reason why is
because the process I opened never finishes (It's supposed to be like
that) and the parent blocks until the child finishes, therefor the
parent never gets to continue running.
I'm wondering now, how do I open that process for reading without
hanging my parent process up while it waits for the child to compleate.
------------------------------
Date: Fri, 20 Jun 1997 13:52:56 -0400
From: hankster <hankster@magmacom.com>
Subject: Help: Reading in from a pipe
Message-Id: <33AAC378.5709@magmacom.com>
Hi,
I'm trying to open a process using a pipe and reading in the output from
the process. When I run the process from the command line, the output is
fine, however when I try to run it from within a perl script I am unable
to read any output from the process.
Here is an example of what I'm trying to do.
open(PROC,"pipe.pl |");
while($input = <PROC>)
{
print $input;
}
Any ideas?
------------------------------
Date: 20 Jun 1997 20:53:23 GMT
From: atarum76@aol.com (AtaruM76)
Subject: interprets as shell instead of perl
Message-Id: <19970620205300.QAA13522@ladder01.news.aol.com>
I am having a problem, I have the following test cgi:
#!/usr/bin/perl
print "this is a test"
exit (0);
and what is happening is that the os keeps trying to interpret it as a
shell script, and doesn't call perl!
That is the correct location of the perl program, I can't figure this out.
Something must have broken when I wasn't looking.
I am using redhat linux 3.0.3, and perl 5.
Maybe this is a unix administration problem, but if someone knows, what
is going on, please let me know. I do have root access, but I did not
originally set this up.
thanks
Chris Buchholz
chrisb@issoln.com
------------------------------
Date: 20 Jun 1997 15:23:59 +0200
From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
Subject: Re: Linux,glibc-2,perl-5.004_1: make test fails
Message-Id: <u8205xbe6o.fsf@arthur.rhein-neckar.de>
>>>>> Andreas Steffan writes:
AS> In article <u8hgevk8ks.fsf@arthur.rhein-neckar.de>,
AS> Andreas Jaeger <aj@arthur.rhein-neckar.de> writes:
>> At least one did it. :-).
>> > PS: Linux-2.0.29,glibc-2.0.3,perl-5.004_1,gcc-2.7.2.2-glibc
>> Please send the output of ldd /usr/bin/perl (or wherever perl lives on
>> your system) and of perl -V. perl should compile without problems with
>> glibc, there's nothing unusual in your configuration.
AS> deas@mortimer:/home/deas/src/perl5.004_01> ldd perl
AS> libnsl.so.1 => /lib/libnsl.so.1 (0x40003000)
AS> libdb.so.2 => /usr/lib/libdb.so.2 (0x40008000)
AS> libdl.so.1 => /lib/libdl.so.1 (0x40018000)
AS> libm.so.6 => /lib/libm.so.6 (0x4001b000)
AS> libc.so.6 => /lib/libc.so.6 (0x40034000)
AS> /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
AS> libcrypt.so.1 => /lib/libcrypt.so.1 (0x400d2000)
AS> deas@mortimer:/home/deas/src/perl5.004_01> ./perl -V
You've linked against libdl.so.1 but should have linked against
libdl.so.2 which is part of glibc. Just change the link for libdl.so
to libdl.so.2.
AS> PS: Please also reply via email.
More details are on their way.
Andreas
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@alma.student.uni-kl.de
http://www.student.uni-kl.de/~ajaeger/
------------------------------
Date: Fri, 20 Jun 1997 11:33:37 -0700
From: Bob Melson <bmelson@phx.mcd.mot.com>
Subject: Re: Llama question
Message-Id: <33AACD01.167E@phx.mcd.mot.com>
Dan Harper wrote:
>
> In article <5obtng$de0@panix2.panix.com>, glm@panix.com says...
>
> <snip>
>
> >The script is as follows. (from page 199)
> >
> >#!/usr/local/bin/perl5
> >print "Enter the list of strings:\n";
> >@list = <STDIN>;
> >@reverselist = reverse(@list);
> >print @reverselist;
> >
> >The problem in this example is in the input of information. There
> >is no end to the list desired.
>
> When I ran this script on a UNIX machine it worked fine with
> ^d to indicate eof. On my NT4.0 machine I couldn't figure out
> what it expected for eof. ^d certainly didn't work. The
> port of Perl I'm using on the NT box is based on Perl 4.036
> and was done by someone at Intergraph a couple of years ago.
>
> <snip>
>
> Dan Harper
FWIW, if you're running on NT it's likely that EOF == ^Z, given its
Microsoft heritage.
--
----------------------------------------------------------------------------
Bob Melson The right to be heard does not include
Motorola Computer Group the right to be taken seriously
2900 S. Diablo Way, Tempe, AZ Hubert Humphrey
----------------------------------------------------------------------------
------------------------------
Date: Fri, 20 Jun 1997 15:49:34 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Llama question
Message-Id: <EC2zyM.1B9@world.std.com>
dwharper@ingr.com (Dan Harper) writes:
>When I ran this script on a UNIX machine it worked fine with
>^d to indicate eof. On my NT4.0 machine I couldn't figure out
>what it expected for eof. ^d certainly didn't work. The
>port of Perl I'm using on the NT box is based on Perl 4.036
>and was done by someone at Intergraph a couple of years ago.
In all likelihood, the C library that your perl was compiled with uses
Control Z to indicate end of file. (As opposed to the unix box, where
the end of file convention is determined by the teminal driver.)
--
Andrew Langmead
------------------------------
Date: Fri, 20 Jun 1997 07:09:57 GMT
From: merick@xmission.com (Mont Erickson)
Subject: Re: MS SQL database connector for HTML???
Message-Id: <5od6on$j3g$1@news.xmission.com>
This sounds quite interesting. What song and dance might one do in
order to obtain this holy grail (the work done by yourself)?
Being as all one is really doing is exchanging messages between the
ODBC server and some sort of a client, using SQL, it seems like if you
were able to open a socket/client connection to the ODBC server this
should be relatively possible regardless of the platform etc... No?
Anyway, this whole subject has facinated and befuddled me for quite
some time now. Doesn't the "O" in ODBC stand for open? Why is it
that the door to Microsoft SQL (which utilizes ODBC) has remained so
closed? Maybe that's partially intentional. I don't know.
Anyway, this topic seems like a common enough subject that I'm
surprised that further inroads haven't been made.
Anyway, I'm rambling. Thanks for your message. Any furthing info you
would be willing to provide would be happily appreciated. Thanks!
"Dave Roth" <rothd@roth.netX> wrote:
>The Win32::ODBC is premised upon the ODBC standard but even though MS has
>championed this standard it is not proprietary. There exists many ODBC
>managers and drivers written by third party organizations. The IODBC ODBC
>Manager itself is (I believe freeware). I have it on my Linux box and it
>works fairly well.
>I hope to one day (pending on free time) migrate the perl ODBC extension to
>the Unix world. Time will tell.
>You could setup a socket based server process which accepts incoming ODBC
>requests, processes them and returns them to the client. I had written some
>proof-of-concept code that did this and worked. I know of at least one
>other who modified this code and has a version of it giving DBM access to a
>Sun box (using an NT box as the ODBC Server) for the purpose of dynamic
>html pages.
>dave
------------------------------
Date: 20 Jun 1997 18:43:15 GMT
From: grant@statler.cc.wwu.edu (Grant Miller)
Subject: Networking: does Perl know ICMP?
Message-Id: <5oej03$5p8$1@ra.cc.wwu.edu>
Hello,
I am looking to write a ping client in Perl that does ping over ICMP
(Internet Control Message Protocol) and I am having problems getting it
to work. The first question I have is: Does perl support the ICMP protocol?
I have used the pingecho() function in the Net::Ping library and that
ping uses TCP and it doesn't report back properly for Windows boxes.
That's why I'm trying to write a ping client by hand to work over ICMP.
Here's what I have:
---------------------------------------------
#!/usr/bin/perl
use Socket;
$proto = getprotobyname('ICMP');
print "first: $!\n";
socket(SocketHandle, AF_INET, SOCK_RAW, $proto);
print "second: $!\n";
$iaddr = gethostbyname('www.perl.com');
print "third: $!\n";
$port = getservbyname('echo','icmp');
print "fourth: $!\n";
$sin = sockaddr_in($port, $iaddr);
print "fifth: $!\n";
send(SocketHandle, 0, 0);
---------------
Here is the output that I get when I run it:
first: Connection refused
second: Operation not permitted
third:
fourth: Connection refused
fifth: Connection refused
I have a "hack" to get something working:
$ping = `ping -c 1 $ipaddress`;
If anyone can point me in the right direction to get the above script
working if it is at all possibile.
Thanks in advance,
-- Grant Miller grant@cc.wwu.edu http://www.wcug.wwu.edu/~grant/
-- Western Washington University Bellingham, Washington USA
------------------------------
Date: Fri, 20 Jun 1997 15:43:03 -0400
From: Mark Kintigh <breetai@westol.com>
Subject: Novell IntranetWare PERL Set-up
Message-Id: <33AADD47.4376@westol.com>
HELP!!!!!!
I'm presently attempting to set up an IntranetWare server and cannot get
the PERL5 module to be accessed. If anyone has accomplished this feet
could you please email me how you did it at mailto://breetai@westol.com
Thanks.
--
____
| __|| "We met the enemy and they weren't us, then we went in front of
|| || a panel of 'us' and found the enemy."
\\//
\/ breetai@westol.com http://www.westol.com/~breetai
------------------------------
Date: Fri, 20 Jun 1997 13:40:41 -0700
From: David Cross <davidc@wrs.com>
Subject: Ordinary user id
Message-Id: <33AAEAC9.1CF7@wrs.com>
Folks,
Apologies for cross-posting a cgi question, but here is the situation:
I need a cgi script to handle check-out, un-checkout, and check-in of
documents (not code) to the ClearCase revision control system. The
machine with our web server (or maybe a CC default?) won't permit CC
processes to run for user "nobody." I need those scripts to run as _ME_
and not as "nobody". No wide open barn doors, no root passwords. What is
the best way to give a Perl cgi script the id and group id of an
ordinary user?? I hope it isn't a C wrapper, but any advice is welcome.
Thanks,
David Cross
davidc@wrs.com
------------------------------
Date: 20 Jun 1997 17:33:21 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: Re: Perl 5 regexps as independant package?
Message-Id: <5oeet1$kq7@info.abdn.ac.uk>
Eli the Bearded, while sobering up, wrote:
: ------
: got fed up with procmail's limitations
...like it only works on a computer :)
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
Britcode(v1.1): Brit(S) H+++: U+++: a18 s+:- hf++>+++ b+ m+ x? X---:+
P-- S+++ M++ R-- A C-- T--- TV+ Ci MuI+ MuR++ MuJ--- Am+++ Ac+ B+ V---
------------------------------
Date: 20 Jun 1997 18:35:05 GMT
From: quentin@remington.amd.com (Quentin Fennessy)
Subject: Re: Perl 5.004 make test failed on Solaris 2.4 (socket & udp)
Message-Id: <5oeigp$o8p$1@amdint2.amd.com>
In article <5ocmpl$1dr@netline.jpl.nasa.gov>,
John Rector <jar@next3.jpl.nasa.gov> wrote:
>Perl 5.004 make test failed on Solaris 2.4 in the following two cases:
>
>lib/io_sock.......No such file or directory at ./lib/io_sock.t line 29.
>FAILED on test 1
>
>lib/io_udp........Can't call method "sockname" without a package or object
>reference at ./lib/io_udp.t line 35.
I suggest you check to make sure the link /dev/tcp exists on your
system. On mine it looks like this:
/dev/tcp -> ../devices/pseudo/clone@0:tcp
There is a similar one for /dev/udp.
Perhaps the networking on your system is not totally configured.
--
Quentin Fennessy AMD, Austin Texas
------------------------------
Date: 20 Jun 1997 20:46:51 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: print "Hi", last ...
Message-Id: <5oeq7r$j04$1@marina.cinenet.net>
Peter Scott (pjscott-remove-to-email@euclid.jpl.nasa.gov) wrote:
: So I wanted to write something like
:
: warn "Syntax error\n", next if $foo;
:
: but even I knew that there would be problems since warn expects a
: list :-) I know that the way to handle this is do { warn; next; } if.
: However, what did happen with the above (5.003, SunOS 4.1.3) surprised me.
[Examples and discussion snipped]
I think you're making this far too hard. Warn wants a list? Give it
one! This code
warn("Syntax error\n"), next if $foo;
prints the warning message before next gets its turn at being processed,
because the explicit parens tell warn what constitutes its argument list.
Hope this helps...
---------------------------------------------------------------------
| 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: 20 Jun 1997 17:07:27 -0400
From: radev@news.cs.columbia.edu (Dragomir R. Radev)
Subject: Problems running the embed example (interp.c) with Dynamic loading on AIX
Message-Id: <5oeref$41m@age.cs.columbia.edu>
I have read the perlembed pages. I was able to run all the examples that
don't require dynamic loading of modules. When I tried running the examples
with dynamic loading, I only got core dumps.
I am on AIX (output of 'uname -a' and 'perl -V' is shown below). The perl
executable is compiled to allow dynamic loading and I have been able to run
all xstut examples (including the Mytest2 dynamic loading) without any
problems.
% perl -MExtUtils::Embed -e ldopts
-bE:perl.exp -L/usr/local/lib -L/usr/gnu/lib
/u/radev/perl/lib/aix/5.004/auto/DynaLoader/DynaLoader.a
-L/u/radev/perl/lib/aix/5.004/CORE -lperl -lgdbm -ldbm -lld -lm -lc -lbsd -lPW
% ./interp
use Socket;
segmentation fault (coredump)
Note also that the 'make test' for ExtUtils::Embed fails miserably with the
following error and many subsequent ones:
ld: 0706-004 Cannot find or read export file: perl.exp
ld:accessx(): A file or directory in the path name does not exist.
-----------------------------------------------------------------------------
% uname -a
AIX aix1 1 4
% perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
Platform:
osname=aix, osvers=4.1.4.0, archname=aix
uname='aix it 1 4 000002641000 '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio= d_sfio=
Compiler:
cc='cc', optimize='-O', gccversion=
cppflags='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/gnu/include'
ccflags ='-qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -I/usr/gnu/include'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=1, d_casti32=define, d_castneg=
intsize=4, alignbytes=8, usemymalloc=n, randbits=15
Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib -L/usr/gnu/lib'
libpth=/usr/local/lib /usr/gnu/lib /lib /usr/lib /usr/ccs/lib
libs=-lgdbm -ldbm -lld -lm -lc -lbsd -lPW
libc=/lib/libc.a, so=a
useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=, ccdlflags='-bE:perl.exp'
cccdlflags=' ', lddlflags='-H512 -T512 -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -b noentry -lc -L/usr/local/lib -L/usr/gnu/lib'
Characteristics of this binary (from libperl):
Built under aix
Compiled at Jun 18 1997 17:20:47
@INC:
/u/radev/perl/lib/aix/5.004
/u/radev/perl/lib
/u/radev/perl/lib/site_perl/aix
/u/radev/perl/lib/site_perl
.
--
Dragomir R. Radev Graduate Research Assistant
Natural Language Processing Group Columbia University CS Department
H: 212-749-9770 O: 212-939-7121 http://www.cs.columbia.edu/~radev
------------------------------
Date: Fri, 20 Jun 1997 20:41:16 +0200
From: Aldo Calpini <dada@divinf.it>
To: Joop Jansen <joop@polder.ubc.kun.nl>
Subject: Re: Returning string with the XSUB mechanism
Message-Id: <33AACECB.25178C8B@divinf.it>
Joop Jansen wrote:
>
> Hello,
>
> I am trying to extend Perl with some C-code. One of the functions
> needs to return a string of unpredictable length. The function should
> be used in my Perl script as:
>
> &API::getString($string);
Hi,
actually, I do it this way:
XS(XS_API_getString)
{
dXSARGS;
if (items != 1)
croak("Usage: API::getString(cp)");
{
char cp[10000];
getString(cp);
ST(0) = sv_2mortal(newSVpv(cp, 0));
}
XSRETURN_EMPTY;
}
It works for me, but I can't say how much "standard" it is... :-)
Otherwise, change your Perl call to:
$string = &API::getString();
and use this XS instead:
XS(XS_API_getString)
{
dXSARGS;
{
char cp[10000];
getString(cp);
XST_mPV(0, cp);
}
XSRETURN(1);
}
This one should be more correct.
HTH.
Bye,
Aldo Calpini
---/\-----------------------------------------------------------
--/ \--------------------------------- mailto:dada@divinf.it --
-<dada>-- POPULUS VULT DECIPI, -------- mailto:sis@divinf.it ---
--\ /------- ERGO DECIPIATUR --------- http://sis.divinf.it ---
---\/-----------------------------------------------------------
------------------------------
Date: Fri, 20 Jun 1997 19:25:32 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: scalar vs array
Message-Id: <EC39yL.Fr2@bcstec.ca.boeing.com>
In article <5oc7mj$alh@mailgate.lexis-nexis.com>,
Pete Williams <petew@lexis-nexis.com> wrote:
>[posted & emailed]
>In article <5oahg9$6d0$1@u30039.rsv.svskt.se>,
>Mats Larsson <matlar@rsv.se> wrote:
[ omitted for brevity ]
>while ($file = shift @_) {
>-or-
>while ($file = shift) {
>
I've seen "defined" recommended for the moderately paranoid :)
while ( defined($file = shift @_) )
Otherwise:
@_ = qw/0 file1 file2/;
print "$file\n" while ($file = shift @_); # prints nothing
Cheers,
--
Charles DeRykus
ced@carios2.ca.boeing.com
------------------------------
Date: Fri, 20 Jun 1997 19:54:35 +0200
From: link@tss.no (Terje Bless)
Subject: Re: Script to verify email addresses?
Message-Id: <5oeg4k$mt3$2@news.uit.no>
In article <5odbv5$lsr$1@neptune.uniserve.com>,
Vlad Petersen <"nobody"@[127.0.0.2]> wrote:
>Then next night I had a nightmare: I was a pilot cool-bloodedly dropping a
>bomb on Microsoft building in Redmond and then chasing Bill Gates
>on the streets with a machine gun. On the gun handle was written:
>"Pow(d)ered by Unix" and each bullet had a stamp: "Designed for MS
>Windows".
Well, so far this sounds like a wet dream to me.....
>I don't remember if I got Gates or not though..
.... Aaaah, so *that's* where the "nightmare" part came into the picture. :-)
--
Party? Party, lord? Yes, lord. Right away, lord.
- Beopunk Cyberwulf
------------------------------
Date: 20 Jun 1997 15:12:49 -0400
From: Clark Dorman <clark@s3i.com>
Subject: Re: Testing for the non-existence of a variable.
Message-Id: <diuz9ay1a.fsf@s3i.com>
FIGHT-SPAMjkugler@inreach.com (Joshua J. Kugler) writes:
[snip]
> I know you can test for the existence of a variable by using:
>
> if ($var) {#code here}
Not a good idea. Try defined().
> But how can you test to see if $var is NOT defined?
^^^^^^^
Oh, you were _sooo_ close.
> I have tried
>
> if not ($var), ifnot ($var), if !($var), and some I don't even
> remember.
>
> I know it is probably simple, but I have looked everywhere I know in
> the perldocs, and can't find anything to this effect.
Have you searched on defined ? :-)
Save the following and run it. The first one is easy, use the man/pod pages
for the rest:
----------------------------------------------------------------------
#!/home/dorman/bin/perl -w
#----------------------------------------
# A simple variable
print " A simple variable:\t\t\t\t";
if (!defined($notset)) {
print " notset is not defined \n";
}
else {
print " yes notset is defined ($notset)\n";
}
#----------------------------------------
# An array with nothing in it
@blankarray = ();
print " An empty array:\t\t\t\t";
if (!defined(@blankarray)) {
print " blankarray is not defined \n";
}
else {
print " yes blankarray defined (@blankarray)\n";
}
#----------------------------------------
# Push nothing (note: nothing, _not_ an empty string) onto the array
push( @blankarray, ); # Not a typo, really push nothing
print " An empty array with nothing pushed on it:\t";
if (!defined(@blankarray)) {
print " blankarray is still not defined \n";
}
else {
print " yes blankarray is now defined (@blankarray)\n";
}
#----------------------------------------
# Push '' onto the array
push( @blankarray, '');
print " An empty array with '' pushed on it:\t\t";
if (!defined(@blankarray)) {
print " blankarray is still not defined \n";
}
else {
print " yes blankarray is now defined (@blankarray)\n";
}
#----------------------------------------
# Make it empty again.
@blankarray = ();
print " An array made empty again:\t\t\t";
if (!defined(@blankarray)) {
print " blankarray is not defined \n";
}
else {
print " yes blankarray is defined (@blankarray)\n";
}
#----------------------------------------
# Undefine the array
undef @blankarray;
print " An array that's been undefined:\t\t";
if (!defined(@blankarray)) {
print " blankarray is now not defined \n";
}
else {
print " yes blankarray is still defined (@blankarray)\n";
}
#----------------------------------------
# Pass our non-existent array to a sub
&does_it_exist( @blankarray);
sub does_it_exist {
my( @passed_array) = @_;
print " Testing existence of a passed array : \t\t";
if (!defined(@passed_array)) {
print " passed_array is not defined \n";
}
else {
print " yes passed_array is defined (@passed_array)\n";
}
}
__END__
------------------------------
Date: 19 Jun 1997 16:49:05 GMT
From: rahard@wine.ee.umanitoba.ca (Budi Rahardjo)
Subject: Re: Threads in perl ?
Message-Id: <5obnu1$2qn$2@canopus.cc.umanitoba.ca>
On 19 Jun 1997 03:00:07 GMT, Zenin <zenin@best.com> wrote:
> See fork(). No, it isn't threading but it's the best available
> right now. You can fake shared data using SysV shared memory,
> and even mask that more using a tied perl class.
If I can't use thread in perl, I am forced to use Java :-(
-- budi
--
Budi Rahardjo <rahard@ee.umanitoba.ca> Just Another Perl Hacker
VLSI,Computer Networks,Operating Systems,Programming Languages,
Formal Methods,NCs,WebTV,UNIX,System Design,Telecommunications.
------------------------------
Date: 19 Jun 1997 16:46:35 GMT
From: rahard@wine.ee.umanitoba.ca (Budi Rahardjo)
Subject: Threads in perl
Message-Id: <5obnpb$2qn$1@canopus.cc.umanitoba.ca>
I am planning to write a simple server (daemon) and want
to use threads to handle multiple connections.
Any pointers on threads in perl?
-- budi
--
Budi Rahardjo <rahard@ee.umanitoba.ca> Just Another Perl Hacker
------------------------------
Date: Fri, 20 Jun 1997 16:29:45 -0500
From: "John Wanschek" <jjwansch@ingr.com>
Subject: Trouble Accessing ODBC Database
Message-Id: <01bc7dc2$44692480$0dae8781@iesd.b30.ingr.com>
NT 4.0 with SP 1, VB 5.0, IIS 3.0, and Perl 5.0
I have a VB program that I am having problem kicking off from Perl. The
program will run from the command line while I pass it arguments to query
on a oracle database. But when I try and kick it off from a Perl program it
just hangs.
I substituted a simple debug program writing out a file and it runs fine
from the Perl program passing the same arguments. It just write them to a
file.
I added a debug statement at the top of this file writing out the same
arguments but again it does not get executed. The process hangs.
Has anyone run into this problem before.
Thanks
John Wanschek
Intergraph, Corp
Email: jjwansch@ingr.com
Phone: 205-730-3801
------------------------------
Date: Fri, 20 Jun 1997 12:44:07 -0700
From: Devin Ben-Hur <dbenhur@egames.com>
To: Bruno Pagis <pagib@aur.alcatel.com>
Subject: Re: uc function for PERL4
Message-Id: <33AADD87.7B1B@egames.com>
[mail&post]
Bruno Pagis wrote:
> I've written a uc (capitalize) function for PERL4.
> There is more than one way to do it. Anybody wloud have a better idea ?
> sub uc
[snip]
I'm pretty sure perl4 supported the \U \L meta-chars in
string interpolation, so:
sub uc { local ($str) = @_; return "\U$str"; }
should do the trick.
HTH
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
Warning: Dates in Calendar are closer than they appear.
------------------------------
Date: Fri, 20 Jun 1997 10:22:02 -0700
From: Rick Tan <rst@Eng.sun.com>
Subject: Verifying the modules version number
Message-Id: <33AABC3A.D5F@Eng.sun.com>
Hi,
How does one check the modules and their version number that are
included in Perl?
Thanks.
------------------------------
Date: 19 Jun 1997 10:19:04 -0700
From: yfwang@cs.ucsb.edu (Yuan-fang Wang)
Subject: Which DBM package provides file locking? and how to do it?
Message-Id: <5obpm8$sng@pinky.cs.ucsb.edu>
Folks:
Does any one know which DBM_File package (NDBM, ODBM, GDBM, etc.)
provides file locking/unlocking? Any hint on how to do it?
The camel book gives only one example for DB_File which our
site does not have. The particular mechanism (through ->fd method) does
not seem to work for other *DBM_File.
thanks in advance.
--yfwang@cs.ucsb.edu
------------------------------
Date: Fri, 20 Jun 1997 12:50:19 -0500
From: wwilliam@cisco.com (Wade Williams)
Subject: Why is system() failing when used as CGI?
Message-Id: <wwilliam-ya02408000R2006971250190001@news.cisco.com>
I've got a program that does the following:
$majordomo="/usr/local/mail/majordomo";
chdir("$majordomo");
system("make");
(I've also tried it without quotes)
If I run this program from the command line, it works like a charm. But if
I run it as a cgi script, it appears the make does not happen.
Anyone have any thoughts? The system is Solaris 2.5.1.
Wade
wwilliam@cisco.com
--
---------------------------------------------------------------------------
Wade Williams "Any escape might help to smooth the
Systems Engineer unattractive truth, but the suburbs
Cisco Systems, Inc. have no charms to soothe the restless
Brentwood, TN dreams of youth."
615-221-2918 - N. Peart
wwilliam@cisco.com
---------------------------------------------------------------------------
------------------------------
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 641
*************************************