[17372] in Perl-Users-Digest
Perl-Users Digest, Issue: 4794 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 2 14:10:46 2000
Date: Thu, 2 Nov 2000 11:10:16 -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: <973192216-v9-i4794@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 2 Nov 2000 Volume: 9 Number: 4794
Today's topics:
Re: Perl Question <bart.lateur@skynet.be>
Re: Perl Question <ren.maddox@tivoli.com>
Re: Perl style and module searches (Tom Christiansen)
Re: Perl style and module searches <elaine@chaos.wustl.edu>
Problems executing Perl scripts in a shell <webm@minorisa.es>
Re: Problems executing Perl scripts in a shell <crowj@aol.com>
Re: Quick question - Still new at this ! (Tad McClellan)
Random name/number pepite@hotmail.com
Re: Random name/number (Tom Christiansen)
Re: regexp substitution help needed <ren.maddox@tivoli.com>
Re: regular expression <ren.maddox@tivoli.com>
script error <ksiddall@attcanada.net>
Segfaulting with profiler <fulko@wecan.com>
SQL::Statement and bison issues <bh_ent@my-deja.com>
Re: Stultiloquent Queries (was: even or odd?) <roman.stawski@fr.adp.com>
Re: Tad: i'm in 'use vars' hell <mcdonabNO@SPAMyahoo.com>
Re: Tad: i'm in 'use vars' hell (Tad McClellan)
Re: Unix authentication with an /etc/shadow file <ren.maddox@tivoli.com>
Re: Unix commands via perl? (Tad McClellan)
Re: Unix commands via perl? (Tom Christiansen)
Using Sendmail with CGI.pm <John.Beckwith@btinternet.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 02 Nov 2000 16:35:13 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Perl Question
Message-Id: <fk530t867ldfg4mhtcq85gcc2qgcen0t83@4ax.com>
James Taylor wrote:
>It's spooky to think that a choice of subject line could render my
>post invisible to a number of knowledgeable people. It feels like an
>indiscriminate censorship, or one might even go as far as to call it
>unfair discrimination.
No it's not. If you were not free to choose your subject line, then it
would be unacceptable discrimination.
Oh, to come back to your original question: I know nothing of Perl+Java,
but I think Larry Wall himself was paid to work on a Java/Perl
interface. You can look it up, somewhere at O'Reilly's website. And I
remember there was some project with a flower name, but I forgot which.
Maybe look around CPAN (<http://search.cpan.org>), and <www.perl.com>.
--
Bart.
------------------------------
Date: 02 Nov 2000 10:06:03 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Perl Question
Message-Id: <m3bsvy4avo.fsf@dhcp11-177.support.tivoli.com>
James Taylor <james@NOSPAM.demon.co.uk> writes:
> I tend to read most initial postings just to see if I can help, then
> ignore it until someone I respect answers to see if I understand the
> answer. So the "score" of the thread varies over time. I don't
> suppose these automatic scorefile systems can do that can they?
Actually, they probably can -- at least some of them. You could score
initial postings up (or follow-ups down) by keying off of the
References field. Combined with scoring up any posts from someone you
respect, this should give you what you want.
In fact, that's actually similar to what has happened for some people
on this thread. The subject itself garnered a relatively low score
and was, perhaps, not initially read. But then after respected people
started to follow-up to it, the resulting scores became high enough to
warrant attention.
> Getting even further off topic... I find myself going back to old
> threads that I evaluate to be more interesting suddenly. However my
> newsreader is not good at displaying old articles once I've marked
> them read. I was thinking of writing a Perl prog to use the message
> references stored in the news spool indexes to track a thread back to
> its root and display the articles in date order say. When following
> the thread back, should I just stack *all* the references of the
> article, find the articles referred to and stack *all* their references
> recursively, or is there a more intelligent way of doing this?
My newsreader, gnus, has two commands that I use for this. One pulls
up the parent article of the current article and the other pulls up
all articles in the current thread. Obviously, in both cases the
articles must still be available to be displayed.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 2 Nov 2000 08:16:15 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Perl style and module searches
Message-Id: <3a01853f@cs.colorado.edu>
In article <3A00BB1E.41FDF922@hotmail.com>,
Dave E <dave_at_hm@hotmail.com> wrote:
>I have 2 newbie questions:
Word to the wise: "newbie" is a severely negative flashword. In
fact, it's in my subject killfile. It's just a cutesie-tootsie way
for Muffy to expressie that she's a "beginner"--or, if you prefer
a fancier term, then I suppose a "neophyte".
>
>1) Is there a style, or "best practices" guide for Perl?
...
>Is there a good source for example scripts that I can look at?
>Something that says "this part is included because ..." I've found
>"perlstyle" that came with my install of Perl, but I'd really like some
>solid examples to look over.
Figure out an author whose code you trust, then seek out their code.
Use Deja News or CPAN to search for these.
And, as I trust myself to write clean code, at least when it's
destined for publication, I'd suggest looking at the code examples
from the Camel and the Ram. These are available in dead-tree form,
or if you prefer to grep them, then download from the O'Reilly
site. Start at http://perl.ora.com/, I imagine.
>2) Is there some searchable index for module capabilities?
> I noticed, in another message in this group, the "perldoc" search
>utility; very useful but I am looking for something more.
That leprous dinosaur, ponderously slow and severely unsafe, is
useful mainly for making sure that the ignorant remain that way.
>Is
>there some website (or place) that has a searchable list of modules --
>something that can search the "capabilities of" rather than
>the "name of." My last challenge was a good example. I wanted to look
>up the username of the account that had a particular
>NT SID. How was I suppose to know the Win32 module did this? (besides
>making an educated guess). Is there some place
>I could search for "NT and SID" and get a list of all the modules that
>do things with these?
Have you tried grepping the modules that you already have?
Why not? Do you know where you modules are? Do you know
how to look at a file?
Have you tried perlman --modules?
Have you tried http://search.cpan.org?
--tom
------------------------------
Date: Thu, 02 Nov 2000 17:43:26 GMT
From: "Elaine Ashton" <elaine@chaos.wustl.edu>
Subject: Re: Perl style and module searches
Message-Id: <2JhM5.13315$AM5.250505@news1.nokia.com>
"Tom Christiansen" <tchrist@perl.com> wrote in message
news:3a01853f@cs.colorado.edu...
> for Muffy to expressie that she's a "beginner"--or, if you prefer
> a fancier term, then I suppose a "neophyte".
Well, I suppose it's better than 'Perl Virgin seeks ....' or 'Virgin
desperately seeks....' as Muffy orders Virgin Mary's not Newbie Mary's,
etc. :)
> Have you tried perlman --modules?
> Have you tried http://search.cpan.org?
I've also been recommending http://www.perldoc.com/ and
http://perldoc.cpan.org/ lately. And, noone mentioned the scripts section
on CPAN which is somewhat moldery but there are still good examples of
code there that this person may find useful. Also, for the SA who needs
something useful, I will attest that the cookbook is a very useful
resource.
e.
------------------------------
Date: Thu, 02 Nov 2000 18:50:34 +0100
From: Josep =?iso-8859-1?Q?Mart=EDnez?= <webm@minorisa.es>
Subject: Problems executing Perl scripts in a shell
Message-Id: <3A01A96A.8EE4680@teleline.es>
Hi all!
I've made a perl script and I can only execute in that way:
$ perl script_name.pl
I put the 'x' permission to the perl and the header of the script
contain:
#!/usr/bin/perl
and I've checked that perl is in that directory.
I want to execute the script with
$ ./script_name.pl
How can I do that???
Thanks a lot.
If you could reply to the mail too.
------------------------------
Date: Thu, 02 Nov 2000 13:52:59 -0500
From: John Crowley <crowj@aol.com>
Subject: Re: Problems executing Perl scripts in a shell
Message-Id: <3A01B80B.F4561B1E@aol.com>
Josep Martínez wrote:
>
> Hi all!
>
> I've made a perl script and I can only execute in that way:
> $ perl script_name.pl
>
> I put the 'x' permission to the perl and the header of the script
> contain:
> #!/usr/bin/perl
> and I've checked that perl is in that directory.
>
> I want to execute the script with
> $ ./script_name.pl
> How can I do that???
> Thanks a lot.
>
> If you could reply to the mail too.
Does /usr/bin/perl exist? Try running "which perl", "whereis perl",
of "find / -name perl*" to see where perl is installed on your system.
------------------------------
Date: Thu, 2 Nov 2000 08:23:16 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Quick question - Still new at this !
Message-Id: <slrn902qm4.dst.tadmc@magna.metronet.com>
On Thu, 02 Nov 2000 07:08:27 GMT, msalerno@my-deja.com
<msalerno@my-deja.com> wrote:
>In article <8tnv4c$tke$1@nnrp1.deja.com>,
> msalerno@my-deja.com wrote:
>> Hi there, I am working on a script that will process ip addresses.
>I need a statement that will filter out any invalid characters from the
>octet. I want to allow only numbers between 1 and 255.
For that you _do_ need to split out the numbers so that
you can test them as numbers:
my @parts = split /\./, $ip;
die "dotted quad must have 4 'fields'" unless @parts == 4;
foreach my $i ( 0..3 ) {
print "'$ip' is invalid\n" unless $parts[$i] > 0 and $parts[$i] < 256;
}
>I want to throw
>an "Bad IP" if [a-zA-Z] and any other characters (like !@#$!%#^%)
>are given.
You have stated your requirement in a rather convoluted way.
Instead of saying what you don't want, try saying what you do want:
"IP must contain only digit and dot characters."
print "Bad IP\n" unless $ip =~ /^[\d.]+$/;
But you can write an even tighter restriction for the case of IPs, as below.
>I don't know how to add that to the unless statement.
The "standard idiom" for validating data is to anchor the beginning,
anchor the end, and write a pattern in between that accounts for
all allowable possibilities:
die "invalid IP" unless $ip =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\$/;
>Also,
>what would be the best way to state that 192.168.12.1. and
What is the basis for the invalidity of that one?
Looks like a dotted quad to me...
>192.168.12.1.122 are also invalid ?
See the die() above.
>Any additional tips are always
>appreciated.
You are still not using "use strict".
You should.
I have sorted resumes into the circular file for leaving off
warnings and strictures...
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 02 Nov 2000 16:00:10 GMT
From: pepite@hotmail.com
Subject: Random name/number
Message-Id: <8ts323$8g7$1@nnrp1.deja.com>
Can someone please tell me what the function to generate a random value
is ???
please reply to pepite@hotmail.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 2 Nov 2000 09:13:19 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Random name/number
Message-Id: <3a01929f@cs.colorado.edu>
In article <8ts323$8g7$1@nnrp1.deja.com>, <pepite@hotmail.com> wrote:
>Can someone please tell me what the function to generate a random value
>is ???
1) Go to Deja News and search for "random" in the *perl* newsgroups.
2) Go to Google and search for "perl random".
3) Search for the string "random" in your local Perl documentation
that's installed with Perl, particularly in the perlfunc manpage.
% perlhelp random
perl5004delta:would yield the same sequence of random numbers on most or all machines.
perl5005delta:Perl's signal handling is susceptible to random crashes, because signals
perlcall:a random order. The C<ST> macro as used when coding an XSUB is ideal
perldelta:=item Better pseudo-random number generator
perldelta:random(), and rand() (in that order) and picks the first one it finds.
perldelta:These changes should result in better random numbers from rand().
perldelta:=item Possibly changed pseudo-random number generator
perldelta:Perl programs that depend on reproducing a specific set of pseudo-random
perldelta:See L</"Better pseudo-random number generator">.
perldelta:random order encountered when iterating on the contents of a hash
perldelta:in the algorithm may yield a random order that is B<different> from
perldiag:before this, because Perl is good at understanding random input.
perlfaq:=item * Why aren't my random numbers random?
perlfaq:=item * How do I select a random element from an array?
perlfaq:=item * How do I select a random line from a file?
perlfaq4:=head2 Why aren't my random numbers random?
perlfaq4:once at the start of your program to seed the random number generator.
perlfaq4:call C<srand> more than once--you make your numbers less random, rather
perlfaq4:Computers are good at being predictable and bad at being random
perlfaq4:http://www.perl.com/CPAN/doc/FMTEYEWTK/random, courtesy of Tom
perlfaq4:attempts to generate random numbers by deterministic means is, of
perlfaq4:If you want numbers that are more random than C<rand> with C<srand>
perlfaq4:random numbers, but this takes quite a while. If you want a better
perlfaq4: # generate a random permutation of @array in place
perlfaq4:=head2 How do I select a random element from an array?
perlfaq5:only to stroke the writer's vanity. Better to pick a random number.
perlfaq5:=head2 How do I select a random line from a file?
perlfaq7:If you're just a random program, you can do this to find
perlfaq9:random one) for later processing. In the mail you send, ask them to
perlfunc:exotic implementations. When choosing a new salt create a random two
perlfunc:Entries are returned in an apparently random order. The actual random
perlfunc:an apparently random order. The actual random order is subject to
perlfunc:Returns a random fractional number greater than or equal to C<0> and less
perlfunc: printf "bits are %*vb\n", " ", $bits; # random bitstring
perlfunc:Sets the random number seed for the C<rand> operator. If EXPR is
perlfunc:omitted, uses a semi-random value supplied by the kernel (if it supports
perlfunc:Note that you need something much more random than the default seed for
perlfunc:top of your program, or you I<won't> get random numbers out of C<rand>!
perlfunc:returned in an apparently random order. The actual random order is
perlhack:than does a random feature request, no matter how fervently argued the
perlipc:standard file descriptors from and to F</dev/null> (so that random
perlipc: $port = shift || 2345; # random port
perlos2:a (pretty random) benchmark showed that Perl one is 5% better.
perltodo: % perl -help random stuff
perltodo: No documentation for perl function `random stuff' found
perltodo: The following entry in perlfunc.pod matches /random/a:
perltodo: Returns a random fractional number greater than or equal to C<0> and less
--tom
------------------------------
Date: 02 Nov 2000 09:50:22 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: regexp substitution help needed
Message-Id: <m3g0la4blt.fsf@dhcp11-177.support.tivoli.com>
Bart Lateur <bart.lateur@skynet.be> writes:
> Ren Maddox wrote:
>
> >> s/[\w'-]+/ TEXT /gis;
> >> will substitute TEXT for all words including TAG;
> >> Can I get this to substitute all words in the text except for the
> >> word TAG.
> >
> >s/\b(?!TAG)[\w'-]+/TEXT/g;
> >
> >You apparently want to include ' and - as part of a word, so I have
> >done the same.
>
> What do you have against "TAGGY"? I think that in your lookahead, you
> want to test for word boundaries too.
Oops...
> s/\b(?!TAG\b)[\w'-]+/TEXT/g;
>
> That still will exclude
>
> TAG'O'GRAM
>
> which is a "word" according to the OP's definition. And you can't put
> lookahead inside lookahead, AFAIK.
>
> s/\b(?!TAG(?:[^\w'-]|$))[\w'-]+/TEXT/g;
>
> Er... clumsy, innit?
Yeah... given the requirement, I would switch tactics and use:
s/([\w'-]+)/uc $1 eq "TAG" ? "TAG" : "TEXT"/eg;
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 02 Nov 2000 10:33:15 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: regular expression
Message-Id: <m33dha49mc.fsf@dhcp11-177.support.tivoli.com>
Bart Lateur <bart.lateur@skynet.be> writes:
> Tad McClellan wrote:
>
> >Doubling backslashes in single quoted strings is useless,
> >so why do it?
>
> I wouldn't dare to call it useless.
>
> $_ = 'string\with\a\backslash\'oops!';
How does this demonstrate your assertion? AFAIK, the only useful
doubling of a backslash in a single-quoted string is when you want the
string to end with a backslash:
$_ = 'only\the\last\'one\needs\to\be\doubled\\';
> You don't always need backslashes in qingle quotish strings, that's
> true. But simply forgetting about it is dangerous. You'd end up thinking
> that '\\' is two backslahes.
>
> Therefore, I always double all backslashes.
What? If you always double them you are just as likely to forget how
they *really* work and, as you've already stated, that is dangerous.
Oh -- you mean you always double then when you want a literal
backslash to appear in the string.
It seems like a problem either way. If you use '\\n', that might lead
someone reading it (including yourself) to make the mistaken
assumption that '\n' is a newline. On the other hand, if you use
'\n', that same someone might simply think it *is* a newline.
Given that they are both problematic, it seems like this falls into
the group of things where extra unnecessary symbols cause people to
stop and wonder if something extra is going on. Kind of like when
people use double quotes around a single scalar.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 2 Nov 2000 08:01:12 -0800
From: "munch" <ksiddall@attcanada.net>
Subject: script error
Message-Id: <gdgM5.84283$YG5.64199@tor-nn1.netcom.ca>
I am using a search script from http://www.kscripts.com and running into
errors. I run the indexer.pl file and at times it becomes quite large but
does not seem to save to the site. Yep, I am a newbie to cgi :-)
I changed FTP programs and uploaded the files as per the author's
directions:
package includes file name set permissions
indexer script: indexer.pl read/exec
search script: ksearch.cgi read/exec
example search form: search_form.html read
search tips page: help.html read
configuration file: configuration/configuration.pl read
ignore files list: configuration/ignore_files.txt read
stop terms list: configuration/stop_terms.txt read
HTML template: templates/search.html read
database directory: database/ read
(For Unix users) (type at command line) (type 'ls -l' for file
list)
read/exec 'chmod 755 filename' -rwxr-xr-x
read 'chmod 744 filename' -rwxr--r--
When I try to indesex.pl it times out. I am also receiving the follow error:
Software error:
Cannot open /usr/home/v1/a0000466/html/cgi-bin/ksearch/database/files:
Inappropriate file type or format at ksearch.cgi line 72.
What am I doing wrong this time?
Thanks,
Kathy
------------------------------
Date: Thu, 02 Nov 2000 12:06:31 -0500
From: Fulko Hew <fulko@wecan.com>
Subject: Segfaulting with profiler
Message-Id: <3A019F17.41C6@wecan.com>
I was trying to figure out another problem using the profiler -d:DProf
when my application started to fail. The application is actually a
client/server kind of thing with TCP between them.
I run the server without the profiler.
When I run the client without the profiler, the server runs just fine.
When I run the client WITH the profiler, the server segfaults.
I also get the following:
Attempt to free temp prematurely: SV 0x82b57fc at ./blob line 607.
Attempt to free unreferenced scalar at ./blob line 607.
The description of both errors, basicaly say that something was freed
(or attempted)
that shouldn't have been. But what is causing it. Is it my code... is
it perl...
The server code (snippit) is (line 607 is the accept() line):
while (1) {
while ($client = $server->accept()) {
next if ($pid = fork);
die "fork failed: $!" unless defined $pid;
# child continues here
close $server; # child doesn't need
this socket anymore
# ... do child
processing
$self->{_socket} = $client;
#my $other_end = getpeername($client);
my ($rp, $ra) = unpack_sockaddr_in(getpeername($client));
($self->{_remote_host}, $self->{_remote_port}) =
(inet_ntoa($ra), $rp);
while (1) {
&$server_fnc($self); # call the users
function to do their work
foreach (@advertizers) { # now that they are
done, we can
kill USR1 => $_; # signal the
advertizer that the transaction has completed
}
exit;
}
} continue {
close $client;
}
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=linux, osvers=2.2.12-20, archname=i586-linux
uname='linux fulko3 2.2.12-20 #1 mon sep 27 10:25:54 edt 1999 i586
unknown '
config_args='-Doptimize=-g -Dccflags=-DDEBUGGING'
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
Compiler:
cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release)
cppflags='-DDEBUGGING'
ccflags ='-DDEBUGGING'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=/lib/libc-2.1.2.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: DEBUGGING USE_LARGE_FILES
Built under linux
Compiled at Nov 1 2000 14:32:52
@INC:
/usr/local/lib/perl5/5.6.0/i586-linux
/usr/local/lib/perl5/5.6.0
/usr/local/lib/perl5/site_perl/5.6.0/i586-linux
/usr/local/lib/perl5/site_perl/5.6.0
/usr/local/lib/perl5/site_perl
-------------------------------------------------------------------------------
Fulko Hew, Voice: 905-333-6000 x 6010
Senior Engineering Designer, Direct: 905-333-6010
Northrop Grumman-Canada, Ltd. Fax: 905-333-6050
777 Walkers Line, Home: fulko%fkhew@wecan.com
Burlington, Ontario, Canada, L7N 2G1 Work: fulko@wecan.com
------------------------------
Date: Thu, 02 Nov 2000 16:38:38 GMT
From: Drew Myers <bh_ent@my-deja.com>
Subject: SQL::Statement and bison issues
Message-Id: <8ts5ad$ad9$1@nnrp1.deja.com>
I am attempting to install the SQL::Statement module on my hp box with
little success. I keep getting an error which states that bison is not
found. Do I have to have bison to compile this module? I do not find
any statement of that anywhere in any documentation, but that is the
way things appear. Can I use yacc instead?
Eternally stumped,
--
Drew Myers
perotsystems
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 02 Nov 2000 15:16:17 +0100
From: Roman Stawski <roman.stawski@fr.adp.com>
Subject: Re: Stultiloquent Queries (was: even or odd?)
Message-Id: <3A017731.DC94CF13@fr.adp.com>
Gwyn Judd wrote:
>
> How do you tell if a number is even or odd again?
Well if it was odd once, it should certainly be odd again...
--
Roman Stawski - ADPgsi
------------------------------
Date: Thu, 2 Nov 2000 09:40:54 -0800
From: "Brian McDonald" <mcdonabNO@SPAMyahoo.com>
Subject: Re: Tad: i'm in 'use vars' hell
Message-Id: <pIhM5.14$et1.19063@news.pacbell.net>
>>what is the preferred perl solution to this problem?
>The preferred _perl_ solution (as opposed to a Perl
>solution) is obviously to use a hash, because that _is_
> what perl (the interpreter) uses :-)
>
>If you have globals, then they _will_ be in a hash. They
>can be in perl's hash or your own hash, but they're gonna
>be in a hash somewhere.
>
>But "perl's hash" can get accessed in funky ways (eg.
>sym refs). It's safer to have your own hash where
>only "normal" hash access can happen.
>
>Read up on "perl's hash" if you like. See the "Symbol
>Tables" section in perlmod.pod.
[This is a message for Tad... and it is posted here because something
strange has happened with the Pacbell news server]
Thanks, Tad, for turning one of the basement lights on.
Brian
------------------------------
Date: Thu, 2 Nov 2000 12:26:12 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Tad: i'm in 'use vars' hell
Message-Id: <slrn9038tk.evs.tadmc@magna.metronet.com>
On Thu, 2 Nov 2000 09:40:54 -0800, Brian McDonald
<mcdonabNO@SPAMyahoo.com> wrote:
>
>>>what is the preferred perl solution to this problem?
[ "this problem" was how to handle global variables, I think ]
>>But "perl's hash" can get accessed in funky ways (eg.
>>sym refs). It's safer to have your own hash where
>>only "normal" hash access can happen.
One more advantage to using one global hash to contain what
would otherwise be global variables, is that you can tie()
the hash for debugging, and intercept all changes to all
global variables.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 02 Nov 2000 10:19:57 -0600
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Unix authentication with an /etc/shadow file
Message-Id: <m37l6m4a8i.fsf@dhcp11-177.support.tivoli.com>
"Che Gonzalez" <guess@where.com> writes:
> WIthout using the Authen module is there any way to authenticate a user in
> BSD | Linux that uses a /etc/shadow file. Also, no greping or reading
> /etc/shadow. Any alternatives?
If you don't have access to /etc/shadow, then you're not going to be
able to validate against the passwds stored there. That's pretty much
the point.
The alternatives are:
1. Request a passwd validation mechanism from you Admins (mentioning
"Single Sign-On" may help).
2. Keep your own password data.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 2 Nov 2000 08:24:42 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Unix commands via perl?
Message-Id: <slrn902qoq.dst.tadmc@magna.metronet.com>
On Thu, 02 Nov 2000 11:32:03 GMT, Dave <dave@;so-.mail> wrote:
>Is it possible to use all unix commands via perl ?
Yes.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 2 Nov 2000 07:36:03 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Unix commands via perl?
Message-Id: <3a017bd3$1@cs.colorado.edu>
In article <3a01504b.8185466@news.redhotant.com>, Dave <dave@;so-.mail> wrote:
>Is it possible to use all unix commands via perl ?
>
>e.g. rm with a switch -
>
>rm -s something ?
How many licks does it take to get to the center of a tootsie pop?
--tom
------------------------------
Date: Thu, 2 Nov 2000 16:17:02 -0000
From: "John Beckwith" <John.Beckwith@btinternet.com>
Subject: Using Sendmail with CGI.pm
Message-Id: <8ts3i1$b7u$1@newstoo.ericsson.se>
Hi there,
I am quite new to perl, but am aware that it is the best way forward, when
dealing with CGI and web constructs.
I have set up a cgi script using cgi.pm library.
I would like to be able to receive the query from the previous 'query
form' - which is currently fine and I can display the query items to the web
page.
Now I would like to (via sendmail) email the results to the webmaster
account.
Has anybody got a good procedure for this operation?
Many thanks in advance,
Johnb.
------------------------------
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 4794
**************************************