[7341] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 966 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 3 10:27:11 1997

Date: Wed, 3 Sep 97 04:02:21 -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           Wed, 3 Sep 1997     Volume: 8 Number: 966

Today's topics:
     Re: ($p=$pc) =~ s/\.[0-9]*/substr($1,3,length($1))=""/g (Matti Kinnunen)
     Re: beginner's help <SPAMFREEcolmang@ms.com>
     Re: CGI.pm - redirect problem? <friedman@uci.edu>
     Re: errorlevel of a perl system call ? (Andrew M. Langmead)
     Re: FTP site mirroring software? (Dustin Mollo)
     Re: getuid and setuid <qdtcall@esb.ericsson.se>
     Handling complex table files <stefano.bonacina@st.com>
     Re: Handling complex table files (Daniel E. Macks)
     Re: HELP My flock does not work?!? <bosch@goweb.lu>
     Re: HELP My flock does not work?!? (Alberto BARSELLA)
     Re: Help with Perl hooks on INN 1.5.1, please <friedman@uci.edu>
     Help! cron&perl ! <tuononen@cc.helsinki.fi>
     Is a version for NT 4.0 of the swish search program ava <aberger@datanord.it>
     Re: Making a Swiss-Army Knife HTML tool in Perl <friedman@uci.edu>
     Re: mixing hexadecimal and strings <SPAMFREEcolmang@ms.com>
     Re: pattern matching HELP! <SPAMFREEcolmang@ms.com>
     Re: Perl (kind of) math question. <Patrick.Hayes.CAP_SESA@renault.fr>
     Perl <-> Tcl sockets <mark.andrew@fr.bosch.de>
     Re: perl and XEmacs <tom@mitra.phys.uit.no>
     Problem compiling perl5.004_01, ld: cannot open -ldb (Mick Ghazey)
     Re: Question: Returning false/zero to shell... <ghowland@hotlava.com>
     St. Anthony of Padua <stanthony@jumpnet.com>
     Re: Trivial(?) readdir question <SPAMFREEcolmang@ms.com>
     Re: Trivial(?) readdir question <Marc.Philips@tvd.be>
     Username & password verification? (Burt Lewis)
     Re: Username & password verification? (Eric Bohlman)
     Re: Username & password verification? <SPAMFREEcolmang@ms.com>
     Verifying a password?? (Burt Lewis)
     Re: Verifying a password?? (Jeremy D. Zawodny)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 03 Sep 1997 11:57:58 +0300
From: matti@universe.pc.helsinki.fi (Matti Kinnunen)
Subject: Re: ($p=$pc) =~ s/\.[0-9]*/substr($1,3,length($1))=""/g;
Message-Id: <lz7mcybwq1.fsf@universe.pc.helsinki.fi>


In article <34049AB3.132F@btc4.up.net> "Raymond K. Bush" <rbush@btc4.up.net> writes:
   sdfsd 32423.3245 erye5rye eryter 234.234311111666  12314.3543254322222
into 
   sdfsd 32423.32 erye5rye eryter 234.234 12314.35
   
---
what about 
	
's/(\.\d+)/substr($1,0,4)/ge'

-- 
* matti.kinnunen@helsinki.fi *
* http://universe.pc.helsinki.fi/~matti/contact.html *
* !!! +358-(0)40-593 50 91 but try first +358-(0)9-191 23978 *


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

Date: Wed, 03 Sep 1997 09:30:08 +0100
From: Gary Colman <SPAMFREEcolmang@ms.com>
To: frankel@cs.concordia.ca
Subject: Re: beginner's help
Message-Id: <340D2010.6400@ms.com>


Hi Andras

> I tried to use the hex function to convert hexadecimal to decimal.
> Since hex() doesn't recognize negatif number, I check for it and I 
> just delete it.
>         $answer= ~s/^-/""/;
You should have:  $answer=~s/^-//;

1. omit the ""
2. =~ is one operator.. It has no space character between
   the = and the ~

Cheers
  Gary
--

  Please remove SPAMFREE from my addy before replying.


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

Date: 3 Sep 1997 05:22:54 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: CGI.pm - redirect problem?
Message-Id: <5uis7e$ln1@news.service.uci.edu>


In article <5uh86k$d2l@nntp02.primenet.com>,
Martin Brown <mjbjr@primenet.com> wrote:
<
<For the life of me, I can't figure out what is going on.

You're confused about quoting.

<the following works:
<    $loc="http://127.0.0.1/success.html";
<    print $query->redirect($loc);

Double quotes are used to cause interpolation of variables in a
string.  You have no variables in this string, so you might
as well say $loc = 'http://127.0.0.1/success.html';

What you seem to be unaware of is the fact that the quotation marks
(single or double) are not part of the string; rather, they're used to
delimit it.  Thus, 

perl -e 'print "hello world\n" ' prints
hello world [newline]  

without quotes.

<but if I have a list of url's in a file, each with double '"'s around it
<with no lf, and open the file and get a url and assign it to $loc, the
<above doesn't work!

Because now your double quotes are part of the string.  Reading them
in from a file, you've accomplished this:

$loc = '"http://127.0.0.1/success.html"';

And, in point of fact, that is a success, though not the one you
had in mind. ;-)  Jokes aside, it does explain why you have
unwanted "" in $loc.  

HTH,
Eric

<Any ideas?
<
<Thanx.
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Tue, 2 Sep 1997 21:43:43 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: errorlevel of a perl system call ?
Message-Id: <EFwHov.tH@world.std.com>


weiner <kweiner@bloomberg.com> writes:

>is there a way to import back into perl dos errorlevel 
>after execution of some system command (other than creating a process
>and using GetExitCode method)

In the Windows port of perl, return value of system has the exit
status as the top eight bits. (In unix, see the wait(2) man page for
the data that system returns. The bottom 8 bits have more
significance.)

$ret = system("runme");
$errorlevel = $ret >> 8;
-- 
Andrew Langmead


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

Date: 3 Sep 1997 04:02:06 GMT
From: dustin@sonic.net (Dustin Mollo)
Subject: Re: FTP site mirroring software?
Message-Id: <5uinfu$eap$1@ultra.sonic.net>

Paul D. Smith (psmith@baynetworks.com) wrote:
: I'm looking for a simple bit of software to maintain a local mirror of
: the directory structure on my ISP FTP site... I just want something to
: download newer files on the FTP site to my local copy, and upload files
: I've modified locally to the FTP site.
: 
: A little perl script utilizing, say, Net::FTP would be cool! :)
: But, I'm open to other suggestions as well.
: 
: I couldn't find anything relevant-looking by searching CPAN for keywords
: like "copy", "mirror", and "ftp".
: 
: Seems like a perfectly useful little script; surely someone must have
: such a thing already?

Have a look at : http://www.perl.com/CPAN/scripts/ftpstuff/.  In there you
will find mirror 2.8.  A very handy little FTP mirror program.  It does not
use Net::FTP, but it still does the job.

-Dustin


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

Date: 03 Sep 1997 11:07:53 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: getuid and setuid
Message-Id: <islo1epxxy.fsf@godzilla.kiere.ericsson.se>


wtang@cs.ualberta.ca (Wei Tang) writes:

> and it seems that there are no functions named "getuid" or "setuid".

That is correct.

> If I want to call in a CGI script a Unix shell program which can only
> run under my own uid, what should I do?

You should read the perlvar manpage and look for $< and $>.

-- 
		    Calle Dybedahl, UNIX Sysadmin
      qdtcall@esb.ericsson.se  http://www.lysator.liu.se/~calle/


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

Date: Mon, 01 Sep 1997 16:26:36 +0200
From: stefano bonacina <stefano.bonacina@st.com>
Subject: Handling complex table files
Message-Id: <340AD09C.2569@st.com>

Hello all
I have a file with a similar structure:

name  label             type                          default unit
words {Number of words} {range int 64 32768}           64      {}
bits  {Number of bits}  {range int 2 64}               2       {}
mux   {Mux size}        {enum int {4 8 16 32}}         4       {}

Separators are blank space, not tab (too easy :-).
Does anyone know any clever way to handle these lines assigning to
different variables the content of each fields? (I'm using perl 5.004)
Thanks in advance for your help
-- 
Stefano Bonacina		E-mail:	stefano.bonacina@st.com
SGS-Thomson Microelectronics


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

Date: 3 Sep 1997 07:42:42 GMT
From: dmacks@sas.upenn.edu (Daniel E. Macks)
Subject: Re: Handling complex table files
Message-Id: <5uj4di$pvg$1@netnews.upenn.edu>


stefano bonacina (stefano.bonacina@st.com) said:
: 
: name  label             type                          default unit
: words {Number of words} {range int 64 32768}           64      {}
: bits  {Number of bits}  {range int 2 64}               2       {}
: mux   {Mux size}        {enum int {4 8 16 32}}         4       {}
: 
: Separators are blank space, not tab (too easy :-).
: Does anyone know any clever way to handle these lines assigning to
: different variables the content of each fields? (I'm using perl 5.004)
: Thanks in advance for your help

Is split() not working, or am I misunderstanding the question?
  % perldoc -f split
  As a special case, specifying a PATTERN of space (C<' '>) will split on
  white space

dan
-- 
Daniel Macks
dmacks@a.chem.upenn.edu
dmacks@netspace.org
http://www.netspace.org/~dmacks



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

Date: Wed, 03 Sep 1997 09:20:11 +0200
From: Bosch Patrick <bosch@goweb.lu>
To: Douglas McNaught <doug@ono.tc.net>
Subject: Re: HELP My flock does not work?!?
Message-Id: <340D0FA8.6CFC81BB@goweb.lu>

Douglas McNaught wrote:

> The following message is a courtesy copy of an article
> that has been posted as well.
>
> [mailed and posted]
>
> Bosch Patrick <bosch@goweb.lu> writes:
>
> > I have Perl5.003 on a RS600 with AIX4.1 and I want to user flock in
> a
> > few perl scripts, Flock is implemented on RS6000 and when I use it
> in a
> > Perl scipt I have no fatal error. It even returns a true value! But
> when
> > I try to access a file locked by one scrit with another script, then
>
> > everything happens as there is no flock!?!
>
> Are you using flock in both scripts?  Most file locking on Unix
> systems is advisory rather than mandatory, which means all programs
> using a lockable file need to use the same locking mechanism.
>
> -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='encryptabdfghjklmoq
> uvwxz';$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";

Thanks a lot for your reply!

In deed I use the same locking mechanism in the two of them. I have
added two example scripts at the end of the message. I need the locking
mechanism for CGI programs where users can put messages and databases
have to be updated for every new message. The program should read the
database, modify one or more lines and reprint the output to the
database. If there are two users at the same time without locking the
file I would have some conflicts and some input could be loosed.

I would be happy if you could help me

thanks patrick
 
 
 

1.pl

#!/usr/bin/perl
open(FILE, "+<file.txt");
if (flock(FILE, LOCK_EX)) {
while (<FILE>) {
   print $_;
}
sleep(5);
seek(FILE,0,2);
print FILE "34\n";
flock(FILE, LOCK_UN);
close(FILE);
} else {
print "coucou\n";
}
exit(1);
 

2.pl

#!/usr/bin/perl
open(FILE, "+<file.txt");
unless (flock(FILE, LOCK_EX)) {
   print "waiting\n";
}
while (<FILE>) {
   print $_;
}
sleep(5);
seek(FILE,0,0);
print FILE "78\n";
flock(FILE, LOCK_UN);
close(FILE);
exit(1);
 



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

Date: 03 Sep 1997 11:56:20 +0200
From: ishark@lsh01.univ-lille1.fr (Alberto BARSELLA)
Subject: Re: HELP My flock does not work?!?
Message-Id: <m24t82pvp7.fsf@mokulen.univ-lille1.fr>

In article <340D0FA8.6CFC81BB@goweb.lu> Bosch Patrick <bosch@goweb.lu> writes:

> I would be happy if you could help me
> 
> thanks patrick
> 
> 1.pl
> 
> #!/usr/bin/perl
                ^^^^^^
Where's the -w switch?
If you place a -w there you get a nice message, which can give you
some good idea about what is screwed up, something like:

Argument "LOCK_EX" isn't numeric in flock

> open(FILE, "+<file.txt");
> if (flock(FILE, LOCK_EX)) {
                  ^^^^^^^
What is this thing without a $?
The second argument to flock is an integer, (man flock), whose value
must be initialized and used as in man perlfunc (look for the flock entry):
Just cut'n'paste from the man page into you script the lines:

$LOCK_SH = 1;
$LOCK_EX = 2;
$LOCK_NB = 4;
$LOCK_UN = 8;

and use
> if (flock(FILE, $LOCK_EX)) {

> while (<FILE>) {
>    print $_;
> }
> sleep(5);
> seek(FILE,0,2);
> print FILE "34\n";
> flock(FILE, LOCK_UN);
             
As above, $LOCK_UN, which BTW you don't need since close automatically
releases locks.

> close(FILE);
> } else {
> print "coucou\n";
> }
> exit(1);
>  
> 
> 2.pl
> 
> #!/usr/bin/perl

-w is missing :)
And you need to define and use $LOCK_EX and $LOCK_UN, too.

> open(FILE, "+<file.txt");
> unless (flock(FILE, LOCK_EX)) {
>    print "waiting\n";
> }

This loop is useless. Unless you specify the option $LOCK_NB, flock
will block your script until the lock is released (which might be what
you want, or it might be not).

> while (<FILE>) {
>    print $_;
> }
> sleep(5);
> seek(FILE,0,0);
> print FILE "78\n";
> flock(FILE, LOCK_UN);
> close(FILE);
> exit(1);

With those mods everything seems to run fine on my linux box.

Hope this help,
Alberto
-- 
Alberto BARSELLA
PGP fingerprint = 13 3F 22 D2 0B 0A D3 25  F1 89 FE B5 82 AD 75 2A


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

Date: 3 Sep 1997 05:10:35 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Help with Perl hooks on INN 1.5.1, please
Message-Id: <5uirgb$ldp@news.service.uci.edu>

In article <01bcb753$2df794a0$fc01fd0a@telsarlt.harmonic.com>,
Stan A. Rogge <srogge@telsarpc.harmonic.com> wrote:
<Perl 5 does not use dbmopen and dbmclose.  It uses tie and untie.  Also,
<you must define the type dbm you are using.  Here is an example:

So how come the new Llama book still uses 'em?  I'm confused.

Eric
-- 
Eric D. Friedman
friedman@uci.edu


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

Date: 3 Sep 1997 05:31:14 GMT
From: Tero Tuononen <tuononen@cc.helsinki.fi>
Subject: Help! cron&perl !
Message-Id: <5uisn2$hir$1@oravannahka.Helsinki.FI>

Hi there !

I am having problems with the following structure:

I have few perl scripts that work fine when executed from commandline
and in proper directory. When I call these very same scripts from
cron it does not work anymore. There is one script that is called from
cron and then the script itself calls for more scripts when it generates
proper commandlines to do some daily routines with daily changing files. All
the stuff is located in the same directory but is there still a problem
with paths or what ? The script cannot access some file that surely are
in the same directory...it also has major difficulties copying result
files to some subdirectories and so on. 

I found some info about parameter %ENV{'path'} but maybe I was not
able to use it right since nothing new happened. Could someone confirm
the right way to use this command?

Do I need to use absolute paths in every statement if I want to use
my scripts from cron.

I really need help with this one.

thanks

best wishes Tero


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

Date: Mon, 01 Sep 1997 17:25:45 +0200
From: Andrea Berger <aberger@datanord.it>
Subject: Is a version for NT 4.0 of the swish search program available somewhere ????
Message-Id: <340ADE78.812AA144@datanord.it>

Hi there !
Is a version for NT 4.0 of the swish search program available somewhere
????
many thanks
AB

--
___________________________________________

 Andrea Berger
 Datanord Multimedia
 +39-2-48954000 fax: +39-2-47710888
 E.mail : aberger@datanord.it
___________________________________________




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

Date: 3 Sep 1997 05:42:08 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Making a Swiss-Army Knife HTML tool in Perl
Message-Id: <5uitbg$ma1@news.service.uci.edu>

In article <340c8683.676630895@news.stlnet.com>,
T. Wheeler <twheeler@m-net.arbornet.org> wrote:
<Hello,
<
<I am wanting to deelop a do-it-all perl tool that will take plain text

<cringe>
Tom, have you every noticed that Swiss Army Knives are fun to play
with, but seldom adequate for everyday use in all of their capacities?
I would hate to use a Swiss Army Knife spoon every morning, for
example, because a simple spoon (that isn't also trying to be a
screwdriver and a compass) will do the job better every time.

In short, no program - no matter how bloated - can be all things
to all people, regardless of what the guys who keep inflating
MS Word may think.

<files and create decent formatted HTML.  Once it is completed, I will
<post it in th epublic domain for all to use.

This has been done many times, but rarely well.  What do you mean by
"decent [sic] formatted HTML"?  Do you plan to build in support for the
full HTML 4.0 DTD?  Or does "decent" simply refer to some subset of
HTML that you personally find appealing?  Let me be clear: I'm not
bashing you here, but I am either a) impressed that youwould take on a
project of this enormity; or b) puzzled by the claim that your personal
faves would somehow comprise a do-it-all tool suitable for general
consumption.

< I warn you now -- I am
<somewhat of a newbie to perl although I have a bit of experience in
<other languages.  

Again, are you sure you know what you're getting into?


-- 
Eric D. Friedman
friedman@uci.edu


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

Date: Wed, 03 Sep 1997 09:43:42 +0100
From: Gary Colman <SPAMFREEcolmang@ms.com>
To: John Nielsen <jnielsen@chemistry.mps.ohio-state.edu>
Subject: Re: mixing hexadecimal and strings
Message-Id: <340D233E.411A@ms.com>

Hi John


> The result I get from this code, doesn't make sense to me:
> $a="\x"."3f";
> $b="\x3f";
> if ($a == $b ) {print "They are equal $a $b\n";}
> else {print "They are not equal $a $b\n";}
> 
> When I run it I get:
> They are equal 3f ?
That is correct.

> It looks to me like $a is a string and $b a hexidecimal number. They
> shouldn't be equal.
In the first assignment, what you're in effect saying is:
create a single entity from "\x" and "3f", and then assign it to $a
In the second assignment, you're doing the same but saving the 
interpreter one step.

You then to a numeric comparison (==) and ...

> If you have a string "3f" stored in a variable, how do you convert it
> to a hexadecimal number stored in a variable.
> $number="15";
> $c = sprintf '%lx',$number;
> Now I have a string with the letter f, when I really wanted \xf.

$number=255;
$c=sprintf '%lx',$number;
$c="0x$c";
print "hex: $c\n";
print "back to decimal: ",hex($c),"\n";

Cheers
  Gary

--
   remove SPAMFREE from my email address before replying.


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

Date: Wed, 03 Sep 1997 10:37:36 +0100
From: Gary Colman <SPAMFREEcolmang@ms.com>
To: Mark Guz <mguz@sol.co.uk>
Subject: Re: pattern matching HELP!
Message-Id: <340D2FE0.626F@ms.com>

Hi Mark

> I am trying to check for illegal characters in a string.
> the allowable set is [a-z0-9_&.-] and I am trying to write code
> But no matter what I do I can't seem to find the right syntax.

print "Allowable chars: A-Z a-z 0-9 & . - _\n";
chop($bob=<STDIN>);
die "foo'ed\n" unless ($bob =~ /^[a-z0-9_&\.-]*$/);

Cheers
  Gary

--
   remove SPAMFREE from my email address before replying.


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

Date: 03 Sep 1997 10:32:14 +0200
From: Patrick Hayes <Patrick.Hayes.CAP_SESA@renault.fr>
Subject: Re: Perl (kind of) math question.
Message-Id: <vxjrab6pzld.fsf@goblin.pdj.renault.fr>


Tom Phoenix <rootbeer@teleport.com> writes:
> Actually, French uses nearly a base-twenty system. The French word for
> eighty-seven is really saying "fourscore and seven".

It's actually even worse than that. Many numbers in french aren't even
distinct words like nineteen or eighty, but lists like "ten-nine" and
"four-twenty". English does the same thing (twenty-one) but limits numbers
under 100 to two words. French-french takes it to ridiculous lenghts: Seventy
is "sixty-ten", ninety-nine is "four-twenty-ten-nine". Belgian and Swiss
french do have distinct words for seventy, eighty and ninety.
 
> So maybe they counted on their toes... :-)

I don't know _what_ they were using, but it must really warp your senses...

Pat
-- 
--------------------------------------------------------
Patrick.Hayes.CAP_SESA@renault.fr    (33) 01.41.04.64.20
--------------------------------------------------------


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

Date: Wed, 03 Sep 1997 09:23:33 +0200
From: Mark Andrew <mark.andrew@fr.bosch.de>
Subject: Perl <-> Tcl sockets
Message-Id: <340D1075.E3E@fr.DELETETHISbosch.de>

Has anyone got Perl and Tcl sockets to talk to 
each other, and if so how ?

My problem is that a Perl server, created using a call
to 

   IO::Socket::INET ->new(Proto => 'tcp',
 			  LocalPort => $PORT,
			  Listen => SOMAXCONN,
			  Reuse  => 1)

dies with 

   Bad arg length for Socket::unpack_sockaddr_in, length is 0,
should be 16 ......

when I start a client using the following tcl code

	set sock [socket <hostname> <port>]
	puts $sock "Hello" 

Thanks in advance

Mark Andrew


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

Date: 03 Sep 1997 09:46:59 +0200
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: perl and XEmacs
Message-Id: <nqok9gyvnyk.fsf@mitra.phys.uit.no>


pudge@pobox.com (Chris Nandor) writes:

> I think English is the greatest spoken language ever constructed.  Is it

English was never constructed.  It evolved.

Interlingua and Esperanto was constructed.

> Chris Nandor             pudge@pobox.com             http://pudge.net/

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


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

Date: Wed, 03 Sep 1997 02:05:19 GMT
From: mick@DONTSMAM.ME (Mick Ghazey)
Subject: Problem compiling perl5.004_01, ld: cannot open -ldb
Message-Id: <340cc096.40752702@slurpnews.lowdown.com>

I had the same problem trying to compile per5.003. I'm missing a file on my
filesystem, I think. The linker complains "ld: cannot open -ldb: No such file or
directory". What does this mean. Does the filename actually begin with `-'?
Where can I find that file? Perhaps I've got something misconfigured.

As an interim solution I installed a Redhat RPM uploaded by a `contributor'. The
perl debugger seg-faults no matter what program I try to debug. I can't get the
DBI modules to work. I've re-installed DBD. DBI hangs on `make test'.

Someone please help. I'm a small ISP. Some of my scripts don't work with the
perl version I'm using now. Trying to run an ISP without a database is a real
problem. Compiling my own version of perl will probably fix these problems.

------------------------- output of `make' ----------------------------------
 ./miniperl configpm tmp
sh mv-if-diff tmp lib/Config.pm
File lib/Config.pm not changed.
	AutoSplitting perl library

	Making DynaLoader (static)
make[1]: Entering directory `/var/download/perl/perl5.004_01/ext/DynaLoader'
make[1]: Leaving directory `/var/download/perl/perl5.004_01/ext/DynaLoader'
make[1]: Entering directory `/var/download/perl/perl5.004_01/ext/DynaLoader'
make[1]: Leaving directory `/var/download/perl/perl5.004_01/ext/DynaLoader'
 
	Making utilities
make[1]: Entering directory `/var/download/perl/perl5.004_01/utils'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/var/download/perl/perl5.004_01/utils'
 
	Making x2p stuff
make[1]: Entering directory `/var/download/perl/perl5.004_01/x2p'
make[1]: `all' is up to date.
make[1]: Leaving directory `/var/download/perl/perl5.004_01/x2p'

	Making DB_File (dynamic)
make[1]: Entering directory `/var/download/perl/perl5.004_01/ext/DB_File'
make[1]: Leaving directory `/var/download/perl/perl5.004_01/ext/DB_File'
make[1]: Entering directory `/var/download/perl/perl5.004_01/ext/DB_File'
LD_RUN_PATH="/usr/lib" cc -o ../../lib/auto/DB_File/DB_File.so  -shared
-L/usr/local/lib DB_File.o    -L/usr/local/lib -ldb 
ld: cannot open -ldb: No such file or directory
make[1]: *** [../../lib/auto/DB_File/DB_File.so] Error 1
make[1]: Leaving directory `/var/download/perl/perl5.004_01/ext/DB_File'
make: *** [lib/auto/DB_File/DB_File.so] Error 2



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

Date: Wed, 03 Sep 1997 10:05:13 +0200
From: Gary Howland <ghowland@hotlava.com>
To: alex@inova.net
Subject: Re: Question: Returning false/zero to shell...
Message-Id: <340D1A39.5937@hotlava.com>

alex@inova.net wrote:
> 
> Hello friends,
> 
> I am trying to get a script to return a zero or false that can be interpreted
> by a bash shell script.
> 
> example:
> 
> test.pl || echo "Hi"
> 
> How should the script exit in order for it to be evaluated as false? Die worked
> but left a STDERR message. Is there a cleaner way?

Use exit.  The parameter passed to exit will be the value returned
by the perl script.


> While am at it. If I did want the script to return something, how would that be
> done?

This is normally done by simply printing the result to STDOUT, and
having the shell pick up the output, perhaps using backquotes like
this:

	TEST_OUTPUT=`test.pl`


Gary


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

Date: 3 Sep 1997 06:57:50 GMT
From: Br. Michael<stanthony@jumpnet.com>
Subject: St. Anthony of Padua
Message-Id: <5uj1pe$4er@news.jumpnet.com>


September 1, 1997

	We need your help NOW! The Order of St. Anthony/St. Anthony Center is an ecumenical tax exempt Religious Order dedicated to helping the oppressed. One group of oppressed is the alcoholics and addicts. A few months ago we entered into an escrow contract with owner financing, to purchase 152 acres just southeast of Austin.  This property would provide a larger home for the monastery and those who want to work with us, as well as property on which to develop the first St. Anthony Detox and Recovery Center. This contract requires a $250,000 down payment. 
	We planned an 84 hour music festival for this weekend called The Cow Pasture Special.We were featuring Blood Sweat & Tears, the Ricky Van Shelton Band, Willie Nelson and many local groups. This would have covered the down payment and more. At the last minute our financial backers for the festival reneged on their commitments. We could not find alternative backing fast enough and had to cancel the festival. Now we are asking for donations or loans of approximately $300,000 to cover the down payment and liabilities we acquired in having to cancel the festival.Closing on the property is this Thursday, 9/4/97.
	If you or people you know have a special interest in the desperate need for detox and recovery facilities, please contact us immediately at (512) 467-0613; FAX (512) 467-9027; 7511 Carriage Drive; Austin, Texas 78752 or e-mail at stanthony@jumpnet.com.
For The St. Anthony Center:
With Love and Peace; I am, Br. Michael, OSA


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

Date: Wed, 03 Sep 1997 10:12:44 +0100
From: Gary Colman <SPAMFREEcolmang@ms.com>
To: "Kirk L. Israel" <kisrael@allegro.cs.tufts.edu>
Subject: Re: Trivial(?) readdir question
Message-Id: <340D2A0C.12A3@ms.com>

Hi Kirk

> How likely is readdir to NOT return '.' and '..' as the first two
> directory entries when reading in a directory?
I'm not sure how it sorts the entries, but I tried the following:

~$ touch <ctrl v><backspace>
~$ ls -al

and got my new file listed before the "." and ".." yet
readdir still returned "." and ".." first ..

That notwithstanding, as mentioned in the Camel book, you could
just do:

@allfiles=grep(!/^\.\.?$/,readdir(THISDIR));

Cheers
  Gary
--
   remove SPAMFREE from my email address before replying.


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

Date: Wed, 03 Sep 1997 11:46:54 +0200
From: Marc Philips <Marc.Philips@tvd.be>
Subject: Re: Trivial(?) readdir question
Message-Id: <340D320E.8BDEB624@tvd.be>

> > How likely is readdir to NOT return '.' and '..' as the first two
> > directory entries when reading in a directory?

On UNIX, a directory is created with two (sub)directory entries: "." and
"..".

Given that readdir reads the directory sequentially, I'd say that they
will always be the first two entries returned and always in that order.

Marc



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

Date: 1 Sep 1997 12:41:07 GMT
From: burt@ici.net (Burt Lewis)
Subject: Username & password verification?
Message-Id: <5ued53$n9l$1@bashir.ici.net>


Hi,

I need to be able to verify someones Unix system username and password.

I have a form that is accepting the input ok and the username part to check 
if there is one that matches but I'm having trouble also checking if the 
password is valid.

This is what i have so far:
(the getpwent seems to be causing a system error)

Appreciate any help on this.

Burt Lewis
www.eastonmass.com

sub verify
{
if (! getpwnam($FORM{'user'})) ######## This is working!!
{
print "Content-type: text/html\n\n";
        print "<CENTER><H1><TT>Post Error!</TT></H1>";
        print "<b>No such Username<BR><BR>"; 
        print "Press the back button on your browser and try again....\n";
        exit;
   } 
   if (! getpwent($FORM{'pword'})) ########## This is NOT working!
   {
   print "Content-type: text/html\n\n";
           print "<CENTER><H1><TT>Post Error!</TT></H1>";
           print "<b>Sorry, wrong password<BR><BR>"; 
           print "Press the back button on your browser and try again....\n";
           exit;
   } 
   
   }



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

Date: Wed, 3 Sep 1997 07:16:08 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Username & password verification?
Message-Id: <ebohlmanEFx86w.65J@netcom.com>

Burt Lewis (burt@ici.net) wrote:
: I need to be able to verify someones Unix system username and password.

[snip]

: sub verify
: {
: if (! getpwnam($FORM{'user'})) ######## This is working!!
: {
: print "Content-type: text/html\n\n";
:         print "<CENTER><H1><TT>Post Error!</TT></H1>";
:         print "<b>No such Username<BR><BR>"; 
:         print "Press the back button on your browser and try again....\n";
:         exit;
:    } 
:    if (! getpwent($FORM{'pword'})) ########## This is NOT working!

Read the documentation for getpwent().  You'll see that it does *not* 
take any parameters.  The first time you call it, it returns the first 
entry from the password file; each subsequent call returns the next 
entry.  It does *not* look up a password.

Also read the documentation for getpwnam() and crypt().  You'll know how 
to verify a password after doing so.


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

Date: Wed, 03 Sep 1997 11:18:10 +0100
From: Gary Colman <SPAMFREEcolmang@ms.com>
To: Burt Lewis <burt@ici.net>
Subject: Re: Username & password verification?
Message-Id: <340D3962.276F@ms.com>

Hi Burt

> I need to be able to verify someones Unix system username and 
> password.
Are you running shadow passwords ?
Can your script get a valid password entry ?

> I have a form that is accepting the input ok and the username part
> to check if there is one that matches but I'm having trouble also 
> checking if the password is valid.
> (the getpwent seems to be causing a system error)
>    if (! getpwent($FORM{'pword'})) ########## This is NOT working!
$crypted=(getpwnam($FORM{'user'}))[1];
if ($crypted ne crypt($FORM{'pword'},$crypted)) {
#  ...
  print "Foo!\n";
}

Cheers
  Gary

--
   remove SPAMFREE from my email address before replying.


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

Date: 30 Aug 1997 14:59:53 GMT
From: burt@ici.net (Burt Lewis)
Subject: Verifying a password??
Message-Id: <5u9ch9$hak$1@bashir.ici.net>


Hi,

I'm trying to verify a username and password and can't seem to get it.

I have the username check working ok:
sub verify
{
if (! getpwnam($FORM{'user'}))
{
print "Content-type: text/html\n\n";
        print "<CENTER><H1><TT>Post Error!</TT></H1>";
        print "<b>No such Username<BR><BR>"; 
        print "Press the back button on your browser and try again....\n";
        exit;
   } }

If the username is valid, now I need to check the password entered on the 
form.  I tried this but keep getting a server errror:

if (! getpwent($FORM{'pword'}))
   {
   print "Content-type: text/html\n\n";
           print "<CENTER><H1><TT>Post Error!</TT></H1>";
           print "<b>Sorry, wrong password<BR><BR>"; 
           print "Press the back button on your browser and try again....\n";
           exit;
   } .

Appreciate any help on this.

Thanks!

Burt Lewis
www.eastonmass.com
burt@ici.net



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

Date: Wed, 03 Sep 1997 10:46:50 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Verifying a password??
Message-Id: <34123c5d.152238407@news.bgsu.edu>


[original author automagically cc'd via e-mail]

On 30 Aug 1997 14:59:53 GMT, burt@ici.net (Burt Lewis) wrote:

>If the username is valid, now I need to check the password entered on the 
>form.  I tried this but keep getting a server errror:
>
>if (! getpwent($FORM{'pword'}))
>   {
>   print "Content-type: text/html\n\n";
>           print "<CENTER><H1><TT>Post Error!</TT></H1>";
>           print "<b>Sorry, wrong password<BR><BR>"; 
>           print "Press the back button on your browser and try again....\n";
>           exit;
>   } .
>
>Appreciate any help on this.

Simple.

Look in your web server's log file and see what error message is being
generated. Fix the error and run it again. Repeat until all errors are
gone.

*Everyone* runs into this sooner or later. It's in the FAQ.

Jeremy
---
Jeremy D. Zawodny
WCNet Technical Geek & Web Stuff
<URL:http://www.wcnet.org/~jzawodn/>

"That's an example of how Perl can bring school yard cruelty to new heights."
    -- Jon Orwant at the 1st Annual Perl Conference


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

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

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