[13323] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 733 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 7 18:07:26 1999

Date: Tue, 7 Sep 1999 15:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 7 Sep 1999     Volume: 9 Number: 733

Today's topics:
    Re: advise please with input buffering and flock proble (Larry Rosler)
    Re: Apache + Perl + Authorisation <gellyfish@gellyfish.com>
    Re: case for open lang on win32 (where's vbscript peopl nielsenjf@my-deja.com
    Re: Case insensitive SQL query <gellyfish@gellyfish.com>
    Re: cgi-lib.pl  ( writing to a file ) <gellyfish@gellyfish.com>
        Cookies & IE 5.0 fabaroa@my-deja.com
    Re: DBI static link <gellyfish@gellyfish.com>
    Re: File listing (Kai Henningsen)
    Re: File listing <tchrist@mox.perl.com>
    Re: How can two Perl programs exchange data directly? <theglauber@my-deja.com>
    Re: How to view code as text in working cgi script <gellyfish@gellyfish.com>
        Inserting data into a file <Laurent.Cordon@afp.com>
    Re: Job opportunities <ciber@vnet.net>
        LWP failure, Recursive inheritance in Socket.pm, Perl 5 <klambell@dial.pipex.com>
        mod_perl - script fails with no error message <robert@visionart.com>
        moving perl binary?? <salisbur@fsl.noaa.gov>
        newbie help: getpwnam <dwayne@log.on.ca>
    Re: newbie help: getpwnam <meowing@banet.net>
        Pattern Matching Question stuart.mcintosh@db.com
        perl -V <brian.sisk@trw.com>
    Re: Soor PERl Newbie Q (Larry Rosler)
        Sweep several txt files into 1 big txt file....... <hanz@chello.nl>
        URL->Text->URL <terryking@hot-shot.com>
    Re: using code written in C (anyone know about stemming <theglauber@my-deja.com>
    Re: Y2K bugs on the Internet (Chris Nandor)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 7 Sep 1999 13:42:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: advise please with input buffering and flock problem
Message-Id: <MPG.123f187d8c4ef475989f21@nntp.hpl.hp.com>

In article <936733493.24253.0.pluto.d4ee06f0@news.demon.nl> on Tue, 7 
Sep 1999 21:49:40 +0200, Peter van Tienderen <peter@tienderen.demon.nl> 
says...
> Thanks Larry,  the problem seems to persist . (I skipped a few lines too
> many in the previous message, the seek/truncate was there already - sorry..)

Then why not repost with a complete example that demonstrates the 
problem, so that others can examine it.

You think that 'open' for reading primes a buffer.  I don't think it 
does.  So I can't (yet) explain your problem.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: 7 Sep 1999 21:06:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Apache + Perl + Authorisation
Message-Id: <7r3uos$4lu$1@gellyfish.btinternet.com>

On Tue, 07 Sep 1999 18:50:21 GMT Tuxedo Loopy wrote:
> Hello all. I've got a query (it's not a major problem, but I'd sure
> appreciate some help.)	Here's the scoop:
> 
> I use Apache to serve a local website (until I get it working completely, I
> won't put it up)  and I've used it to protect a directory (foo) using the
> .htaccess file and user files. Now I have user details which are needed to be
> entered in the resource box otherwise you can't enter. Fine. No problem. What
> I'd like to do is keep an separate account for each user. I've been thinking
> about using the cgi-bin directory to store the account files, but I need to
> find out via a perl script who the current user is and maybe what the
> password is. Can anyone help or suggest a possible script? I still consider
> myself a rookie at this. ;-)
> 

This is discussed in the CGI FAQ :

   <http://www.webthing.com/tutorials/cgifaq.html>

You will find that you get a better quality of answer in the newsgroup
comp.infosystems.www.authoring.cgi

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Tue, 07 Sep 1999 19:59:40 GMT
From: nielsenjf@my-deja.com
Subject: Re: case for open lang on win32 (where's vbscript people?)
Message-Id: <7r3qr3$22e$1@nnrp1.deja.com>

To piss anyone off, no way. . .

Sure I may think vbscript is inferior. But, if you can show how it
is superior that's great. I made a table of what I think is important
in the microsoft world, and at first glance it looks like the open
languages have an advantage. Maybe I'm wrong, if I only ask the
open guys, it's obvious what response I'll get, which is not
the only one I want.

There are some excellent language comparisons out there
(recently a flame war over one comparing perl and python), but
none windows centric.

Tell me why you think vbscript programming is great, what advantages
it has over perl and python. If I'm missing something in the table,
let me know.

Thanks,

john



In article <7r3cjb$i4e$1@oak.prod.itd.earthlink.net>,
  "Jason W. Kohlhoff" <jwk6@earthlink.net> wrote:
> Well, Arved, it's your reality, and you can make believe what you
want.
> What I know has absolutely nothing to do with the what you think you
know.
>
> I just want you schmucks to put up or shut up for a change.
> The only reason he posted the message in
microsoft.public.scripting.wsh was
> to piss us off, so I'm just returning the favor.
>
> Arved Sandstrom <Arved_37@chebucto.ns.ca> wrote in message
> news:Arved_37-0709990651190001@dyip-11.chebucto.ns.ca...
> > In article <7r1lhb$fm6$1@ash.prod.itd.earthlink.net>, "Jason
Kohlhoff"
> > <jwk6@earthlink.net> wrote:
> >
> > > I have something to add...
> > >
> > > You Perl guys are all full of "open" shit...
> > >
> > > I doubt you could write a script for a Windows machine that could
not be
> > > done(possibly even better) with WSH and VBS, or JS.
> > >
> > > Jason Kohlhoff
> > >
> > No need to be so defensive, Jason. If the stuff you mention is all
they
> > taught during that short but expensive mail-order Windows
programming
> > course, be proud of what *you* learned.
> >
> > Arved
>
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: 7 Sep 1999 20:13:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Case insensitive SQL query
Message-Id: <7r3rlk$4ii$1@gellyfish.btinternet.com>

On Tue, 07 Sep 1999 15:11:19 GMT mrbog@my-deja.com wrote:
> 
>> Oh, you mean like ask a completely off-topic question?
> 
> Completely off topic quesiton!????????! You're going to tell me that
> asking how to do something in sql VIA PERL is "completely off topic"?!!!
> 

Except you didnt ask *anything* about Perl whatsoever - your question
was solely about SQL - the answer would have been the same if you had
been using Perl,C,COBOL,GWBASIC ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: 7 Sep 1999 21:20:14 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: cgi-lib.pl  ( writing to a file )
Message-Id: <7r3vie$4md$1@gellyfish.btinternet.com>

On Tue, 07 Sep 1999 10:47:19 -0500 Rogelio M. Ramos wrote:
> 
> #!/apps/gnu/bin/perl
> 
> #require("cgi-lib.pl");
> 
> 
> open( FILE,">./testfile") || die ("Can't open file: $! \n");
> print "Error: $!\n";
> print FILE "hello world";
> 
> but when uncommented  results are :
> Error: No such file or directory
> 
> 

It is the line after the open that is giving this error - and this
line is not necessary as if the open has failed it will have died
and would not get to that line. If no system call has failed then
the value of $! is no use to you.

I seem to recall that the reason that $! is  set to this value here
(when you uncomment the require), is because require tries to find
the file (in this case 'cgi-lib.pl') in all of the directories in @INC,
if it is not found in the first directory it looks in then $! is set
by the attempt to open it.

Thus 'cgi-lib.pl' is in itself doing nothing to files - it is the require
operator - but you are making a false assumption anyway.

Of course you should have been familiar with the perlvar entry :


       $!      If used in a numeric context, yields the current
               value of errno, with all the usual caveats.  (This
               means that you shouldn't depend on the value of $!
               to be anything in particular unless you've gotten
               a specific error return indicating a system
               error.)  If used in a string context, yields the
               corresponding system error string.  You can assign
               to $! to set errno if, for instance, you want "$!"
               to return the string for error n, or you want to
               set the exit value for the die() operator.
               (Mnemonic: What just went bang?)

Anyhow I would recommend that you use the module CGI.pm rather than
cgi-lib.pl in all modern Perl code.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Tue, 07 Sep 1999 20:59:45 GMT
From: fabaroa@my-deja.com
Subject: Cookies & IE 5.0
Message-Id: <7r3ubp$4so$1@nnrp1.deja.com>

I have used this code for a few years and it has
worked fine. But Internet Explorer 5.0 doesn't
seem to record this cookie. Anyone know why and
what I do?

$expDate = "Wed, 09-Nov-1999 00:00:00 GMT";
$domain = "";
$path = "";
$PanelID=$FamilyID;
&setCookie("DRIRD9909", $PanelID,  $expDate,
$path, $domain);

#- Set Cookie ------------------------------------
-----------------------------#
sub setCookie {
	# end a set-cookie header with the word
secure and the cookie will only
	# be sent through secure connections
	local($name, $value, $expiration, $path,
$domain) = @_;

	print "Set-Cookie: ";
	print ($name, "=", $value, "; expires=",
$expiration,
		"; path=", $path, "; domain=",
$domain, "\n");
}
#-------------------------------------------------
-----------------------------#

#- Retrieve Cookies From ENV ---------------------
-----------------------------#

sub getCookies {
	# cookies are seperated by a semicolon
and a space, this will split
	# them and return a hash of cookies
	local(@rawCookies) = split (/; /,$ENV
{'HTTP_COOKIE'});
	local(%cookies);
	foreach(@rawCookies){
		($key, $val) = split (/=/,$_);
	    	$cookies{$key} = $val;	}
	return %cookies;
}


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: 7 Sep 1999 22:14:58 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DBI static link
Message-Id: <7r42p2$4ua$1@gellyfish.btinternet.com>

On Mon, 06 Sep 1999 00:09:20 -0700 Jeff Cohen wrote:
> How do i create a static link in the DBI.pm to perl on linux?
> 

You shouldnt need to on Linux - in fact you dont want to because
every new DBD you want to install will need to be statically linked
too.

You will need to build your Perl statically in the first place - I think
that you need to place the module that you want to statically link in
the ext directory in the ditribution directory and then add this
when  Configure asks you for which extensions you want statically linked -
If you look at the code for Configure you will see what you have to do.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: 07 Sep 1999 23:06:00 +0200
From: kaih=7OOX76PXw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: File listing
Message-Id: <7OOX76PXw-B@khms.westfalen.de>

tchrist@mox.perl.com (Tom Christiansen)  wrote on 06.09.99 in <37d45337@cs.colorado.edu>:

>      [courtesy cc of this posting mailed to cited author]
>
> In comp.lang.perl.misc,
>     kaih=7ORAOjimw-B@khms.westfalen.de (Kai Henningsen) writes:
> :Still like glob?
>
> Absolutely.  And if you don't like it, fix it.

*I* don't need a fixed glob(), I can just avoid it. I just demonstrated  
that that's pretty much trivial, no?

Anyway, depending on what exact semantic you want to have, there are  
functions on newer POSIX systems that implement it:

For just wildcard expansion, use the functions from <glob.h>.

For full sh-style word expansion (including ~ and $XXX and `...` and so on  
- well, you *can* block command substitution), use the functions from  
<wordexp.h>.

Hmm. Maybe I'll do a module. Might be interesting.

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


------------------------------

Date: 7 Sep 1999 15:54:00 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: File listing
Message-Id: <37d58978@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    kaih=7OOX76PXw-B@khms.westfalen.de (Kai Henningsen) writes:
:> :Still like glob?
:> Absolutely.  And if you don't like it, fix it.
:
:*I* don't need a fixed glob(), I can just avoid it. I just demonstrated  
:that that's pretty much trivial, no?

I do not believe telling people to use readdir() is a better approach
than fixing glob().  Certainly on my systems, globs works fine (in list
context; scalar context is not well understood by people), but then,
I don't run a Mac or whatnot.  Fortunately, this is taken care of in
the next release, where glob() will be a built-in that won't shell out,
and will be conformant to tcsh style globbing.   It may or may not use
the BSD glob() function as seen here:

    http://www.openbsd.org/cgi-bin/man.cgi?query=glob&sektion=3&apropos=0&manpath=OpenBSD+Current

--tom
-- 
    "This sentence no verve." --Larry Wall


------------------------------

Date: Tue, 07 Sep 1999 20:46:11 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: How can two Perl programs exchange data directly?
Message-Id: <7r3tif$45o$1@nnrp1.deja.com>

In article <01bef951$16e62000$75a551d4@unbekanb>,
  "Thorsten" <thorsten_kuske@gmx.net> wrote:
> Hello,
>
> I am a Perl newcomer and I tried hard to find out how to exchange data
> directly between two Perl programs running, but I did not get along
with
> this. So it would be really great if you could help me!


You didn't mention if you are running under Unix or another OS. If you
are in Unix, you are in luck. Run
    perldoc perlipc
to see some of what's available.


g


--
Glauber Ribeiro
theglauber@my-deja.com
"Opinions stated are my own and not representative of Experian"


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: 7 Sep 1999 22:00:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to view code as text in working cgi script
Message-Id: <7r41tk$4sd$1@gellyfish.btinternet.com>

On Tue, 07 Sep 1999 16:53:23 +0200 David Hiskiyahu wrote:
> If this is your script, you could make a soft link on the 
> server with a filename extension of '*.txt'.
> 
> Example:
> 
> script file:   		http://www.somewhere.com/scripts/script.cgi
> browsable source:	http://www.somewhere.com/scripts/script.txt
> 
> % cd /www/scripts
> % ls
> -rwxr-xr-x  ..... script.cgi
> lrwxr-xr-x  ..... script.txt
> 

Bzzt.  Next contestant please.

Please ask in comp.infosystems.www.servers.unix why .

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Tue, 07 Sep 1999 22:54:35 +0200
From: Laurent Cordon <Laurent.Cordon@afp.com>
Subject: Inserting data into a file
Message-Id: <37D57B8A.21C98773@afp.com>


--------------83C2BDFC0CB6870CA16979D0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I would like to insert data into my file as described below

the original file is

 .................
Antoine.Merlino:amerlino
Antoine_Merlino:amerlino
Alain.Beaufret:abeaufret
Alain_Beaufret:abeaufret
 .................

My new file should look like that

Antoine.Merlino:amerlino
Antoine_Merlino:amerlino
amerlino:amerlino@afp.com
Alain.Beaufret:abeaufret
Alain_Beaufret:abeaufret

My problem is how to insert     amerlino@afp.com at this position and
not at the top nor bottom of the file

Thanks for your help

--
*************************************************************
|Laurent Cordon     Tel +00 1 40417739                       |
|                   Fax +00 1 40417854                       |
|Adresse :          4, Rue de la Bourse 75002 PARIS FRANCE   |
|Email   :          Laurent.Cordon@afp.com                   |
|Web     :          http://www-ems.par.afp.com               |
*************************************************************



--------------83C2BDFC0CB6870CA16979D0
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I would like to insert data into my file as described below
<p>the original file is
<p>.................
<br>Antoine.Merlino:amerlino
<br>Antoine_Merlino:amerlino
<br>Alain.Beaufret:abeaufret
<br>Alain_Beaufret:abeaufret
<br>.................
<p>My new file should look like that
<p>Antoine.Merlino:amerlino
<br>Antoine_Merlino:amerlino
<br>amerlino:amerlino@afp.com
<br>Alain.Beaufret:abeaufret
<br>Alain_Beaufret:abeaufret
<p>My problem is how to insert&nbsp;&nbsp;&nbsp;&nbsp; amerlino@afp.com
at this position and not at the top nor bottom of the file
<p>Thanks for your help
<pre>--&nbsp;
*************************************************************
|Laurent Cordon&nbsp;&nbsp;&nbsp;&nbsp; Tel +00 1 40417739&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fax +00 1 40417854&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|Adresse :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4, Rue de la Bourse 75002 PARIS FRANCE&nbsp;&nbsp; |
|Email&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Laurent.Cordon@afp.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|Web&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www-ems.par.afp.com">http://www-ems.par.afp.com</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
*************************************************************</pre>
&nbsp;</html>

--------------83C2BDFC0CB6870CA16979D0--



------------------------------

Date: Tue, 7 Sep 1999 16:47:44 -0400
From: "Michelle Fowler" <ciber@vnet.net>
Subject: Re: Job opportunities
Message-Id: <c%eB3.260$CA5.224263@ralph.vnet.net>

Hello everyone...


Can I post Perl job openings here?


Thanks,

Michelle Fowler
800-490-9230
mfowler@ciber.com




------------------------------

Date: Tue, 07 Sep 1999 22:01:03 +0100
From: Keith Lambell <klambell@dial.pipex.com>
Subject: LWP failure, Recursive inheritance in Socket.pm, Perl 5.00404
Message-Id: <37D57D0F.23C77C06@dial.pipex.com>

Hello, 

I have recently noticed a problem including IO::Socket.pm in a module.
This seems to involve the dynamic loading of Socket.pm via a
"bootstrap".
Let me be the first to admit that I do not fully appreciate the inner
workings of Perl.  What I do know is that now, I have to include the
"require" line for IO::Socket.pm first else there is recursive
inheritance
detected. 

This may be new to Perl i586-linux/5.00404 ? as I have only just noticed
this
behaviour.

The error occurs at the line in Socket.pm where it has "bootstrap
Socket;"
At the same time that this socket error appeared, the LWP User Agent
seems to
be failing... 

any ideas?

Keith

Details:
-------
The simplest test case involves a main Perl script and two modules:

package RITEST_FIRST;
use strict;

require IO::Socket;

require Exporter;
@Exporter::ISA = qw(Exporter);
@Exporter::EXPORT=('&FirstRoutine');

sub FirstRoutine
	{
	my($val)=$_[0];
	return($val*2);
	}
	
1;

package RITEST_SECOND;
use strict;

require Exporter;
@Exporter::ISA = qw(Exporter);
@Exporter::EXPORT=('&SecondRoutine');

sub SecondRoutine
	{
	my($val)=$_[0];
	return($val+2);
	}
	
1;


#! /usr/local/bin/perl -w
#
# This way round OK:
require './ritest_first.pm';
require './ritest_second.pm';
# Val1 = 8
# Val2 = 7

# This way round:
# require './ritest_second.pm';
# require './ritest_first.pm';
# Produces:
# "Recursive inheritance detected at
/usr/lib/perl5/i586-linux/5.00404/Socket.pm line 279."
# "BEGIN failed--compilation aborted at
/usr/lib/perl5/i586-linux/5.00404/IO/Socket.pm line 118."

use strict;

my($val1, $val2);

$val1=&RITEST_FIRST::FirstRoutine(4);
print "Val1 = $val1\n";

$val2=&RITEST_SECOND::SecondRoutine(5);
print "Val2 = $val2\n";

exit(0);


------------------------------

Date: Tue, 7 Sep 1999 13:18:08 -0700
From: "J Robert Ray" <robert@visionart.com>
Subject: mod_perl - script fails with no error message
Message-Id: <7r3s4l$fiv$1@la-mail4.digilink.net>

At the end of a 24-hour code-a-thon, I was getting very sloppy and had
accidentally used "date()" instead of "time()" in a mod_perl script I'm
working on.

The unfortunate part was that when the script failed at run-time it wasn't
reporting an error to the error_log file.  I encountered this same silent
treatment when I made a typo in another function name.

I'm using the 'PerlWarn On' pragma in Apache, and have -w turned on and am
using "use strict;" in all my source files.

I figured out what was going wrong by narrowing down the location of the
error, using eval, and printing out $@.  "Undefined subroutine ...."

Is it normal for mod_perl to not report the error in this case?  I do get
other types perl run-time warnings in my error_log.

Thanks!

--
J Robert Ray
robert@visionart.com




------------------------------

Date: Tue, 07 Sep 1999 14:59:46 -0700
From: Dave Salisbury <salisbur@fsl.noaa.gov>
Subject: moving perl binary??
Message-Id: <37D58AD2.DB9E353D@fsl.noaa.gov>

This must have been discussed before, but I can't seem to
find any references.

I've built Perl in my home directory, and would like to
get the sys admins to install it under /usr/local.

It seems a straight copy of bin/* and lib/* will not work,
as I see my home directory in

strings perl | grep home/dir

What will need to be done to accomplish this the move?
Is there some info out on the net that discusses this?

Thanks for any info
Dave


------------------------------

Date: Tue, 07 Sep 1999 20:45:22 GMT
From: "LOG ON Tech" <dwayne@log.on.ca>
Subject: newbie help: getpwnam
Message-Id: <CPeB3.127$Dn2.420@198.235.216.4>

hi!

I am trying to use getpwnam to work on an RHLINUX 5.2 server.

I have had some success using:

#include <pwd.h>

($use,$pass,$uid,$gid,$info,$home,$shell)  = getpwnam(username);
print $use;
print $pass;
print $uid;
print $gid;
print $info;
print $home;
print $shell;

Except only the first 4 vars contain data.  $info on return null.
Of corse the info feild is the one I require for the job.

Thanks for any suggestions :)
Dwayne




------------------------------

Date: 07 Sep 1999 17:23:05 -0400
From: meow <meowing@banet.net>
Subject: Re: newbie help: getpwnam
Message-Id: <87btbeza9y.fsf@slip-32-100-244-230.ma.us.ibm.net>

LOG ON Tech <dwayne@log.on.ca> wrote:

> hi!
> I am trying to use getpwnam to work on an RHLINUX 5.2 server.

> I have had some success using:

> #include <pwd.h>

Um, why have you got a C include in a Perl program?!!

> ($use,$pass,$uid,$gid,$info,$home,$shell)  = getpwnam(username);

{some print statements}

> Except only the first 4 vars contain data.

Ah, that's why the C include.  You're using what looks like the C
struct for getpwnam() instead of the Perl one! `perldoc -f getpwnam'
for the correct field order.  If it mentions looking at the C man
page, that's just so you'll know what the fields mean.


------------------------------

Date: Tue, 07 Sep 1999 20:13:03 GMT
From: stuart.mcintosh@db.com
Subject: Pattern Matching Question
Message-Id: <7r3rk2$2ll$1@nnrp1.deja.com>

I'm trying to come up with something that will match all of the
following when they come up in the middle of a line of text (I use 'POS'
to set the search start position to the correct starting place first)

123.45678  P
  3.4567890P
 23.456789

I tried m/\S+\s*\S/g - according to the "programming perl" book the \s*
should match zero or more occurances of a whitespace character but I
found it was failing on the second example above...

-Stuart.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Tue, 7 Sep 1999 15:44:24 -0500
From: "Brian" <brian.sisk@trw.com>
Subject: perl -V
Message-Id: <7r3tf9$bu22@news1.dh.trw.com>

Is there documentation or can anyone decipher for me the heiroglyphics of
what the '-V' switch is saying? I understand some of it but some parts
totally baffle me. For example: does it tell me whether perl has been built
to use dynamic or static libraries? I see the section on dynamic linking but
I am not following...

Thanks for your help and patience,

Brian




------------------------------

Date: Tue, 7 Sep 1999 13:09:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Soor PERl Newbie Q
Message-Id: <MPG.123f10db610b634a989f20@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <37D50AF8.5D0679AB@megacult.de> on Tue, 07 Sep 1999 14:54:16 
+0200, David Hefendehl <pr-pool@megacult.de> says...
> I try to read from a .txt file values wich are speratet with :
> the file looks like this
> value1:value2:valu3
> value4:value5:value6
> ...
> Ok I know how to open the file and store the values in an aray
> open(FILE, ...
> What I now want to do is to give all values in the first row the
> Skalarname $1 in the second $2 in the third $3 to print
> Name1=value1 Name2=value2 Name3=value3 <br>
> Name1=value4 Name2=value5 Name=value5 <br>
> ...
> 
> Please help I'll tryed so many ways but it wont work. Somtimes I only
> get the first sometimes nothing...

Here's a tiny program that does what you say you want (correcting the 
apparent typos).  If instead you want the names to come from an array, 
figure out how to parallel-index the name and value arrays, or to 
reconstruct and shift the names array through the print loop.

#!/usr/bin/perl -w
use strict;

while (<DATA>) {
  chomp;
  my @values = split /:/;
  my $i = 0;
  print 'Name', ++$i, "=$_ "  for @values;
  print "<BR>\n";
}
__END__
value1:value2:value3
value4:value5:value6

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


------------------------------

Date: Tue, 7 Sep 1999 23:16:23 +0200
From: "HPK" <hanz@chello.nl>
Subject: Sweep several txt files into 1 big txt file.......
Message-Id: <pagB3.759$1b7.10594@amsnews.chello.com>

Hi!

I'm looking for a cgi script that reads several txt files, and sweeps them
into one big text file. I tried to program my own script, but it did not
work.... Anyone where I can get this simple, but effective script?

Thanks!

HPK




------------------------------

Date: Tue, 7 Sep 1999 22:28:01 +0100
From: "Terry King" <terryking@hot-shot.com>
Subject: URL->Text->URL
Message-Id: <7r404h$3po$1@nclient11-gui.server.virgin.net>

We've all seen URL to text routines but I haven't seen one that converts
special characters back into hex so that the cgi program can call itself.
Can anyone post the few lines of code needed or point me in the right
direction ?

Cheers,
Terry





------------------------------

Date: Tue, 07 Sep 1999 21:01:42 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: using code written in C (anyone know about stemming?)
Message-Id: <7r3ufe$4v6$1@nnrp1.deja.com>

In article <MPG.123efb4f3b88ba50989712@nntp1.ba.best.com>,
  moseley@best.com (Bill Moseley) wrote:
> Thanks everyone for your help.  Seems to have taken less than a day!

Congratulations, you are a Real Programmer now! :-) :-) :-) :-)



> Should I deal with these messages?  If so, how?

I'm not sure how to make them go away; they are probably an artifact of
the "make" program in your OS. They seem harmless; if not, someone else
will hopefully comment!

[...]
>
> using bool_t caused errors (below).  I used just 'int' and it worked
> fine.


I know why. Sorry i forgot to mention, add "-Dbool_t=char" to your
compile options, or "#define bool_t char" in the C or XS file. Using
int should be just as fine, so not to worry. I've been using bool_t
because it's used in some of the examples in the documentation.

[...]
--
Glauber Ribeiro
theglauber@my-deja.com
"Opinions stated are my own and not representative of Experian"


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


------------------------------

Date: Tue, 07 Sep 1999 20:18:00 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Y2K bugs on the Internet
Message-Id: <pudge-0709991617590001@192.168.0.77>

In article <7r313k$dcp$1@nnrp1.deja.com>, finsol@ts.co.nz wrote:

# So its not the incompetents, idiots or script-kiddies creating and/or
# reproducing these Y2K bugs as has been so often stated - unless you want
# to include some of the world's top brains in this category.

It is a blatant fallacy to say that because X came from Y and Y has some
of the world's top brains Z that Z had anything to do with X.

I know lots of people at lots of universities who publish crap because of
incompetence and ignorance.  And it seems obvious to me that if someone is
making a Y2K error like these than they are indeed ignorant, by
definition.  They may even be brilliant people, but certainly ignorant in
this area (or at least, were ignorant at the time of the coding).

Just for example, I took the most impressive-sounding name on your list:

  Item: 40. Division of Physiologic Imaging, Department of Radiology,
  University of Iowa College of Medicine (written by National Science
  Foundation)

  http://everest.radiology.uiowa.edu/cgi/stats

Then I went to look at it.  And I will note that it has many problems, and
is a poorly written piece of Perl code.  I don't care if the National
Science Foundation wrote it.  It stinks.

First, it is a CGI and does not do taint checking, it does not use strict,
and it does not ask check warnings.  The Big Three are neglected, meaning
that it is most likely a bad program.

Second, the style is sophomoric.  No lexical variables are used at all,
ugly variable names are chosen, and lots of extra work is done to do the
job.  No modules are used to cut down on the work needed to be done, paths
are hardcoded deep in the code instead of at the top, etc.  It semes the
person who wrote it didn't use any perl5-isms at all, which is not a
crime, but just shows the immaturity of the programmer.

And then, of course, the year is retrieved and placed after "19" in a string.

Sure, the name sounds impressive.  But a rose by any other name would
smell as sweet, and crap by any other name still makes me gag at the
stench.


# What my research sample shows is that anyone can make Y2K errors

I defy you to show me one example of a good programmer making a Y2K error
in Perl.  Oh, that's right, you don't know Perl, and you couldn't tell if
the programmer who wrote a program is good or not.


# Is it any surprise that there is such a lot of Y2K bugged code about
# when many prominent programmers do very little in informing their
# programming community on this subject and in some cases deny there is
# indeed any problem?

Lies, lies, lies.  You have been corrected on this point many times, yet
you still lie.  All of the primary Perl documentation addresses the Y2K
issue and localtime as appropriate, in the listing for localtime, and in
the Perl FAQ.  What more should we do?  If a programmer does not read the
docs, the programmer is careless and ignorant, and wishes to remain that
way.


# Despite frequent admonishments that programmers should 'read the
# manual', it is clear that Perl is often learnt by example.  The
# following Perl book review makes this point.

Irrelevant.  Don't read the docs, and you are stupid and deserve whatever
fate you get.  What is the purpose of the documentation, then?  To take up
space on the hard drive?


# http://www.cuug.ab.ca/CUUGer/9711/proglernperl.html
# Perl: A Review of the book "Programming Perl" (The O'Reilly 'Camel
# book')
# and a shorter one of "Learning Perl" (The 'Llama Book')
# and of the language in general
# by Roy Brander
# "Perl, while basically a computer language that mostly has a simple
# grammar and syntax, should be approached like a human language: learn it
# by example, adding one new trick or twist with every repetition.
# Learning Perl excels at this by embellishing a few example programs a
# little more every page with the new material just discussed. By the end
# of each chapter, you are proudly trying out impressively powerful
# programs with a dozen new features you've learned."

Learn by doing AFTER reading the docs.


# I do not have any grudge against Perl, in fact the language appears to
# be very intriguing and maybe one day I'll be developing in it.  What I
# do have a problem with is programmers who are so besotted with their
# language of choice, they refuse to use logic.

You, my dear, are an expert in refusing to use logic.

# Even when faced with
# hundreds of examples of Y2K bugs, they still see no particular problem
# that needs to be addressed.

How is the problem of an ignorant who refuses to read documentation a
problem of mine, or anyone else's who isn't working with said ignorant? 
People have the right to be stupid.  If they want to write without
reading, or let coworkers do the same, then why should I care?



# (a) Provide guidelines on what types of Y2K problems to look for in
# Perl, Java, C, C++, Javascript etc.

Answer: read the FAQ and documentation for Perl.


# (b) Write software to scan code for the more obvious errors and/or
# highlight where dates are manipulated in the code. To cover costs you
# could even (heaven forbid!) charge for the software

Answer: if you read the FAQ and documentation for Perl, you don't need
such a thing.  Regardless, such a thing is simple to write -- once you
have learned Perl and read the appropriate FAQ and documentation for Perl.


# (c) Acknowledge to readers in this forum that all mission critical code
# does need to be checked for Y2K problems, regardless of programming
# language.

Answer: All mission-critical code needs to be checked for all kinds of
bugs, and there is no need to single out the Y2K bug in particular.


-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


------------------------------

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 733
*************************************


home help back first fref pref prev next nref lref last post