[17835] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5255 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 5 03:25:57 2001

Date: Fri, 5 Jan 2001 00:25:36 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <978683136-v9-i5255@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 5 Jan 2001     Volume: 9 Number: 5255

Today's topics:
        doing something useful with utf-8 <elijah@workspot.net>
        Downgrading Perl <don@lclcan.com>
    Re: Downgrading Perl (Chris Fedde)
    Re: Downgrading Perl <nospam@nospam.com>
        e-mail to perl gateway... (Web Your Business)
    Re: e-mail to perl gateway... (Rafael Garcia-Suarez)
        Editor with "collapse" type feature. <vigne@nhamp.net>
    Re: Editor with "collapse" type feature. <feldspar@ix.netcom.com>
    Re: Editor with "collapse" type feature. (Tad McClellan)
    Re: Editor with "collapse" type feature. <derek@blockspam.fortstar.demon.co.uk>
    Re: Editor with "collapse" type feature. gungeek@my-deja.com
        error loading shared libraries bfagan@bcse.nec.com
    Re: FAQ 7.9:   How do I create a module? (BUCK NAKED1)
    Re: FAQ 7.9:   How do I create a module? <uri@sysarch.com>
    Re: FAQ 7.9:   How do I create a module? (Tad McClellan)
        fatals to browser <test31@docuharbor.com>
    Re: fork() and waitpid() question <spicano@ptdcs2.intel.com>
    Re: formated regex (Tad McClellan)
    Re: formated regex <bart.lateur@skynet.be>
    Re: General Personal Development Strategy <montuori@arrakisplanet.com>
    Re: General Personal Development Strategy <terahippo@my-deja.com>
    Re: General Personal Development Strategy <nospam@nospam.com>
        Getting the password hash (getpw* doesn't work) (Ben Okopnik)
    Re: Getting the password hash (getpw* doesn't work) (Abigail)
    Re: Getting the password hash (getpw* doesn't work) (Brandon Metcalf)
    Re: Groovy non-profit needs CGI help (BUCK NAKED1)
    Re: Groovy non-profit needs CGI help <brondsem@my-deja.com>
    Re: Help connection to mysql <dennis_marti@yahoo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 5 Jan 2001 01:25:27 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: doing something useful with utf-8
Message-Id: <eli$0101042007@qz.little-neck.ny.us>

I've been reading 'perldoc utf8', 'perldoc perlunicode', and
results for a dejanews search of 'utf8 in comp.lang.perl.misc',
but I don't see anybody describing how to use perl usefully
for UTF8 related problems.

Here's what I would like to do: I'd like to get UTF-8 encoded
text to display properly in a browser. Since I have not seen
this work by setting the charset and just putting the UTF-8
enocoded characters in the file[*], I thought I would try to
change all the UTF-8 characters to numerical encodings
(&#bignum;).

That's were perl entered the picture.

For a file 'test-a' that contains one line with what I think
is Japanese text, I thought I could make a file 'test-b' with
numerical encodings with a script like this:

#!/usr/bin/perl -w
# Test script to numerically encode UTF-8 characters.
require 5.6.0;
use strict;
use utf8;

open(A, 'test-a') or die;
my $a = <A>;
close A;

my $b;

# Testing shows that this just gives me warnings.
#$a =~ tr/\0-\xff//CU;

$a =~ s/(.)/(($b=ord($1)) > 127)? "&#$b;" : $1/xeg;

print $a;

open(B, '>test-b') or die;
print B $a;
close B;

__END__

Here's test-a, uuencoded for safety.

begin 664 test-a
M,CDT,C0Y-@G"O\.LPKC"KL*UPZG#@,.'(,*[PZ?"ML.["<*QPY?"M,.K(,*S
MPKO#A\*PPK_"H0G#A<.6PKK#LR#"O\.`PK3#@\*YPZ,)PK/"NR#"N,*VPX#"
MO<*_PJ$@PKK#L<.$PJ,@PK/"NR#"N,.PPKW#@`E-:6YU970@*,*PPZ;#@,*]
MPK[#ARD)PK#"H<*XPJ["O\.VPX'#N"#"L<.F"<.!P[;"L\*M(,*SPJ\)PK_#
MK,*_PZ_#A\.1(,.&PZW#@<.V"<*[PZ?"ML.[PX?#C\*QPZ(@PK;"I\*YPJ["
$O\*A"@``
`
end


The output file however does not have Unicode numerical escapes,
instead each byte has been numerically escaped, which is worse
than useless.

So what's a coder supposed to do?

[*] I tested on Linux Netscape 4.74, WinNTsp4 Explorer 5.5,
    Japanese 98 Explorer 5.x. In each case the file had
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    in the <HEAD> block. The Japanese 98 could display the
    characters as Japanese when I used the 'view source' 
    equivilent.

Elijah
------
5.005_03 compatible code prefered, code for beta perl versions not wanted


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

Date: Thu, 04 Jan 2001 16:35:21 -0500
From: Don <don@lclcan.com>
Subject: Downgrading Perl
Message-Id: <3A54EC99.39B07644@lclcan.com>

Hi,

It seems because of a bug in Perl 5.6, I have to downgrade to a previous
release.  I'm working on a RedHat 7.0 machine.  How do I cleanly remove
Perl 5.6 and install the previous release which I believe is 5.005_03?

Don



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

Date: Fri, 05 Jan 2001 04:35:33 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Downgrading Perl
Message-Id: <pac56.678$B9.191603712@news.frii.net>

In article <3A54EC99.39B07644@lclcan.com>, Don  <don@lclcan.com> wrote:
>Hi,
>
>It seems because of a bug in Perl 5.6, I have to downgrade to a previous
>release.  I'm working on a RedHat 7.0 machine.  How do I cleanly remove
>Perl 5.6 and install the previous release which I believe is 5.005_03?
>

Unless you (or your RPM) went out of it's way to muck things up your
5.005_03 perl should still be there.  Look for it by verson number in
/usr/local/bin and restore the link if you want to.  If you still have the
source files around you can do a 'make install' and all should be well.
-- 
    This space intentionally left blank


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

Date: 5 Jan 2001 05:41:06 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Downgrading Perl
Message-Id: <933mpi$rkt$0@216.155.32.212>

In article <3A54EC99.39B07644@lclcan.com>, Don <don@lclcan.com> wrote:

 | Hi,
 | 
 | It seems because of a bug in Perl 5.6, I have to downgrade to a previous
 | release.  I'm working on a RedHat 7.0 machine.  How do I cleanly remove
 | Perl 5.6 and install the previous release which I believe is 5.005_03?
 | 
 | Don
 | 

Next time install 5.6.0 someplace else, like /opt so that you retain the 
original 5.005 Perl install where it would normally be... 

Then you can play with it to your heart's content without worrying about 
breaking the other one.

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Fri, 05 Jan 2001 01:05:55 GMT
From: webyourbusiness@home.com (Web Your Business)
Subject: e-mail to perl gateway...
Message-Id: <webyourbusiness-0401011805270001@192.168.0.3>

It's probably been asked, but I can't find it.. perhaps I'm searching for
the wrong thing, but here goes:

I'm after information on how to write scripts (Perl and [ba]sh) and C
binaries that I can trigger off by e-mail to a particular address...

For instance my ISP uses a script of some sort I guess for sending support
documents, based on the subject.

Another example is a script we use to obtain IP addresses for our
hosting.  I e-mail in the reverse DNS records for IPs I've allocated, the
server processes and verifies them, then if I'm allowed (ie, I've used all
my allocation), it emails me a code to send to another e-mail address to
get more.

Where do I find information on writing persistant programs to read from
either a socket of a fifo, and how to set it all up?

tia

Greg

-- 
http://www.webyourbusiness.com - making award winning e-commerce
solutions affordable.  Download your trial for free:
US:http://www.webyourbusiness.com/cgi-bin/redirector.cgi?l=newsinfoUS
EU:http://www.webyourbusiness.com/cgi-bin/redirector.cgi?l=newsinfoUK


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

Date: Fri, 05 Jan 2001 07:50:16 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: e-mail to perl gateway...
Message-Id: <slrn95av5s.du5.rgarciasuarez@rafael.kazibao.net>

Web Your Business wrote in comp.lang.perl.misc:
> It's probably been asked, but I can't find it.. perhaps I'm searching for
> the wrong thing, but here goes:
> 
> I'm after information on how to write scripts (Perl and [ba]sh) and C
> binaries that I can trigger off by e-mail to a particular address...

This is not really a Perl question then... This is related to your mail
server. For example, with sendmail, the usual way to do this is to
define an alias
  address: "|/path/to/program"
Read the docs for your mail server; find a newsgroup for it.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Thu, 04 Jan 2001 11:07:32 -0800
From: Stuart Vigne <vigne@nhamp.net>
Subject: Editor with "collapse" type feature.
Message-Id: <E3844ED75097EFFC.182E4BADCF6B7B11.5829CE2EFC5A2BDC@lp.airnews.net>

I'm looking for a text editor that has some sort of collapse feature
so I can hide from my screen (all but some visual indicator) ranges of
text I want to ignore.  

Anyone know of such a thing?


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

Date: Thu, 04 Jan 2001 14:27:27 -0400
From: Antaeus Feldspar <feldspar@ix.netcom.com>
Subject: Re: Editor with "collapse" type feature.
Message-Id: <3A54C08F.585D421B@ix.netcom.com>

Stuart Vigne wrote:
> 
> I'm looking for a text editor that has some sort of collapse feature
> so I can hide from my screen (all but some visual indicator) ranges of
> text I want to ignore.
> 
> Anyone know of such a thing?

No, but if you find one, please let me know; I've often wished for one
myself...

	-jc


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

Date: Thu, 4 Jan 2001 12:57:57 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Editor with "collapse" type feature.
Message-Id: <slrn959ed5.nfd.tadmc@magna.metronet.com>

Stuart Vigne <vigne@nhamp.net> wrote:

>I'm looking for a text editor 


Then you should look in a place where such things are discussed, such as:

   comp.editors


>that has some sort of collapse feature
>so I can hide from my screen (all but some visual indicator) ranges of
>text I want to ignore.  


What is your Perl question?


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 4 Jan 2001 20:26:45 +0000
From: Derek Fountain <derek@blockspam.fortstar.demon.co.uk>
Subject: Re: Editor with "collapse" type feature.
Message-Id: <36556.38639$Yy.892010@news2-win.server.ntlworld.com>

Stuart Vigne wrote:

> I'm looking for a text editor that has some sort of collapse feature
> so I can hide from my screen (all but some visual indicator) ranges of
> text I want to ignore.
> 
> Anyone know of such a thing?
> 

Andy's Editor is said to be pretty good and is at 
http://www.interalpha.net/customer/nyangau/ae/ae.htm

It's written by Andy Key who works in the same department as I do. Many 
people in our lab use it and few would be parted from it. That's not a 
personal recommendation though - I use XEmacs!




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

Date: Fri, 05 Jan 2001 00:11:17 GMT
From: gungeek@my-deja.com
Subject: Re: Editor with "collapse" type feature.
Message-Id: <9333eu$a9b$1@nnrp1.deja.com>

In article
<E3844ED75097EFFC.182E4BADCF6B7B11.5829CE2EFC5A2BDC@lp.airnews.net>,
  Stuart Vigne <vigne@nhamp.net> wrote:
> I'm looking for a text editor that has some sort of collapse feature
> so I can hide from my screen (all but some visual indicator) ranges of
> text I want to ignore.
>
> Anyone know of such a thing?
>

It's been a while since I've used it, but I think Allaire Homesite did
this.  I upgraded to Linux, so I can't use it anymore.


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 04 Jan 2001 19:24:33 GMT
From: bfagan@bcse.nec.com
Subject: error loading shared libraries
Message-Id: <932il4$qds$1@nnrp1.deja.com>

I get the following message from trying to run a script.


perl: error in loading shared libraries:
/usr/lib/perl5/site_perl/i386-linux/aut
o/ARS/ARS.so: undefined symbol: ARInitialization

I know the lib is located there, but it is not found.  Compile and
installation seemed ok, but tests failed with the same error.

Any ideas?

--Brant


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 4 Jan 2001 14:41:25 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: FAQ 7.9:   How do I create a module?
Message-Id: <9860-3A54DFF5-53@storefull-247.iap.bryant.webtv.net>

With all due respect, this FAQ doesn't go far enough. There's alot more
info needed so that people will understand the process of installing
modules. That's why there are so many module questions.

For example, it doesn't tell you that you need a telnet or telnet script
in order to install a module locally. It doesn't go over things like
UNINST=1, make clean, make clean install, what to do for certain error
msgs, etc. Until these items are addressed, module questions will
continue to pop up often.

BTW, this constant flood of FAQ is flooding my newsreader. Please stop.
I consider them unnecessary and SPAM. A simple where to find the FAQ
posted twice a week should be more than sufficient.

Regards,
Dennis



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

Date: Thu, 04 Jan 2001 21:36:16 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: FAQ 7.9:   How do I create a module?
Message-Id: <x7ae9780fj.fsf@home.sysarch.com>

>>>>> "BN" == BUCK NAKED1 <dennis100@webtv.net> writes:

  BN> With all due respect, this FAQ doesn't go far enough. There's alot
  BN> more info needed so that people will understand the process of
  BN> installing modules. That's why there are so many module questions.

it is an FAQ not a tutorial or a manual. those exist and can be found
with perldoc.

  BN> BTW, this constant flood of FAQ is flooding my newsreader. Please stop.
  BN> I consider them unnecessary and SPAM. A simple where to find the FAQ
  BN> posted twice a week should be more than sufficient.

this has been discussed many times before and the consensus is that the
robot posting of the FGAQ is a good thing. it gets newbies to read them,
bugs and typos are found (a few this last week alone) and it is only
about 3 a day so how can that clog your newsreader? just killfile them.

and if you don't like them, why did you read this one and comment on it?
sounds like the robot did its job very well.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 4 Jan 2001 14:52:42 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: FAQ 7.9:   How do I create a module?
Message-Id: <slrn959l4a.no8.tadmc@magna.metronet.com>

BUCK NAKED1 <dennis100@webtv.net> wrote:
>With all due respect, this FAQ doesn't go far enough. There's alot more
>info needed so that people will understand the process of installing
                                                           ^^^^^^^^^^
>modules. 
 ^^^^^^^

The question is how to _create_ a module.  Installing a module
is not creating a module.

The p5p probably thought that noone would be so dense as to miss:

   perldoc perlmodinstall

when looking for info on how to _install_ a module.


>That's why there are so many module questions.


That's why the FAQ points you to perlmod.pod.


>For example, it doesn't tell you that you need a telnet or telnet script
>in order to install a module locally. 


Because you do not need a telnet or telnet script in order to 
install a module locally!

I install modules locally all the time, no telnet needed.

So I don't know what you are talking about there, but I'll
take a guess:  Perl is not CGI!


>It doesn't go over things like
>UNINST=1, make clean, make clean install, 


The documentation for make describes how to use make.


>what to do for certain error
>msgs, etc. 


error messages from _what_? perl? make? the OS? the C compiler?


>Until these items are addressed, module questions will
>continue to pop up often.


Thank you for volunteering to help fix that.

Please submit your documentation patches as soon as you have them ready.

Or are you just piling work on other people's plates?

If you want it fixed, fix it!


>BTW, this constant flood of FAQ is flooding my newsreader. 


Just have your newsreader filter them out automatically.


>Please stop.


Please do not stop.


>I consider them unnecessary and SPAM. 


You have a non-standard definition of "spam" then:

   http://www.tuxedo.org/~esr/jargon/html/entry/spam.html

Perl FAQs are not irrelevant or inappropriate in a Perl newsgroup.


>A simple where to find the FAQ
>posted twice a week should be more than sufficient.
                     ^^^^^^^^^

But it isn't. 

We are inundated with repeats of Frequently Asked Questions
every day. People aren't nice. They won't go look where
they have been asked to look. So it is put straight in
their face.

When there are not so many reasked FAQs here, then the autoposting
can go away. Don't hold your breath.


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 04 Jan 2001 20:35:54 -0600
From: Todd Anderson <test31@docuharbor.com>
Subject: fatals to browser
Message-Id: <3A552E98.A8C34C44@docuharbor.com>

Can anyone explain this. Is it looking for a perlmod? Because these mods
(addrlist.pm) are not called.
Thanks in advance for your help.

Can't locate Mail/Field/addrlist.pm in @INC (@INC contains:
/usr/local/oooo/perl5/5.00502/sun4-solaris
/usr/local/oooo/perl5/5.00502
/usr/local/oooo/perl5/site_perl/5.005/sun4-solaris
/usr/local/oooo/perl5/site_perl/5.005
 .) at (eval 18) line 2.

Software error:

Can't locate Mail/Field/date.pm in @INC (@INC contains:
/usr/local/oooo/perl5/5.00502/sun4-solaris
/usr/local/oooo/perl5/5.00502
/usr/local/oooo/perl5/site_perl/5.005/sun4-solaris
/usr/local/oooo/perl5/site_perl/5.005
 .) at (eval 19) line 2.




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

Date: Thu, 04 Jan 2001 17:59:18 -0800
From: Silvio Picano <spicano@ptdcs2.intel.com>
Subject: Re: fork() and waitpid() question
Message-Id: <3A552A76.2334DDDC@ptdcs2.intel.com>

For rock-solid code, do yourself a favor and do not use SIG{CHLD} as
seen in 98% of examples (assume you have the worst Unix OS and you
will not be disappointed!).

Parent: save (3) pids given back to you by fork() and place into array
%pid_h
        set up a loop with things like:
           while (@pid_l = keys %pid_h) {
             sleep 2; ;# throttle back
             foreach $pid_i (@pid_l) { 
               $ret_pid_i = &POSIX::waitpid($pid_i, &POSIX::WNOHANG); ;#
non-blocking wait.
                 => test for things like undef, -1, or N ($ man
perlfunc)
               remove from your list as you receive them
                 => delete $pid_h{$pid_i}
               place some kind of master time-out (kill -9 $pid_i), if
necessary
             }
           }

Good Luck!
Silvio


Uri Guttman wrote:
> 
> >>>>> "DS" == David Sisk <davesisk@ipass.net> writes:
> 
>   DS> OK, I've found an example of how to fork() one child process and
>   DS> waitpid() for it to complete.  Now, how do fork() 3 child
>   DS> processes, and waitpid() (or wait()) for all 3 to complete before
>   DS> the parent proceeds?  If you have an example or know where I can
>   DS> find an example, please post or email!
> 
> the perl cookbook has examples of forking servers
> 
> uri


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

Date: Thu, 4 Jan 2001 11:01:48 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: formated regex
Message-Id: <slrn9597jc.n5r.tadmc@magna.metronet.com>

tunneling@my-deja.com <tunneling@my-deja.com> wrote:

>Here is what I am trying to achieve:

[ snip, wants numbers zero padded to a specified number of digit chars ]

>I would like to know how to format a variable. 


   perldoc -f sprintf


>if (s/t=r(\S*)/t=1$count/ig) {
>  $count++;
>  }


The "replacment part" of a s/// is normally (as above) a 
double-quotish string. You can put real Perl code there
(like a call to sprintf() for example) if you use the s///e
option (perldoc perlop).


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Thu, 04 Jan 2001 20:53:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: formated regex
Message-Id: <tbo95to29fdimngbi88kfvvgf246fj8961@4ax.com>

tunneling@my-deja.com wrote:

>Here is what I am trying to achieve:
>Starting with:
>t=r1233
>t=r1
>t=r159
>t=rd22
>t=r1000
>After the // I would like to see the following results:
>t=r100
>t=r101
>t=r102
>t=rd22
>t=r103

How about:

	my $count;
	s/^(t=r)\d+/$1.($count||=100)++/meg;

> I would like to know how to format a variable. 

I think you should look into sprintf(). 

	$i = 12;
	print sprintf '%03d', $i;
-->
	012

-- 
	Bart.


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

Date: Thu, 4 Jan 2001 14:27:13 -0500 
From: kevin montuori <montuori@arrakisplanet.com>
Subject: Re: General Personal Development Strategy
Message-Id: <ydyvgrvdsor.fsf@kulon.arrakisplanet.com>

>>> Abigail  writes:

  a> It's a good idea to read `man perlfunc' from top to bottom. Not
  a> to learn all the details of all function, but just to see what
  a> functionality Perl provides. Then if you need any of it, you can
  a> study the appropriate section in detail.

        i don't disagree at all; however, i'd like to point out that
        perlfunc is available as chapter 29 in 'Programming Perl' --
        some people might have an easier time reading a real book than
        trying to read perlfunc a screenful at a time and it's easy to
        bring on the train.

        i also think that the glossary in the camel book is worth
        reading a to z, particularly for a beginner.  you can read
        perlfunc all you want, but if you don't understand what an
        lvalue is, you're just wasting your time.

        cheers,
        k.
-- 
kevin montuori

support independent booksellers -- http://www.booksense.com



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

Date: Thu, 04 Jan 2001 23:53:53 GMT
From: Zusha P <terahippo@my-deja.com>
Subject: Re: General Personal Development Strategy
Message-Id: <9332ed$9a2$1@nnrp1.deja.com>

In article <slrn95969t.qdu.abigail@tsathoggua.rlyeh.net>,
  abigail@foad.org wrote:
> John Hall (jhall@ifxonline.com) wrote on MMDCLXXXIII September MCMXCIII
> in <URL:news:lmQ46.130526$I5.3269544@news1.rdc1.sdca.home.com>:
> :} I see a lot of "you work stupid" and "RTFM" on this list.
> :}
> :} I am curious if someone can give me a more constructive
method/procedure for
> :} figuring out ways of writing perl code.
>
> More constructive than reading the manual? Except for
> private tutoring, I don't think there is.

But on the other hand, it's trivially easy to find something
more constructive than saying, "you work stupid". There's nothing
constructive there at all, Abigail, and you know it.

But I do agree with you that suggestion to read the manual indeed
is constructive.  The perl documentation is second to none in
terms of quality, completeness, and accuracy, and it's the best
and recommended place to go to get these kinds of answers.

Now, why is it so hard for some of you to write something like
the final sentence of the paragraph I wrote above, instead of
making a point to insult the person and kick him or her in
the ass on the way out when suggesting that he or she should
go to the FAQ?

Do some of you folks actually _like_ to incite people to start
flame wars?


> :} I have been programming for ~2 weeks. Prior to my
> :} extensive career as a perl
>
> Then I doubt Perl is suitable for you. Using Perl as your first
> language is doing it the hard way - it might get you killed.
> Schumacher didn't learn to drive in a Formula I car either!

I agree with you, Abigail, that Perl is probably not very well
suited as a first programming language.  I don't really see how
it could get you killed more than anything else in life, but
I guess you're just taking some poetic license here.  At least
it's not an insult.

To the poster that Abigail is responding to:

A good first language might be Basic -- maybe even Visual Basic
as long as you avoid the fake object oriented stuff.

On the other hand, I have seen some rank beginners catch on
extremely quickly to Perl as a first language, so perhaps you
might find yourself to be one of the people who take to it
like a duck to water.

I second the rest of Abigail's excellent advice:


> :} In a nutshell, how do I get from "I need this data to print out
always as 2
> :} characters" to "perldoc -f printf" - What tools did you people use
when you
> :} were starting out? Will the fact that I don't know C cripple me? [I
notice a
> :} lot of things in perldoc say 'similar to how it's done in C']. Are
there any
> :} preferred sites that have useable search features, that will work
for me as
> :} I am developing an understanding of the terminology?
>
> It's a good idea to read `man perlfunc' from top to bottom. Not to learn
> all the details of all function, but just to see what functionality Perl
> provides. Then if you need any of it, you can study the appropriate
section
> in detail.
>
> Also at the beginning of perlfunc, you find all the functions listed by
> category. You wanted to have something related to input/output. And guess
> what? print and printf are mentioned ....
>
> You are not crippled if you don't know C, but knowing C/Unix does help.
>
> Abigail
> --
> sub A::TIESCALAR{bless\my$x=>A};package B;@q[0..3]=qw/Hacker Perl
> Another Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
> $y=>B}; tie my $shoe => qq 'A';print "$shoe $shoe $shoe $shoe\n";
>

--
 Zusha P
 terahippo@my-deja.com


Sent via Deja.com
http://www.deja.com/


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

Date: 5 Jan 2001 00:33:57 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: General Personal Development Strategy
Message-Id: <9334pl$396$0@216.155.32.178>

In article <ydyvgrvdsor.fsf@kulon.arrakisplanet.com>, kevin montuori 
<montuori@arrakisplanet.com> wrote:

 |         i don't disagree at all; however, i'd like to point out that
 |         perlfunc is available as chapter 29 in 'Programming Perl' --
 |         some people might have an easier time reading a real book than
 |         trying to read perlfunc a screenful at a time and it's easy to
 |         bring on the train.
 | 
 |         i also think that the glossary in the camel book is worth
 |         reading a to z, particularly for a beginner.  you can read
 |         perlfunc all you want, but if you don't understand what an
 |         lvalue is, you're just wasting your time.

Chapter 8, sections "Efficiency" and "Programming with Style" have 
proven especially useful to me, making me think of things in different 
ways.. even the "Common goofs for Novices" is useful at this point, to 
just peek at occasionally and make sure I'm not forgetting anything :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 4 Jan 2001 20:29:27 GMT
From: ben-fuzzybear@geocities.com (Ben Okopnik)
Subject: Getting the password hash (getpw* doesn't work)
Message-Id: <slrn959nar.5sq.ben-fuzzybear@Odin.Thor>

Hi, all -

I'm trying to do password validation, and I can't seem to get the password 
hash out of "/etc/shadow" via any of the "getpw*" functions. I've looked 
at

perldoc -q shadow
perldoc -q password
perldoc perlfunc / search for "getpw", "crypt", "shadow"

The only (possibly) relevant bit I've found, in perlfunc, is 

"Shadow password files are only supported if your vendor has implemented
them in the intuitive fashion that calling the regular C library routines
gets the shadow versions if you're running under privilege.  Those that
incorrectly implement a separate library call are not supported."

I'm running Debian Linux 2.2, Perl version 5.005_03, and libc-2.1.3; 
further, the deponent knoweth not. How do I tell?


As an example,

perl -we 'print join(":",getpwuid($<))'

gives me

ben:x:1000:1000:::Benjamin Okopnik,,,:/home/ben:/bin/bash

Obviously, retrieving the "password" element just gives me 'x'.

CPAN has CfgTie::TieShadow, which sounds like it would do what I need, but 
I'd prefer to find out if I'm doing something wrong, rather than just 
giving up on what are supposed to be the right tools!


Ben Okopnik

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I know of no more encouraging fact than the unquestionable ability of man
to elevate his life by conscious endeavor. -- H. D. Thoreau 


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

Date: 5 Jan 2001 00:50:14 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Getting the password hash (getpw* doesn't work)
Message-Id: <slrn95a6i6.9sh.abigail@tsathoggua.rlyeh.net>

Ben Okopnik (ben-fuzzybear@geocities.com) wrote on MMDCLXXXIII September
MCMXCIII in <URL:news:slrn959nar.5sq.ben-fuzzybear@Odin.Thor>:
-: 
-: I'm trying to do password validation, and I can't seem to get the password 
-: hash out of "/etc/shadow" via any of the "getpw*" functions. I've looked 
-: at
-: 
-: perldoc -q shadow
-: perldoc -q password
-: perldoc perlfunc / search for "getpw", "crypt", "shadow"
-: 
-: The only (possibly) relevant bit I've found, in perlfunc, is 
-: 
-: "Shadow password files are only supported if your vendor has implemented
-: them in the intuitive fashion that calling the regular C library routines
-: gets the shadow versions if you're running under privilege.  Those that
-: incorrectly implement a separate library call are not supported."
-: 
-: I'm running Debian Linux 2.2, Perl version 5.005_03, and libc-2.1.3; 
-: further, the deponent knoweth not. How do I tell?


Note that to access the shadow file, you need root permissions (unless you
have a badly configured system).  But that's only a necessary condition,
not a sufficient. Some system use different library calls to get the
password field - calls that aren't used in 5.005_03 (nor in 5.6 or 5.7,
IIRC).



Abigail
-- 
perl -wle'print"Κυστ αξοτθες Πεςμ Θαγλες"^"\x80"x24'


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

Date: 5 Jan 2001 00:50:04 GMT
From: bmetcalf@nortelnetworks.com (Brandon Metcalf)
Subject: Re: Getting the password hash (getpw* doesn't work)
Message-Id: <9335ns$9lg$1@bcarh8ab.ca.nortel.com>

ben-fuzzybear@geocities.com writes:

 > I'm trying to do password validation, and I can't seem to get the password 
 > hash out of "/etc/shadow" via any of the "getpw*" functions. I've looked 
 > at
 > 
 > perldoc -q shadow
 > perldoc -q password
 > perldoc perlfunc / search for "getpw", "crypt", "shadow"
 > 
 > The only (possibly) relevant bit I've found, in perlfunc, is 
 > 
 > "Shadow password files are only supported if your vendor has implemented
 > them in the intuitive fashion that calling the regular C library routines
 > gets the shadow versions if you're running under privilege.  Those that
 > incorrectly implement a separate library call are not supported."

 ...

 > perl -we 'print join(":",getpwuid($<))'
 > 
 > gives me
 > 
 > ben:x:1000:1000:::Benjamin Okopnik,,,:/home/ben:/bin/bash

In the excerpt that you provided from perlfunc it says "...gets the
shadow versions if you're running under privilege".  User ben with a uid
of 1000 is *not* privileged, so you won't get the shadow version.  Run
this as uid 0 and you do.

Brandon


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

Date: Thu, 4 Jan 2001 14:58:55 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Groovy non-profit needs CGI help
Message-Id: <9860-3A54E40F-56@storefull-247.iap.bryant.webtv.net>

Yes, education is obviously most important. Sadly, sports heroes set bad
examples for the most part. Exercise yes, but curriculum sports are a
joke. If schools worried more about education than sports, the student
body's IQ as a whole, would vastly improve.

If you're worried about learning team skills, try creating a Perl group
at your school in order to interact with fellow students. Had to get
Perl in this post somewhere :)

--Regards, Dennis



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

Date: Fri, 05 Jan 2001 00:12:23 GMT
From: Dave Brondsema <brondsem@my-deja.com>
Subject: Re: Groovy non-profit needs CGI help
Message-Id: <9333h0$aa7$1@nnrp1.deja.com>

In article <3A525193.F0852CFB@sports4kids.org>,
  Sports4Kids <office@sports4kids.org> wrote:
> Anyone out there interested in helping out a non-profit?
>
> www.sports4kids.org   (We work with elementary schools in low-income
> areas to offer youth sports and recreation)
>
> Check out the "Clearinghouse"  www.sports4kids.org/clearinghouse.html
>
> It has a little hiccup to it - it sends you to an old page which then
> works fine.  I'm hoping someone can help me eliminate that
intermediate
> hiccup.  I think it's relatively straight forward, but I am completely
> clueless when it comes to CGI stuff.
>
> Many thanks!
>
> Jonas
> Sports4Kids
>

This doesn't have to be a CGI change, unless you want it to.  Find a
website or book that covers HTML forms and you should be able to figure
this out.  Here's something to start with:

All the select boxes must have the same name as the ones used in the
old page.  Also, all the selection options must have values assigned to
them (the same as in the old page).  Finally, it looks like the search
program needs a signal to do the search, so place <input type=hidden
name=action value=search> inside your form.  It looks like you're using
a Netscape WYSIWYG editor, but it should have something to place a
hidden form element.

Hope this helps,

--
Dave Brondsema


Sent via Deja.com
http://www.deja.com/


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

Date: Thu, 04 Jan 2001 23:54:17 -0500
From: Dennis Marti <dennis_marti@yahoo.com>
Subject: Re: Help connection to mysql
Message-Id: <dennis_marti-BD1DCA.23541704012001@news.starpower.net>

In article <rsr75tcvnljaajp0h44u0pshmei71aq8do@4ax.com>, kf4dmb 
<kf4dmb@net-magic.net> wrote:

> I access the database , There are two Test Items in there , It sends
> out two Emails , But no data from the DB

>    foreach $row(@$array_ref){ 
>
> $tech = $row[7];

$row and @row are different.

use strict,

Dennis Marti


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 5255
**************************************


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