[12296] in Perl-Users-Digest
Perl-Users Digest, Issue: 5896 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 5 05:07:26 1999
Date: Sat, 5 Jun 99 02:00:20 -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 Sat, 5 Jun 1999 Volume: 8 Number: 5896
Today's topics:
*****Learn PERL***** (IlIIIIIIII)
Re: Anyone know what is this script line meaning ?? (kevin)
C-style bit structures in perl? <dpodbori@email.msn.com>
Re: C-style bit structures in perl? <rootbeer@redcat.com>
Re: C-style bit structures in perl? <uri@sysarch.com>
Re: DBI vs ODBC?? <REMOVENOSPAMwmtoh@singnet.com.sg>
Re: Executing adduser? Follow Up. <hasant@trabas.co.id>
Re: Executing adduser? Follow Up. <hasant@trabas.co.id>
Re: Executing adduser? Follow Up. <rootbeer@redcat.com>
Re: FAQ 5.22: How do I set a file's timestamp in perl? (Larry Rosler)
HELP!!! (Tom)
Re: HELP!!! <rootbeer@redcat.com>
how do i fucking run perl w32 <spm5@acpub.duke.edu>
Re: how do i fucking run perl w32 <xxx@yyy.com>
Re: how do i fucking run perl w32 (Michel Dalle)
Is perl useful for me? <pdasilvaX@esotericaX.ptX>
Re: Is perl useful for me? <jll@skynet.be>
Re: know Perl to maintain Perl <rootbeer@redcat.com>
Re: Lynx and Perl (Tad McClellan)
Re: mail problems... still :) (Abigail)
Re: mail problems... still :) <gellyfish@gellyfish.com>
Re: Problem copying file <gellyfish@gellyfish.com>
Re: replacing a word in a flat file <hasant@trabas.co.id>
Re: Results not displaying. <gellyfish@gellyfish.com>
Re: Simple newbie question... <hasant@trabas.co.id>
Re: Simple question about hashes (Andrew Johnson)
Using Or to evaluate multiple values <johnsmith@microsoft.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Jun 1999 05:33:24 GMT
From: iliiiiiiii@aol.com (IlIIIIIIII)
Subject: *****Learn PERL*****
Message-Id: <19990605013324.18338.00000753@ng66.aol.com>
learn perl for free at http://illogic.cjb.net
------------------------------
Date: Sat, 05 Jun 1999 08:09:49 GMT
From: kevin@nospam.co.uk (kevin)
Subject: Re: Anyone know what is this script line meaning ??
Message-Id: <3758da1a.568225@news.free-online.net>
On Mon, 31 May 1999 07:59:47 GMT, an opinion was expressed by
tvn007@my-deja.com stating:
>Be Kind to others please
>
>You do not have to reply to him/her with such answer.
>
Do you know what, some (not all) of the posters i have seen
in this ng, are IMO at times real ignorant. Much more so than any
other programming related ng i have personally seen.
How many times have you seen: 'read the manual' 'read a book'
etc.
Basically is what some people are really saying is why bother with
ng's when there are books?
Kevin
------------------------------
Date: Sat, 5 Jun 1999 01:20:47 -0400
From: "Dmitry P." <dpodbori@email.msn.com>
Subject: C-style bit structures in perl?
Message-Id: <OQRWOKxr#GA.274@cpmsnbbsa03>
Hi,
I am looking for an easy and efficient way to simulate C-style bit
structures as in:
struct MyStruct { unsighed int a : 3;
unsigned int b : 4;
unsigned int c : 1;
} s1;
The C way of assigning and reading a bit struct as
unsigned int g;
.......
s1.b = g;
.......
unsigned int d = s1.b;
-- is more attractive (and efficient) than
$s1 = 0xF1 | ( $g << 1 );
$d = ( $s1 & 0xF ) >> 1;
But is there a better way?
Thanks.
------------------------------
Date: Fri, 4 Jun 1999 22:27:19 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: C-style bit structures in perl?
Message-Id: <Pine.GSO.4.02A.9906042225450.5411-100000@user2.teleport.com>
On Sat, 5 Jun 1999, Dmitry P. wrote:
> I am looking for an easy and efficient way to simulate C-style bit
> structures
I think you will end up using pack/unpack. Although you may find doing so
to be neither easy nor efficient. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 05 Jun 1999 01:48:00 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: C-style bit structures in perl?
Message-Id: <x7pv3b8agf.fsf@home.sysarch.com>
>>>>> "TP" == Tom Phoenix <rootbeer@redcat.com> writes:
TP> On Sat, 5 Jun 1999, Dmitry P. wrote:
>> I am looking for an easy and efficient way to simulate C-style bit
>> structures
TP> I think you will end up using pack/unpack. Although you may find doing so
TP> to be neither easy nor efficient. :-)
also look at vec which can do bit twiddling but only on powers of 2 bit
alignments.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Sun, 6 Jun 1999 13:14:39 +0800
From: "Luke" <REMOVENOSPAMwmtoh@singnet.com.sg>
Subject: Re: DBI vs ODBC??
Message-Id: <7jacc5$5pe$1@clematis.singnet.com.sg>
Thanks!! Will do!
Luke
> type) than to use Win32::ODBC, then find out about DBI, then spend three
> hours or so re-writing and restructuring your fetches, dos, prepares and
> everything else, trust me, I did it ;-).
> use DBI; !
>
> Richard H
------------------------------
Date: Sat, 5 Jun 1999 09:50:29 +0700 (JAVT)
From: Hasanuddin Tamir <hasant@trabas.co.id>
To: comp.lang.perl.misc@list.deja.com
Subject: Re: Executing adduser? Follow Up.
Message-Id: <Pine.LNX.3.96.990605094614.12118B-100000@borg.intern.trabas.co.id>
On Fri, 4 Jun 1999, Tom Phoenix wrote:
rootbeer] Date: Fri, 4 Jun 1999 11:33:16 -0700
rootbeer] From: Tom Phoenix <rootbeer@redcat.com>
rootbeer] To: comp.lang.perl.misc@list.deja.com
rootbeer] Subject: Re: Executing adduser? Follow Up.
rootbeer] Reply-To: comp.lang.perl.misc@list.deja.com
rootbeer] Organization: Society for the Elimination of Unwarranted Excess Superfluous Text in Internet Header Lines
rootbeer]
rootbeer] while (<FILE>) {
rootbeer] chomp;
rootbeer] s/#.*//; # Drop comments
rootbeer] s/^\s+//; # Drop leading whitespace
rootbeer] s/\s+$//; # and trailing
rootbeer] next unless /\S/; # Skip blank lines
Just a bit curious, would it make different if
skipping before chomp()-ing? I mean, why we
chomp() on blank lines? Or why we chomp() on
lines we want to skip?
-hasan-
uhm, no more sig(h)
------------------------------
Date: Sat, 5 Jun 1999 09:45:08 +0700 (JAVT)
From: Hasanuddin Tamir <hasant@trabas.co.id>
To: comp.lang.perl.misc@list.deja.com
Subject: Re: Executing adduser? Follow Up.
Message-Id: <Pine.LNX.3.96.990605092419.12118A-100000@borg.intern.trabas.co.id>
On 4 Jun 1999, Vincent Ridderikhoff wrote:
madvin] Date: 4 Jun 1999 17:22:21 GMT
madvin] From: Vincent Ridderikhoff <madvin@dds.nl>
madvin] To: comp.lang.perl.misc@list.deja.com
madvin] Subject: Re: Executing adduser? Follow Up.
madvin] Reply-To: comp.lang.perl.misc@list.deja.com
madvin] Organization: EuroNet Internet
madvin]
madvin]
madvin] $pass = "test";
madvin] $user = "bladie";
madvin] $command = ("useradd");
madvin] @args =
madvin] ($command,"-g","ftp","-d","/home/",$user,"-s","/bin/ftponly","-p",$pass,$user);
^^^^^^^^ ^^^^^
madvin] #Here it goes wrong, somehow the first $user becomes empty and the last
madvin] $user keeps it's value.
madvin] #so in the passwd file it shows the following:
madvin] #bladie:x:1000:400::/home/:/bin/ftponly
If my guess is correct, I think you wanted to assign the
new user a home directory by setting switch -d to "/home/",$user ?
Well, if this is the case, it's not "becomes empty", rather,
it's "never there".
What you might want is: -d "/home/$user"
And what if you make your argument a bit clear
(at least for yourself) like:
my @args = (
'-g' => 'ftp', ## group
'-d' => "/home/$user", ## home directory
'-s' => '/bin/ftponly', ## shell
'-p' => $pass, ## password
'-c' => qq("$user $user"), ## gecos, only if you want it
);
system $command, @args, $user;
if ($?) {
# error occures, want to die?
}
madvin] #@args =
madvin] ($command,"-g","ftp","-d","/home/",$user,'/./',"-s","/bin/ftponly","-p",$pass,$user);
What's the '/./' for?
madvin] #Also when I use this it goes wrong completely on the '/./' part I
madvin] also tried replacing the ' with " .
Double quote only matters (well, mostly) when you
want to interpolate variables.
And Tom Phoenix has shown you how to parse the source
file. You may want to stick with that.
HTH,
-hasan-
uhm, no more sig(h)
------------------------------
Date: Fri, 4 Jun 1999 22:55:50 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Executing adduser? Follow Up.
Message-Id: <Pine.GSO.4.02A.9906042245560.5411-100000@user2.teleport.com>
On Sat, 5 Jun 1999, Hasanuddin Tamir wrote:
> rootbeer] while (<FILE>) {
> rootbeer] chomp;
> rootbeer] s/#.*//; # Drop comments
> rootbeer] s/^\s+//; # Drop leading whitespace
> rootbeer] s/\s+$//; # and trailing
> rootbeer] next unless /\S/; # Skip blank lines
> Just a bit curious, would it make different if skipping before
> chomp()-ing? I mean, why we chomp() on blank lines? Or why we chomp()
> on lines we want to skip?
chomp was included merely by habit. In fact, if you don't chomp, the
newline is removed with the other trailing whitespace, so it's completely
unnecessary. There's no significant difference in efficiency, though,
since the I/O overhead is so large. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 4 Jun 1999 23:35:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: FAQ 5.22: How do I set a file's timestamp in perl?
Message-Id: <MPG.11c264ee8f4c8675989b74@nntp.hpl.hp.com>
In article <3758b443@cs.colorado.edu> on 4 Jun 1999 23:23:15 -0700, Tom
Christiansen <perlfaq-suggestions@perl.com> says...
...
> Note that utime() currently doesn't work correctly with Win95/NT
> ports. A bug has been reported. Check it carefully before using it
> on those platforms.
Is this current information? I have used utime() on Windows NT without
any problems for about a year (ActiveState perl).
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 04 Jun 1999 19:02:14 GMT
From: sorry@no.mail (Tom)
Subject: HELP!!!
Message-Id: <375a20e8.8228002@news.brainlink.com>
In my script there is a line that make error ONLY when I'm using "use strict"
directive. I'm pretty sure that that this line should not make any errors in
other cases. Here it is:
my @saltchars = (a..z,A..Z,0..9);
How should I modify this line to make it work with "use strict" directive?
Please help!
------------------------------
Date: Sat, 5 Jun 1999 00:47:00 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: HELP!!!
Message-Id: <Pine.GSO.4.02A.9906050044290.25426-100000@user2.teleport.com>
On Fri, 4 Jun 1999, Tom wrote:
> Subject: HELP!!!
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> In my script there is a line that make error ONLY when I'm using "use
> strict" directive. I'm pretty sure that that this line should not make
> any errors in other cases. Here it is:
>
> my @saltchars = (a..z,A..Z,0..9);
>
> How should I modify this line to make it work with "use strict"
> directive?
The manpage for the strict pragma should make this clear. Did you see it?
You need to quote the barewords to make that line compliant. And you
didn't ask, but of course a set of salt characters traditionally holds 64
different characters. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sat, 5 Jun 1999 02:32:57 -0400
From: "Marler" <spm5@acpub.duke.edu>
Subject: how do i fucking run perl w32
Message-Id: <7jag8b$fi3$1@news.duke.edu>
i just got ActivePerl517. when i run any of the sample scripts, the dos
window opens quickly then closes. i don't know what the programs do or how
to run my own programs. can somebody help me please.
sincerely,
stephen marler
------------------------------
Date: Sat, 5 Jun 1999 00:25:33 -0700
From: "Lauren" <xxx@yyy.com>
Subject: Re: how do i fucking run perl w32
Message-Id: <7jajfj$otc$1@nntp2.atl.mindspring.net>
Marler <spm5@acpub.duke.edu> wrote in message
news:7jag8b$fi3$1@news.duke.edu...
> i just got ActivePerl517. when i run any of the sample scripts, the dos
> window opens quickly then closes. i don't know what the programs do or how
> to run my own programs. can somebody help me please.
>
Well, you must be using Windows 95/98 to be getting this problem.
ActivePerl is supported by the ActiveX API, which as we all know is only
supported on NT. Win95/98 supports DirectX, though, so you might want to
look for the DirectPerl version. This makes sense why you would only see
the DOS window pop up when running the scripts, in NT everything is
essentially command line based, whereas 95/98 are GUI based (hence DirectX's
graphics library).
There are several books on learning Perl, not the least of which is
"Learning Perl on Win32 Systems". Programming Perl is also a good book, if
you fancy yourself a decent programmer.
> sincerely,
> stephen marler
HTH,
Lauren
------------------------------
Date: Sat, 05 Jun 1999 07:54:11 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: how do i fucking run perl w32
Message-Id: <7jal1g$i5o$1@xenon.inbe.net>
In article <7jajfj$otc$1@nntp2.atl.mindspring.net>, "Lauren" <xxx@yyy.com> wrote:
>
>Marler <spm5@acpub.duke.edu> wrote in message
>news:7jag8b$fi3$1@news.duke.edu...
>> i just got ActivePerl517. when i run any of the sample scripts, the dos
>> window opens quickly then closes. i don't know what the programs do or how
>> to run my own programs. can somebody help me please.
>>
[misdirection snipped]
1) Open a DOS box, and then type (yes, I know you prefer clicking) :
perl myscript.pl
2) See the results.
3) Close the DOS box when you're finished
This is what Windows does too when you click on a .pl file, if .pl is
associated with perl. But it may be going too fast for you to follow... :-)
>There are several books on learning Perl, not the least of which is
>"Learning Perl on Win32 Systems". Programming Perl is also a good book, if
>you fancy yourself a decent programmer.
Hint : read the f*cking manual that comes with ActivePerl too.
Michel.
------------------------------
Date: Sat, 05 Jun 1999 03:22:39 +0000
From: Paulo da Silva <pdasilvaX@esotericaX.ptX>
Subject: Is perl useful for me?
Message-Id: <375897FF.360621E7@esotericaX.ptX>
I'm considering learning perl, but only if GUIs are
supported. Would anyone pls, tell me if GUI interfaces
are possible with "pure" perl and how easy (or difficult)
it is to build a GUI.
TIA
--
Please remove the anti-spam Xs from my email address.
PF. retirar os Xs anti-spam do meu endereco de email.
------------------------------
Date: Sat, 05 Jun 1999 09:43:27 +0200
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: Is perl useful for me?
Message-Id: <VA.00000324.002fd1c8@enterprise>
In article <375897FF.360621E7@esotericaX.ptX>, Paulo da Silva wrote:
> I'm considering learning perl, but only if GUIs are
> supported. Would anyone pls, tell me if GUI interfaces
> are possible with "pure" perl and how easy (or difficult)
> it is to build a GUI.
It's easy to build GUIs with Perl/Tk and it's hard to make them NON-portable
between Win32 and Unix :)
Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy/
------------------------------
Date: Fri, 4 Jun 1999 22:24:18 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: know Perl to maintain Perl
Message-Id: <Pine.GSO.4.02A.9906042159480.5411-100000@user2.teleport.com>
On Sat, 5 Jun 1999, Ronald J Kimball wrote:
> How much Perl does someone have to know before they're
> allowed to use it?
This debate seems have reached the point of "tastes great" vs. "less
filling". At the risk of making a long and painful discussion even more
so.... :-)
I think a useful analogy might be made between a maintenance programmer
fixing up a program and an art restorer retouching a damaged painting. The
art restorer needn't be so skilled as the original artist, but can't be a
complete tyro either. Similarly, the maintenance programmer needn't know
everything about Perl, but does need to know enough to see what's going
on.
If two ways of coding are equally good in all respects except that one is
more likely to be correctly understood and maintained by the maintenance
programmer, certainly that's the better choice. But often one makes a
tradeoff, giving up some small amount of maintainability in order to make
gains in (some form of) efficiency.
Here's an everyday example:
use Some::Module qw(defrotz);
versus
use Some::Module 'defrotz';
Those two are effectively equivalent, but the first one is a little harder
to write and (infinitesimally) less efficient. Its advantage is that it's
easier to maintain, so (because this line of code is relatively likely to
need maintenance) it's the preferred choice.
OTOH, consider the Schwartzian Transform. It could be written as three (or
more) steps of building up a list of arrayrefs, sorting them, and reducing
them to a sorted list. Or it can be written in the more confusing, but
much more efficient method of map/sort/map. The latter is always
preferred, partly because the structure of the ST itself doesn't often
need to be changed during maintenance.
So, in conclusion, you're both right. It's a floor wax _and_ a dessert
topping. It tastes great _and_ it's less filling. It's best to optimize
for maintainability _and_ for efficiency.
We now return you to your regularly scheduled programming.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 4 Jun 1999 21:34:18 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Lynx and Perl
Message-Id: <qqu9j7.7lk.ln@magna.metronet.com>
CWK (colt@internet.net) wrote:
: I would like to write a perl program to make use of Lynx to get files from
: another site. How can I redirect the output
: from the Lynx program, but not by writing to a file at first, to achieve
: this?
: I've tried the following with NO success:-
: @!/usr/bin/perl
: ........
: 'lynx http://www.abc.def/~xyz/file'
You are using the wrong quote characters.
They are easy to overlook. So easy in fact, that I never
use them. I use the below form instead (which is described
in perlop.pod
qx(lynx http://www.abc.def/~xyz/file);
But you should probably be using the LWP modules for
fetching web pages anyway.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 3 Jun 1999 21:46:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: mail problems... still :)
Message-Id: <slrn7left0.im9.abigail@alexandra.delanet.com>
Bastiaan S van den Berg (office@asc.nl) wrote on MMCII September MCMXCIII
in <URL:news:7j64qc$qmm$1@zonnetje.NL.net>:
__
__ i've got this program running like a breeze now , but unfortunately , i
__ can't seem to recieve mail from it..
__
__
__ $sendmail = "\usr\bin\sendmail"
Besides a missing ;, consider:
perl -wle 'print "\usr\bin\sendmail"'
Sinsendmail
__ close(MAIL);
You never checked the return value of close.....
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 4 Jun 1999 20:15:52 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: mail problems... still :)
Message-Id: <7j9c5o$2fd$1@gellyfish.btinternet.com>
On Fri, 4 Jun 1999 08:32:12 +0200 Bastiaan S van den Berg wrote:
> I Said:
>
>>You also appear to have ignored everything else I said about your program
>>yesterday - so I think I'll just ignore your questions in future.
>
>
> yeah , you said : 'read this , that , goto this site and read more'
>
> nothing else..
>
>
I dont think so :
>From gellyfish@gellyfish.com Fri Jun 4 20:06:57 1999
Subject: Re: req: sendmail specs
Newsgroups: comp.lang.perl.misc
Message-ID: <37554cbf@newsread3.dircon.co.uk>
Date: 2 Jun 1999 16:24:47 +0100
Bastiaan S van den Berg <office@asc.nl> wrote:
> does anyone know a site to , or information about handling the
> /usr/lib/sendmail program?
>
man sendmail
Or failing that comp.mail.sendmail or better the FAQ at:
<http://www.sendmail.org/faq/>
> i'm trying to send mail from a perl program with the following commands ,
> does anyone have an idea why it won't send mail?
>
> -[= code following =]-
>
> open (MAIL, "|$sendmail -t > /dev/null 2>&1") || die ("Content-Type:
> text/html \n\n<html><head>Error opening pipe to $sendMAIL:
> $!\n</body></html>\n");
> print MAIL ("To: office\@asc.nl , $email \n","Subject: [Site]
> Contactformulier. \n");
> print MAIL"\n\n";
> if ($bedrijf ne "") {print MAIL "Bedrijf : $bedrijf\n";}
> /snip/
> .
> .
> /snip/
> close(MAIL);
>
For starters here there is no point doing what you are doing in your
die - because this will go to your error_log and not get to the users
browser - you should read perlfaq9 on how to get messages to the browser.
Secondly I dont think you want all those brackets there - why dont you
try a here document:
print MAIL <<EOMAIL;
To: office\@asc.nl, $email
Subject: [Site] Contactformulier
Body text here
EOMAIL
Thirdly you will probably want to check the return of the close - because
the open will only fail if the fork() failed - an other error with
sendmail will not be reported until the close().
...
>
> "why are all perl monglers either young kids or grumpy old men?" , my
> girlfriend , 7am this morning
>
>
A) I wouldnt consider myself to be either of those things
B) Whats a mongler ?
C) Please attribute the message you are quoting ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 4 Jun 1999 20:34:35 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problem copying file
Message-Id: <7j9d8r$2g2$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Scott Wells <shadowsystems@ibm.net> wrote:
> I wrote a perl script on an OpenBSD machine to update a DNS zone file.
> Update goes fine, but no matter what I do, when it's called by Apache it
> won't copy back to the /var/named directory. The script has suid
> permissions set, and is owned by named. /var/named is owned by named,
> as well as is the file I'm tryng to put there. The command I'm trying
> is:
>
> system("cp /tmp/zone.file /var/named/my.zone");
>
As an aside - you might consider using the module File::Copy to do that.
> Whenever I run this script from the shell prompt, it works fine (as root
> or named). I am using Apache 1.3.6.
>
You should read the perlsec manpage to find out about the issues surrounding
setuid scripts. It is probable that when perl was built on your system
- the question
Do you want to do setuid/setgid emulation?
was answered 'no'. You will, most likely, need to reconfigure and rebuild.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 5 Jun 1999 10:41:17 +0700 (JAVT)
From: Hasanuddin Tamir <hasant@trabas.co.id>
To: comp.lang.perl.misc@list.deja.com
Subject: Re: replacing a word in a flat file
Message-Id: <Pine.LNX.3.96.990605103743.12552A-100000@borg.intern.trabas.co.id>
On Fri, 4 Jun 1999, Samir Jain wrote:
sjain] Date: Fri, 04 Jun 1999 14:07:44 -0600
sjain] From: Samir Jain <sjain@uswest.com>
sjain] To: comp.lang.perl.misc@list.deja.com
sjain] Subject: replacing a word in a flat file
sjain] Reply-To: comp.lang.perl.misc@list.deja.com
sjain] Organization: U S WEST -- http://www.uswest.com
sjain]
sjain] Hi,
sjain] This is my first program and i am stuck.. I have a flat file which
sjain] looks like this
sjain]
sjain] usr1:passwd1
sjain] usr2:passwd2
sjain] usr3:passwd3
sjain]
sjain] I want to replace passwd1 with passwdx.
>From command line:
% perl -pi.bak -e 's/passwd1/passwdx/' the_flat_file_name
-hasan-
uhm, no more sig(h)
------------------------------
Date: 4 Jun 1999 21:05:10 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Results not displaying.
Message-Id: <7j9f26$2g9$1@gellyfish.btinternet.com>
On Mon, 24 May 1999 14:30:06 GMT news.boeing.com wrote:
> I am running NT 4.0, IIS4 and Perl 5x. I have a Perl script that runs fine
> in PerlBuilder. When I run the script on the Web, nothing gets displayed.
>
> Here is what I do. I have a directory of some files, run a script that will
> build a table of the results. This has worked in the past, but once I
> loaded IIS 4, things do not work like they use to.
>
This is not really anything to do with Perl. There is some anecdotal
evidence that IIS4 installation will screw with your configuration. You
ought to ask in comp.infosystems.www.servers.ms-windows
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 5 Jun 1999 10:01:21 +0700 (JAVT)
From: Hasanuddin Tamir <hasant@trabas.co.id>
To: comp.lang.perl.misc@list.deja.com
Subject: Re: Simple newbie question...
Message-Id: <Pine.LNX.3.96.990605095921.12118C-100000@borg.intern.trabas.co.id>
On 4 Jun 1999, Mark Morley wrote:
mark] Date: 4 Jun 1999 19:38:53 GMT
mark] From: Mark Morley <mark@islandnet.com>
mark] To: comp.lang.perl.misc@list.deja.com
mark] Subject: Simple newbie question...
mark] Reply-To: comp.lang.perl.misc@list.deja.com
mark] Organization: Islandnet.com in B.C. Canada
mark]
mark] Both of these tests evaluate to true:
mark]
mark] "0" == 0
mark] "0" eq 0
mark]
mark] So how can one distinguish between the string "0" and the number 0?
If this really matters to you, you can find it
when you do
perldoc perldata
and
perldoc perlre
-hasan-
uhm, no more sig(h)
------------------------------
Date: Sat, 05 Jun 1999 07:07:03 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Simple question about hashes
Message-Id: <r0463.50293$tE.514181@news2.rdc1.on.home.com>
In article <ebohlmanFCtx44.20z@netcom.com>,
Eric Bohlman <ebohlman@netcom.com> wrote:
[snip]
!
! It's often useful to initialize a hash with "undef" values if the purpose
! of the hash is simply to check whether certain things exist, e.g.
!
! my @stopwords{qw/the an of this that them those/}=();
To quote perl on this:
Can't declare hash slice in my at - line 1, near "}="
Execution of - aborted due to compilation errors.
You'll have to declare the hash first and then assign
to a slice of said hash.
regards
andrew
--
Andrew L. Johnson http://members.home.com/andrew-johnson/
The generation of random numbers is too
important to be left to chance.
------------------------------
Date: 04 Jun 1999 13:20:55 PDT
From: "John Smith" <johnsmith@microsoft.com>
Subject: Using Or to evaluate multiple values
Message-Id: <7j9cf7$ge@journal.concentric.net>
I need to evaluate input from a search page and
respond based on the user's input.
This works for a single city match.
elsif (($DATA{'city_text'} || $DATA{'city'}) eq
"MOUNT EDEN")
{
print "Mount Eden Rocks!";
}
There are cases where the print statement will be
common for numerous cities.
This doesn't work for a multiple city match.
elsif (($DATA{'city_text'} || $DATA{'city'}) eq
("MOUNT EDEN" || "SUNOL"))
{
print "Cities in Alameda County Rock!";
}
Is there an elegant way to list all the cities
that apply to this print statement in one elsif
statement?
Thanks,
Jeff
jeff@netclerk.com
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5896
**************************************