[7571] in Perl-Users-Digest
Perl-Users Digest, Issue: 1197 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 19 21:10:59 1997
Date: Sun, 19 Oct 97 18:00:35 -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 Sun, 19 Oct 1997 Volume: 8 Number: 1197
Today's topics:
@ + @ = % but how? <mailus@web-uk.com>
Re: @ + @ = % but how? (Toutatis)
Re: @ + @ = % but how? (Daniel S. Lewart)
Can't check directory contents while current file open. <rhreed@albany.net>
Re: Can't check directory contents while current file o (Mike Stok)
Deleting a user out of a DBM file. <vinbetro@vantek.net>
help on win32odbc (perl) (Connie Wang)
Re: help on Win32odbc(perl) (Connie Wang)
Help: sybperl 2.08 with RedHat 4.2 <jyu@castle.net>
Re: Include files (Toutatis)
Quest for knowlege part one - Windows question. <dagon@dagon.co.uk>
Re: Quest for knowlege part one - Windows question. <ase@seanet.com>
Re: qw not working as expected (beginner problem) <smantri@osf1.gmu.edu>
Re: qw not working as expected (problem solved) <spectre@mousebyte.com>
Re: Reading from an already-open file <rootbeer@teleport.com>
Re: setuid doesn't change UID's? <rootbeer@teleport.com>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
TIOCNOTTY under Solaris 2 (Detaching) <wiedmann@neckar-alb.de>
Re: Web page greeking tool - has anyone done this? (Tushar Samant)
Re: What's wrong with my script ???? (Toutatis)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 19 Oct 1997 22:44:30 +0100
From: "Richard Butcher" <mailus@web-uk.com>
Subject: @ + @ = % but how?
Message-Id: <344a7ba5.0@ispc-news.cableinet.net>
A newbie asks...
I guess combining two arrays of equal length into one hash
is such a frequently used routine that I have missed it somewhere
in the first few pages of the book.
So how do I do this?
I have exported a varible number of lines in a database to a text file.
I've used ; as a delimiter.
Each line contains ten fields.
The first eight fields are true/false (1 or 0).
The last two fields are strings.
I have an array:
@startwith = ("a","b","c","d","e","f","g","h")
How do I insert the first eight fields into a hash that looks like
%result = "a","0","b","0","c","1","d","0","e","0","f","1","g","0","h","0")
and then pick up the two other fields as $nine and $ten
I know I can split each line into an array
@fields = split(/;/,$line);
and, if necessary, limit it to eight items
but I don't know how to combine and then pick up the two leftovers.
--
from
richard@web-uk.com
------------------------------
Date: 19 Oct 1997 22:56:29 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: @ + @ = % but how?
Message-Id: <toutatis-ya023180002010970056320001@news.euro.net>
Richard Butcher <mailus@web-uk.com> wrote:
> A newbie asks...
>
> I guess combining two arrays of equal length into one hash
> is such a frequently used routine that I have missed it somewhere
> in the first few pages of the book.
>
> So how do I do this?
>
> I have exported a varible number of lines in a database to a text file.
> I've used ; as a delimiter.
> Each line contains ten fields.
> The first eight fields are true/false (1 or 0).
> The last two fields are strings.
>
> I have an array:
> @startwith = ("a","b","c","d","e","f","g","h")
>
> How do I insert the first eight fields into a hash that looks like
> %result = "a","0","b","0","c","1","d","0","e","0","f","1","g","0","h","0")
> and then pick up the two other fields as $nine and $ten
>
> I know I can split each line into an array
> @fields = split(/;/,$line);
> and, if necessary, limit it to eight items
> but I don't know how to combine and then pick up the two leftovers.
The following should do what you want:
@fields = split /;/,$line;
for ('a'..'h'){
$result{$_} = shift @fields;
}
($nine,$ten) = @fields;
--
Toutatis
------------------------------
Date: 19 Oct 1997 23:15:03 GMT
From: d-lewart@uiuc.edu (Daniel S. Lewart)
Subject: Re: @ + @ = % but how?
Message-Id: <62e49n$8tu$1@vixen.cso.uiuc.edu>
"Richard Butcher" <mailus@web-uk.com> writes:
> ...
> How do I insert the first eight fields into a hash that looks like
> %result = "a","0","b","0","c","1","d","0","e","0","f","1","g","0","h","0")
> and then pick up the two other fields as $nine and $ten
> ...
One way (of many) is to splice and slice:
@startwith = qw(a b c d e f g h);
$line = '0;0;1;0;0;1;0;0;jiu;shi';
@fields = split(/;/, $line);
($nine, $ten) = splice(@fields, -2);
@result{@startwith} = @fields;
Daniel Lewart
d-lewart@uiuc.edu
------------------------------
Date: Sun, 19 Oct 1997 15:14:55 -0400
From: "Richard H. Reed" <rhreed@albany.net>
Subject: Can't check directory contents while current file open...
Message-Id: <344A5C2F.346B@albany.net>
Greetings All,
First time posting here, please excuse any redundancy or incorrect
syntax.
I've been working with Perl for several months, mostly for my own
pleasure (sick? twisted?). Was recently tasked on a project to utilize
Perl for reading, sorting and selecting records from a flat-file
database extraction. The script is to format appropriate matches into
an HTML table for return to the web client. This I've done, no
problem...
Where I hit the wall (apologies to Larry...) is when I try to match one
array element representing a "course code" with any like-named .htm
files from a virtual directory on the server. I can do this
independently as a separate routine outputing to new lines of the table,
but not within the table on a record by record basis. I've tried as an
enclosed routine within the table-row print statements, and as a
sub-routine called upon at that point in the code.
The particular section of code looks like this:
foreach $newrecord (@newrecord)
{
@newfield = split(/,/, $newrecord);
$coursecode = ($newfield[1].$newfield[2]);
print "<tr><td><font size=-1>$newfield[0]</font></td>\n";
#
#
# Seeking to replace the next line with routine to match
# course code ($coursecode) to html files found by sub courseMatch.
#
#
print "<td align=center><font size=-1>$coursecode</font></td>\n";
print "<td align=center><font size=-1>$newfield[4]</font></td>\n";
print "<td align=center><font
size=-1>$newfield[5]</font></td></tr>\n";
}
and the course matching code has had various iterations, but basically
looks like this:
@htmlfile = <htmldocs/*.htm>;
foreach $htmlfile (@htmlfile)
{
if ($htmlfile eq "htmldocs/$coursecode.htm")
{
print "<td align=center><a
href=\"/$htmlfile[$i]\">$coursecode</a></td>\n";
} else {
print "<td align=center>$coursecode</td>\n";
}
}
This routine, placed within the printing section from above halts the
execution of the script without generating any error messages back to
the client browser. No table is printed, and the browser shows stopped
"document done".
Any suggestions would be helpful. The entire code for this in .txt
format can be seen at:
http://www.albany.net/~rhreed/Pkcourse.txt
Please excuse any poor syntax in my code (I know I could use a bunch if
elsif's there) and feel free to modify.
TIA,
Rich Reed
--
Reed Associates
Excellence in Communications Consulting.
74 Main Street
Schaghticoke, NY 12154
http://www.albany.net/~rhreed
rhreed@albany.net
(518)753-7525 voice
(518)753-0082 fax
------------------------------
Date: 20 Oct 1997 00:52:16 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Can't check directory contents while current file open...
Message-Id: <62ea00$52c@news-central.tiac.net>
In article <344A5C2F.346B@albany.net>,
Richard H. Reed <rhreed@albany.net> wrote:
>Where I hit the wall (apologies to Larry...) is when I try to match one
>array element representing a "course code" with any like-named .htm
>files from a virtual directory on the server. I can do this
>independently as a separate routine outputing to new lines of the table,
>but not within the table on a record by record basis. I've tried as an
>enclosed routine within the table-row print statements, and as a
>sub-routine called upon at that point in the code.
>Any suggestions would be helpful. The entire code for this in .txt
>format can be seen at:
>
>http://www.albany.net/~rhreed/Pkcourse.txt
If this is the routine you're using then the while could be the problem:
sub courseMatch
{
while (@htmlfile=<htmldocs/*.htm>)
{
$a=@htmlfile;
for ($i=0; $i<=$a; $i++) #each $htmlfile (@htmlfile) #<htmldocs/*.htm>)
{
$htmlfile[$i];
}
}
}
because the @htmlfile=<htmldocs/*.htm> in a scalar context (e.g. as the
condition to while) is the length of the new @htmlfile array, so of there
are any matching files you're effectively doing a while (true). In the
debugger:
$ perl -de 1
Loading DB routines from perl5db.pl version 1.01
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 1
DB<1> @files = <htmldocs/*.htm>
DB<2> X files
@files = (
0 'htmldocs/1.htm'
1 'htmldocs/2.htm'
)
DB<3> print scalar (@files = <htmldocs/*.htm>)
2
DB<4> print scalar (@files = <htmldocs/*.htm>)
2
so each time the <htmldocs/*.htm> is evaluated it re-scans the directory
and reassigns the list and the while loops (if there are any files
matched.)
You could say something like
foreach $courseFile (<htmldocs/*.htm>) {
...
}
to scan through the files.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Sun, 19 Oct 1997 14:29:31 -0500
From: "Vince Betro" <vinbetro@vantek.net>
Subject: Deleting a user out of a DBM file.
Message-Id: <62dmve$vqp$1@news.socomm.net>
I have a DBM file set up on my server ordered by username and I can't seem
to get the delete $users{$fields{'deluser'}} command to work. The
form you type the username in that you want to delete has a field on it
named deluser. Here is my script. If anyone could tell me what is wrong
with it I would be greatful for any suggestions on what to do. The spacing
and everything is exactly how it looks in the file. Thanks.
#!/usr/bin/perl
require ("process_cgi.pl");
&parse_input(*fields);
dbmopen(%users,"users",0666);
delete $users{$fields{'deluser'}};
&print_header;
print<<End_of_Delete_User;
<HTML>
<HEAD><TITLE>$fields{'deluser'} deleted.</TITLE></HEAD>
<BODY
BACKGROUND="http://www.vantek.net/pages/gbostian/c-tek/icons/Background.gif"
>
<CENTER><H1>$fields{'deluser'} has been deleted successfully.</H1>
<a href="http://www.vantek.net/pages/vinbetro/c-tek/admin/">Click here to
return to administration page.</a></CENTER><p>
$users{$fields{'deluser'}}
</BODY>
</HTML>
End_of_Delete_User
exit;
Jeff Betro
----------------------------------------------------
C-Tek Partner in Ownership
Head of Technical, Billing, and Startup Departments
----------------------------------------------------
Personal Addresses
vinbetro@vantek.net
jvbetro@rocketmail.com
----------------------------------------------------
Business Address
ctek@rocketmail.com
----------------------------------------------------
** C-Tek Web Design Services
<http://www.vantek.net/pages/vinbetro/c-tek/>
** Postcard Central
<http://www.vantek.net/pages/gbostian/postcard.htm>
** The Cleveland Indians Page
<http://www.vantek.net/pages/vinbetro/index.html>
** Jeff's Sound Collection
<http://www.vantek.net/pages/vinbetro/cool.htm>
** The Betro's Italian Page
<http://www.vantek.net/pages/vinbetro/italian.htm>
** Come and sign our guestbook
<http://www.vantek.net/pages/vinbetro/guest.htm>
** AOL Instant Messenger Screen Name : jvbetro
----------------------------------------------------
------------------------------
Date: Sun, 19 Oct 1997 19:42:06 GMT
From: c0w0461@unix.tamu.edu (Connie Wang)
Subject: help on win32odbc (perl)
Message-Id: <344a624c.632920@news.tamu.edu>
I use win32odbc(perl) and MS Access to process a form from WWW. The
problems are:
1. The value of radio box or checkbox can not be added (inserted) to
Access database. Why?
2. If I leave a textbox blank, the all information from the Form
cann't be added to the Access database. Why?
Thanks.
Connie
------------------------------
Date: Mon, 20 Oct 1997 00:03:53 GMT
From: c0w0461@unix.tamu.edu (Connie Wang)
Subject: Re: help on Win32odbc(perl)
Message-Id: <344a9bc1.15341019@news.tamu.edu>
Thank you Jan.
I keep on working with these two problems.
1. (radio box problem)
I change the field property in Access from Yes/No (check box) to Text
and set the radiobox's value to Yes or No. It work. But if I insist on
using Yes/No (checkbox) in Access database, I still can't insert the
value to Access database. Is there any way can let me keep on using
checkbox in my Access database.
2.(blank field problem)
My sql syntax is this:
$db->Sql("insert into Applicant (SID,FirstName)
values ('$contents{SID}','')");
this one didn't work. But if I put use a blank space as value of
"FirstName", it will work, such as:
$db->Sql("insert into Applicant (SID,FirstName)
values ('$contents{SID}',' ')");
This one work.
And I try to run sql syntax in Access directly. The result is same the
first syntax didn't work and the second one work.
I think I can check each field value to see if it is blank before sql
statement.If it is blank I can insert a blank space to database. But I
still think there must be another easy way to solve this problem.
Jan Krynicky <Jan@chipnet.cz> wrote:
>Connie Wang wrote:
>>
>> I use win32odbc(perl) and MS Access to process a form from WWW. The
>> problems are:
>> 1. The value of radio box or checkbox can not be added (inserted) to
>> Access database. Why?
>> 2. If I leave a textbox blank, the all information from the Form
>> cann't be added to the Access database. Why?
>>
>> Thanks.
>> Connie
>
>ad 1. If you do not check a checkbox, the item is not sent at all.
>so "INSERT (name,check) VALUES ('$QUERY{checkbox}' , $QUERY{checkbox}) "
>is interpolated to
>"INSERT (name,check) VALUES ('some text' , )" whis is not a correct SQL.
>You have to set $QUERY{checkbox} to zero if it's not defined.
>
> $QUERY{checkbox} = '0' unless defined $QUERY{checkbox};
>
>Also, I'm not sure what value does the client send if the checkbox is
>checked. Make sure it sends some value that may be inserted into
>the database. <INPUT type=checkbox value='1' ...> or something.
>
>About the radio box, use value parameter for all the <OPTION>s
>so that all the values are propper data.
>
>
>ad 2. Try to print out the SQL statement before you execute it.
>There may be some silly syntactic error. Or maybe the table simply
>doesn't allow this item to be empty. Check it's definition.
>
>HTH, Jenda
------------------------------
Date: Sun, 19 Oct 1997 19:52:47 -0400
From: Jeffrey Yu <jyu@castle.net>
Subject: Help: sybperl 2.08 with RedHat 4.2
Message-Id: <344A9D4E.CF784A97@castle.net>
I tried to compile the sybperl 2.08 CTlib in RedHat 4.2, I got
a lot of "undefined reference to ' ' " errors. I have tried almost
everything I can think of, but nothing seems to work so far.
If anyone knows the answer to solve the problem, please
share it with us, I believe over time there will be more and
more people look into this tool. And an effective solution
can save a lot of time. Thanks in advance.
--Jeff
------------------------------
Date: 19 Oct 1997 22:02:08 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: Include files
Message-Id: <toutatis-ya023180002010970002050001@news.euro.net>
In my previous posting I wrote:
[...]
> $line =~ s/<(.*?)>/$replace{$&}/eg;
make that:
$line =~ s/<(.*?)>/$replace{$1}/eg;
--
Toutatis
------------------------------
Date: 19 Oct 97 19:29:08 GMT
From: "Dan Norcott" <dagon@dagon.co.uk>
Subject: Quest for knowlege part one - Windows question.
Message-Id: <01bcdcc5$195685a0$1ffe4ac2@default>
Sorry to burden all you regulars with yet another newbie scum squealing for
information,
but that's what I am and that's the only way I'll ever stop being a
squealy-newbie-type thing.
My question is this:
I've got a PC with Win95, and an account with a service provider who allows
me to upload my own
scripts. This I have done, and it works lovely, but it isn't perfect.
Originally, as I wrote my scripts,
I was writing them on my PC and uploading them before trying them out
online. As you can imagine,
this was time consuming and offensive. Finally, I acquired enough common
sense to download Perl
for Win32, which works a treat. However, as I am writing scripts for use
within web pages, I need to
do more than just be able to run programs from DOS using the 'perl
filename' command.
Ideally, I would like to be able to run my scripts from a web page on my
own hard drive - is there any
way to do this? My scripts are all invoked by forms on the web, and I
don't see how I could get something
similar to work on my PC. If anybody knows any ways to do this, or any
solution, however strange,
then I would be eternally grateful if you would email me at
dagon@dagon.co.uk.
Thanking you in anticipation for your godlike intervention,
Dan Norcott.
------------------------------
Date: Sun, 19 Oct 1997 16:06:12 -0700
From: "Allen Evenson" <ase@seanet.com>
Subject: Re: Quest for knowlege part one - Windows question.
Message-Id: <62e3o9$r98@q.seanet.com>
=20
Dan Norcott wrote in article <01bcdcc5$195685a0$1ffe4ac2@default>...
>Sorry to burden all you regulars with yet another newbie scum squealing =
for
>information,
>but that's what I am and that's the only way I'll ever stop being a
>squealy-newbie-type thing.
I don't know about anyone else here but .. I was new (still am compared =
to most of the posters here) and a better way to become educated is:
1) READ the documentation that came with your distrubution of perl.
start by typing "perldoc perldoc" at a console prompt.
2) Buy a book or two about perl and read them: see perlbook =
documentation.
3) write lots and lots of perl scripts that do whatever it is you want =
them to do. When you come to specific questions do items 1 and 2 over =
and over again.
=20
>
>My question is this:
>
>I've got a PC with Win95, and an account with a service provider who =
allows
>me to upload my own
>scripts. =20
[snip]
> However, as I am writing scripts for use
>within web pages, I need to
>do more than just be able to run programs from DOS using the 'perl
>filename' command.
>Ideally, I would like to be able to run my scripts from a web page on =
my
>own hard drive - is there any
>way to do this? =20
Find the Perl CGI FAQ. (or whatever its called)
Try www.Dejanews.com or maybe www.perl.com
Maybe install a local webserver that supports CGI?
[snip]
>dagon@dagon.co.uk.
>
>Thanking you in anticipation for your godlike intervention,
>Dan Norcott
When people don't understand something they always refer to it as =
Godlike
or Magical or whatever. Get a grip. Read The Docs. Check The FAQ. Learn
the Language.
And finally, Please Use a REAL subject line.. Check the newusers =
newsgroup
for posting guidlines.
______________________________
Allen -Learning Perl one script at a time
------------------------------
Date: Sun, 19 Oct 1997 14:49:49 -0400
From: shiva mantri <smantri@osf1.gmu.edu>
To: Chris Ray <spectre@mousebyte.com>
Subject: Re: qw not working as expected (beginner problem)
Message-Id: <Pine.OSF.3.95q.971019144658.27554A-100000@osf1.gmu.edu>
I think the version u r using dont understand "qw(" and all the quote
stuff.
if u run the same program in perl 5 it does understand..
try in perl5 it does run i did that..
shiva
On 19 Oct 1997, Chris Ray wrote:
> Hello all.
>
> I am not only a beginner at Perl, but at programming in general, so please
> be gentle.
>
> I've just started working through the llama book, and I'm a little confused
> at the error message I'm getting when I attempt to run the script on page
> 8, in the section introducing arrays. Here is the entire code:
>
>
> #!/usr/bin/perl -w
> @words = qw(camel llama alpaca);
> print "What is your name? ";
> $name = <STDIN>;
> chop ($name);
> if ($name eq "Randal") {
> print "Hello, Randal! How good of you to be here!\n";
> } else {
> print "Hello, $name!\n";
> print "What is the secret word? ";
> $guess = <STDIN>;
> chop ($guess);
> $i = 0;
> $correct = "maybe";
> while ($correct eq "maybe") {
> if ($words[$i] eq $guess) {
> $correct = "yes";
> } elsif ($i < 2) {
> $i = $i + 1;
> } else {
> print "Wrong, try again. What is the secret word?";
> $guess = <STDIN>;
> chop ($guess);
> $i = 0;
> }
> }
> }
>
>
>
> The error I get when I run this is
>
>
> syntax error in file secret.pl at line 2, next 2 tokens "qw("
> Execution of secret.pl aborted due to compilation errors.
>
>
> Now, if instead of
>
> @words = qw(camel llama alpaca);
>
> I substitute
>
> @words = ("camel", "llama", "alpaca");
>
> everything works fine.
>
> I'm running on Perl version 4.0 on a UNIX system, and I've also tried it
> under Linux (I can't get to the Perl version on that system right now--the
> hard drive is not in the machine). Both systems respond the same way.
>
> Have I missed something in this file? I had a problem with "chomp" earlier,
> which was fixed by substituting "chop" in its place. Is there a similar
> problem with "qw" that I haven't found? Can anyone tell me why it isn't
> working as expected?
>
>
> Thanks,
>
> Chris
>
>
>
Shiva Mantri
---
7032738119,7039938736
------------------------------
Date: 19 Oct 1997 18:17:55 GMT
From: "Chris Ray" <spectre@mousebyte.com>
Subject: Re: qw not working as expected (problem solved)
Message-Id: <01bcdcbb$39ad8740$9d5f0e26@fsu.edu.fsu.edu>
Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh"
<bsa@void.apk.net> wrote in article <344a2474$2$ofn$mr2ice@speaker>...
>
> You need Perl 5 for that to work. Some Linux distributions (especially
older
> ones) ship with Perl 4 by default and Perl 5 an option, invoked under the
name
> "perl5".
Which is exactly what has happened, but on the UNIX system. I thought Perl
5 was there, but "perl -v" brought back "4.0 patch level 36." I actually
have 5.003_2 as well, and the scripts work fine. I'll check the version
running under Linux when I put the machine back together.
Thanks to both Brandon and Daniel for the help.
Regards,
Chris
------------------------------
Date: Sun, 19 Oct 1997 12:25:51 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: John Goerzen <jgoerzen+usenet@complete.org>
Subject: Re: Reading from an already-open file
Message-Id: <Pine.GSO.3.96.971019122303.9898S-100000@usertest.teleport.com>
On 18 Oct 1997, John Goerzen wrote:
> Date: 18 Oct 1997 08:15:25 -0500
> I have a situation where a program will invoke my script with file
> descripter 3 pre-opened to a certain file that I need to write to.
The description of open() in perlfunc(1) has something about this:
You may also, in the Bourne shell tradition, specify
an EXPR beginning with ">&", in which case the rest
of the string is interpreted as the name of a
filehandle (or file descriptor, if numeric) which is
to be duped and opened. You may use & after >, >>,
<, +>, +>>, and +<. The mode you specify should
match the mode of the original filehandle. (Duping
a filehandle does not take into account any existing
contents of stdio buffers.)
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sun, 19 Oct 1997 12:29:21 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ingo L|tkebohle <ingo@blank.pages.de>
Subject: Re: setuid doesn't change UID's?
Message-Id: <Pine.GSO.3.96.971019122712.9898T-100000@usertest.teleport.com>
On Sat, 18 Oct 1997, Ingo L=FCtkebohle wrote:
> I'm using the POSIX module setuid and setgid calls to change to the UID
> and GID of a setuid-root script to those of a user. When I look at $UID
> and $GID (with use English), the correct values appear. But when I try
> to open a file which I shouldn't be able to open, it still works! When I
> manually change to the user with "su -l <user>", I (correctly) get
> "permission denied" on trying to open the file.
It sounds as if your system (or your code) isn't properly dropping the
privileges. Try assigning to the $EUID and $EGID as well. And it wouldn't
be bad to check that re-assigning the original id fails after that. If you
still can't get this to work, make a small (say, ten line) script which
shows the problem and post it here. Good luck!
--=20
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 19 Oct 1997 23:31:12 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <62e580$eo1$1@info.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 12 Oct 1997 23:48:40 GMT and ending at
20 Oct 1997 07:56:21 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" e-mail address and name.
- Original Content Rating is the ratio of the original content volume
to the total body volume.
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
Excluded Posters
================
perlfaq-suggestions@mox.perl.com
Totals
======
Total number of posters: 400
Total number of articles: 835 (308 with cutlined signatures)
Total number of threads: 341
Total volume generated: 1367.4 kb
- headers: 553.7 kb (11,575 lines)
- bodies: 753.1 kb (24,792 lines)
- original: 544.7 kb (18,793 lines)
- signatures: 58.6 kb (1,370 lines)
Original Content Rating: 0.7233
Averages
========
Number of posts per poster: 2.09
median: 1.0 post
mode: 1 post - 275 posters
s: 4.14 posts
Number of posts per thread: 2.45
median: 2 posts
mode: 1 post - 124 threads
s: 2.08 posts
Message size: 1676.9 bytes
- header: 679.0 bytes (13.9 lines)
- body: 923.5 bytes (29.7 lines)
- original: 668.0 bytes (22.5 lines)
- signature: 71.9 bytes (1.6 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
43 65.9 ( 29.3/ 27.2/ 19.1) brian d foy <comdog@computerdog.com>
42 65.2 ( 26.3/ 29.9/ 15.8) Jeremy D. Zawodny <zawodny@hou.moc.com>
37 66.5 ( 22.2/ 44.2/ 29.3) Tad McClellan <tadmc@flash.net>
30 50.1 ( 21.7/ 28.4/ 15.9) Doug Seay <seay@absyss.fr>
19 30.8 ( 16.0/ 11.0/ 7.5) Tom Phoenix <rootbeer@teleport.com>
19 32.7 ( 13.4/ 19.0/ 7.6) Toutatis <toutatis@_SPAMTRAP_toutatis.net>
14 24.5 ( 10.3/ 14.2/ 6.8) Benjamin Holzman <bholzman@earthlink.net>
14 33.3 ( 9.3/ 24.0/ 10.6) faust@wwa.com
12 19.9 ( 6.3/ 13.4/ 10.6) Andrew M. Langmead <aml@world.std.com>
11 26.0 ( 13.0/ 13.0/ 8.1) Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
66.5 ( 22.2/ 44.2/ 29.3) 37 Tad McClellan <tadmc@flash.net>
65.9 ( 29.3/ 27.2/ 19.1) 43 brian d foy <comdog@computerdog.com>
65.2 ( 26.3/ 29.9/ 15.8) 42 Jeremy D. Zawodny <zawodny@hou.moc.com>
50.1 ( 21.7/ 28.4/ 15.9) 30 Doug Seay <seay@absyss.fr>
33.3 ( 9.3/ 24.0/ 10.6) 14 faust@wwa.com
32.7 ( 13.4/ 19.0/ 7.6) 19 Toutatis <toutatis@_SPAMTRAP_toutatis.net>
30.8 ( 16.0/ 11.0/ 7.5) 19 Tom Phoenix <rootbeer@teleport.com>
26.0 ( 13.0/ 13.0/ 8.1) 11 Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
25.2 ( 2.3/ 22.5/ 21.3) 3 John Clutterbuck <jclutterbuck@sbs.siemens.co.uk>
24.5 ( 10.3/ 14.2/ 6.8) 14 Benjamin Holzman <bholzman@earthlink.net>
Top 10 Posters by OCR (minimum of five posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
------ -------------- ----- -------
0.9844 2.5 / 2.5 5 Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh" <bsa@void.apk.net>
0.8247 3.8 / 4.6 5 Joseph Scott Stuart <nospam@ll.mit.edu>
0.7909 10.6 / 13.4 12 Andrew M. Langmead <aml@world.std.com>
0.7712 2.7 / 3.5 6 Jeff Gostin <jgostin@shell2.ba.best.com>
0.7627 2.7 / 3.5 5 sartang@pcocd2.intel.com
0.7524 6.6 / 8.7 9 Martien Verbruggen <mgjv@comdyn.com.au>
0.7521 4.4 / 5.8 6 Mike Stok <mike@stok.co.uk>
0.7507 3.7 / 4.9 5 John Goerzen <jgoerzen+usenet@complete.org>
0.7036 19.1 / 27.2 43 brian d foy <comdog@computerdog.com>
0.6821 7.5 / 11.0 19 Tom Phoenix <rootbeer@teleport.com>
Bottom 10 Posters by OCR (minimum of five posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
------ -------------- ----- -------
0.5516 1.5 / 2.8 5 Russ Allbery <rra@stanford.edu>
0.5355 2.2 / 4.1 5 Randal Schwartz <merlyn@stonehenge.com>
0.5302 15.8 / 29.9 42 Jeremy D. Zawodny <zawodny@hou.moc.com>
0.5253 2.2 / 4.2 7 Ilya Zakharevich <ilya@math.ohio-state.edu>
0.5238 2.1 / 4.1 5 over@the.net
0.5025 1.4 / 2.8 5 Casper K. Clausen <ckc@dmi.min.dk>
0.4760 6.8 / 14.2 14 Benjamin Holzman <bholzman@earthlink.net>
0.4440 10.6 / 24.0 14 faust@wwa.com
0.4007 7.6 / 19.0 19 Toutatis <toutatis@_SPAMTRAP_toutatis.net>
0.3692 1.6 / 4.3 5 Mike Heins <mheins@prairienet.org>
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
19 Can someone look at this and tell me why it doesn't work!!
17 statics or const in perl ?
13 Any plans for Min and Max operators?
12 String manipulation in Perl
12 reg exp size limit !?
9 2000 time problem
7 Bulk email solution needed that works with Linux, Perl
7 Web Programmer Wanted
7 global variable under "use strict"
6 newbie: counting patterns
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
30.6 ( 12.9/ 17.0/ 11.1) 17 statics or const in perl ?
29.1 ( 13.6/ 14.3/ 7.8) 19 Can someone look at this and tell me why it doesn't work!!
24.8 ( 2.2/ 22.2/ 21.3) 3 5.004_03 test failure on IRIX 5.3
23.3 ( 9.0/ 13.0/ 7.8) 12 String manipulation in Perl
20.8 ( 9.9/ 9.9/ 7.0) 13 Any plans for Min and Max operators?
17.2 ( 1.4/ 15.8/ 15.5) 2 PTY object for perl
16.7 ( 8.0/ 8.2/ 4.8) 12 reg exp size limit !?
15.4 ( 2.3/ 12.8/ 11.8) 3 Some strange Perl things?
13.5 ( 3.8/ 8.8/ 7.4) 5 Need RE to change overstrikes to HTML
12.7 ( 6.4/ 5.5/ 2.4) 9 2000 time problem
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
28 comp.lang.perl.modules
23 alt.fan.e-t-b
10 comp.lang.perl
10 comp.lang.perl.tk
8 de.comp.lang.perl
8 comp.mail.misc
7 comp.os.linux.misc
7 comp.mail.sendmail
6 comp.os.unix.misc
5 comp.unix.solaris
Top 10 Crossposters
===================
Articles Address
-------- -------
15 Jackson Dodd <jackson@usenix.org>
11 Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
10 "Vangeli Dermatis" <Vangeli@erols.com>
9 Drake International <b~johnston@rocketmail.com>
8 Russell Nelson <nelson@crynwr.com>
6 brian d foy <comdog@computerdog.com>
6 Fabrizio Pivari <pivari@geocities.com>
4 Ilya Zakharevich <ilya@math.ohio-state.edu>
4 Tad McClellan <tadmc@flash.net>
4 chris@ixlabs.com
------------------------------
Date: Sun, 19 Oct 1997 18:48:26 +0200
From: Jochen Wiedmann <wiedmann@neckar-alb.de>
Subject: TIOCNOTTY under Solaris 2 (Detaching)
Message-Id: <344A39DA.76BDF774@neckar-alb.de>
Hello,
I'd like to detach a daemon from the shell under Solaris 2. The
perlipc man page and the perl FAQ recommend to
o Open /dev/tty and use the TIOCNOTTY ioctl on it. See
the tty(4) manpage for details.
thus I tried the following:
if (!ioctl(TTY, &TIOCNOTTY, 1)) {
which works under Linux. It doesn't under Solaris 2, however. :-(
Instead it fails with an error message "Illegal argument". I've
been trying 0 and 0 as arguments, without success.
Any recommendations?
Thanks,
Jochen
--
Jochen Wiedmann wiedmann@neckar-alb.de
07123 14887
------------------------------
Date: 19 Oct 1997 18:10:26 -0500
From: scribble@shoga.wwa.com (Tushar Samant)
Subject: Re: Web page greeking tool - has anyone done this?
Message-Id: <62e412$glh@shoga.wwa.com>
junge@supernews.com writes:
>I need to greek (replace real text with nonsense words) a few of my Web
>sites, so I can display examples of my work without releasing clients'
>proprietary information.
>
>[...]
>
>It seems like such script must be relatively easy to write, if you truly
>know what you are doing (which, clearly I don't) - and perhaps, considering
>all the Web designers out there, it's already been done.
It has been done -- at least as much of it as you could reasonably
expect. Get the libwww distribution from CPAN, it has an HTML parser.
All you will have to do, in effect, is rewrite your set of conditions
and put them in a callback.
It's probably not very easy if you are a total beginner but it's still
the easiest and most reliable. Email me if you need help.
------------------------------
Date: 19 Oct 1997 18:01:14 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: What's wrong with my script ????
Message-Id: <toutatis-ya023180001910972001170001@news.euro.net>
In article <62deou$rco@news2.jaring.my>, bslee@pl.jaring.my (B.S.LEE) wrote:
> I have written a perl cgi script and I try to test it on my server but
> it can't run. I really can't figure out what's wrong with my script. I
> keep getting the error message as below:-
>
> Can't modify subtraction in scalar assignment at
> C:\WebShare\wwwroot\cgi-bin\test1.pl line 13, near "$value;"Execution
> of C:\WebShare\wwwroot\cgi-bin\test1.pl aborted due to compilation
> errors..
>
> Below is my script:-
> $regis-data{$name1}=$value;
^
^
You don't really want to substract, do you?
Use _underscores_ instead.
And really *analize* your error output. It gave you plenty clues, I'd say...
--
Toutatis
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 1197
**************************************