[15770] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3183 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 27 09:10:22 2000

Date: Sat, 27 May 2000 06:10:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959433013-v9-i3183@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 27 May 2000     Volume: 9 Number: 3183

Today's topics:
    Re: Regex prime numbers (Was Re: seeking method to enco (Gwyn Judd)
    Re: seeking method to encode email addresses in web pag (Steven Smolinski)
    Re: seeking method to encode email addresses in web pag (Neil Kandalgaonkar)
    Re: seeking method to encode email addresses in web pag <dave@dave.org.uk>
        sort routine fails <linalina203@compuserve.de>
    Re: Tanspose rows to columns <xah@xahlee.org>
    Re: Tanspose rows to columns <xah@xahlee.org>
    Re: Tanspose rows to columns <xah@xahlee.org>
    Re: using OLE to open files in READ ONLY mode (Reini Urban)
    Re: using param() and CGI.pm to store a persistent valu <dave@dave.org.uk>
        Where's the Syntax error in this? stone@enetis.net
    Re: Where's the Syntax error in this? <phill@modulus.com.au>
        WinNT 4.0 file permissions <gdgrimm@pacbell.net>
    Re: WinNT 4.0 file permissions <carvdawg@patriot.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 27 May 2000 04:44:54 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Regex prime numbers (Was Re: seeking method to encode email addresses in web page forms)
Message-Id: <slrn8j196e.3cn.tjla@thislove.dyndns.org>

I was shocked! How could Brad Baxter <bmb@dataserv.libs.uga.edu>
say such a terrible thing:
>On Sat, 27 May 2000, Gwyn Judd wrote:
>> Okay that's got me curious. What is this regex prime number generator?
>
>Do you mean this one?
>
>perl -wle '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_ ++'

oooh oooh oooh!! :)

rewritten slightly:

$_ = 1;

while ($_++)
{
  if ((1 x $_) !~ /^(11+)\1+$/)
	{
    print $_;
	}
}

or:

$_ = 1;
while ($_++)
{
	$size_of_num = 1 x $_;
  if ($size_of_num !~ /^(11+)\1+$/)
	{
    print $_;
	}
}

or:

$_ = 1;
NUMBER: while ($_++)
{
	$size_of_num = 1 x $_;
	$div = "11";
	CHECK: while (length($div) * 2 <= length($size_of_num))
	{
		$qr = qr#^($div)+$#;
    next NUMBER if ($size_of_num =~ /$qr/);
    $div .= "1";
	}
	
	print $_;
}

except mine is a lot slower than the one liner :)

-- 
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
Drug abuse is like a car in a traffic jam, the road it opens is short and
empty but leads to even more traffic
		-- Kurt Spiteri Cornish 


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

Date: Sat, 27 May 2000 04:19:40 GMT
From: sjs@yorku.ca (Steven Smolinski)
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <slrn8iuj2d.ijb.sjs@john.sympatico.ca>

Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>Knocking it down to 30 seconds for your
>biased cheat test, this still only amounts
>to a savings in time of 30 seconds per
>year for an exceptionally busy site at
>274 hits per day. 

"Exceptionally busy" and "274 hits per day" are not phrases
which belong in the same sentence.  Busy sites probably get
274 hits every minute or two.

Programmers for such sites cannot abide slow algorithms or
inefficient code, especially when there are perfectly good, 
fast alternatives.

Gosh darn it. Don't feed the troll...don't feed the troll...

Steve


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

Date: 27 May 2000 08:49:27 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <8go26n$and$1@newsflash.concordia.ca>

In article <392F25A5.71033160@stomp.stomp.tokyo>,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:

> this still only amounts
>to a savings in time of 30 seconds per
>year for an exceptionally busy site at
>274 hits per day.

Wow, I wonder what you would call exceptionally idle. 


> In 30 years, a 15 minute
>savings in CPU time, that's over 30 years
>mind you, per your cheat test fake results.

I don't know what Web you use, but on mine, traffic is markedly
bursty. Lunchtimes, special announcements, media mentions --
all can cause huge surges. Even if it works out to a low hit count
over a large period of time, when it counts most, you will need
that efficiency.


>So you see, when it comes to reality, you
>"big boys" just can't perform.

This isn't a male-female thing. Your tactics of misdirection are
obvious. 


>Your test results stand as invalid.

So invalidate them. Stun me, Kiralynne. Actually give us some 
numbers or repeatable tests to back up your assertions.

Really, this is ludicrous. You might as well try to argue that
the sky is polka-dot purple.

You're not a contributor to comp.lang.perl.misc. You appear to
have mistaken this group for alt.the-full-extent-of-kiralynnes-
ego. You post "help" that consists of novella-length ramblings
sprinkled with buggy, irrelevant, antique code. And then when
criticisms are made, you either disown what you wrote, deny reality,
or when all else fails, start verbally abusing people. This is 
not contributing, it's just a way of turning this newsgroup into
all Kiralynne, all the time. Your consistent trait is a total 
disregard for the needs of other users who would like to use this
group to get questions answered now and then. You treat other
users neither as colleagues nor even as other human beings. 

Personally, I've tried to be patient with you, but it appears 
you are incapable of acting like a rational and humane person.
Instead, you treat this newsgroup as your personal shitting ground.
 

-- 
Neil Kandalgaonkar
neil@brevity.org


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

Date: Sat, 27 May 2000 11:07:28 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <2b7viss53ndr7utvu79sgvl70hddlhbm8a@4ax.com>

On Fri, 26 May 2000 12:00:25 -0700, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:

>Dave Cross wrote:
> 
>> On 26 May 2000 16:17:59 GMT, The WebDragon <nospam@devnull.com> wrote:
> 
>> >other than that, interesting trick with the sprintf... I wasn't aware
>> >one could do that. :)
> 
>> It's far easier using 'pack' and 'unpack'.
>
>
>=~ s/%(..)/pack("c",hex($1))/ge;
>
>=~ s/([0-9A-Fa-f]{2})/ sprintf("%c",hex($1)) /ge ;
>
>Which is best and why?

Actually I was talking more about comparing encoding code

$email =~ s/(.)/ sprintf('%02x',ord($1)) /ge ;

with

$email = unpack('H*', $email);

and your decoding code 

$email =~ s/([0-9A-Fa-f]{2})/ sprintf("%c",hex($1)) /ge ;

with 

$email = pack('H*', $email);


In both cases, my version are 

a) easier for maintenance programmers to understand
b) less typing (and therefore less prone to typos) and
c) (as Larry Rosler has conclusively shown) far quicker.


hth,

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: Sat, 27 May 2000 14:44:59 +0200
From: "linalina203" <linalina203@compuserve.de>
Subject: sort routine fails
Message-Id: <392fc36a$0$22525@news.compuserve.de>

hi,
i have some problems with a sort routine within a data base.
All entries should be sorted after rating. Software with
best rating on top, and the other way round. Visiors can rate
software in adding one point to the value rating. Then the data
base will be sorted with the following routine. Sort routine
fails when doing same entry twice. Afterwards some entries will
be lost or blank lines appear between entries.

it would be great if anyone could help me. pls send a copy to
skeeta\@muenster.de. Thanks.

data.txt:
software|description|download|rating
something 1.0|great proggie|http://u.r.traced.net/proggie.zip|5


sort-routine:

my @items = ();

open (FH, "data.txt");
@items = sort { ${$b}[4] <=> ${$a}[4] } map { chomp; [ split(/\|/, $_) ] }
<FH>;
close(FH);

open (FH, "> data.txt");
$count = 0;

foreach (@items)

{
 $count++;
 print FH join('|', @{ $_ });
 print FH "\n";
}

close(FH);





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

Date: Sat, 27 May 2000 01:47:11 -0700
From: Xah <xah@xahlee.org>
Subject: Re: Tanspose rows to columns
Message-Id: <B554D99F.A66B%xah@xahlee.org>

Dear Urine Gutterman,

you wrote
> how about, i don't give a shit about your transpose. it is a purely
> algorithmic problem solved in many languages. use apl already and go
> away. if you hate perl so much, why bother posting here? i don't go
> flaming in python?

Do you know why Perl newsgroups are filled with moronic kiddies and lame
questions, and the other half with faq pointers and pettiquette quarrels?
That is due, in large part, to bovine herd of your class, who have no sight
nor grace, but drawn by idiom trivia and inconsequential bitchings.

> it is a purely
>algorithmic problem solved in many languages. use apl already and go
>away.

"Solved" in many languages? Actually, the (generalized) transpose function
is not to be found in any (functional) language i'm aware of except
Mathematica, and i have not seen its concept (as spec'ed out in Mathematica
or my pod) discussed in any algorithm book except perhaps originated in
theory of Tensors. Please correct me if i'm wrong. It is difficult to find a
thing or two worth learning in your posts. Larry Wall's airy writings, are
at least a recognized art form called casuistry.

> if you hate perl so much, why bother posting here? i don't go
>flaming in python?

Original ideas are seeds of progress. Larry Wall has things to say against
the computing world, and I have things to say against him and his Perl. You
don't go flaming in python?? That's because, your idiomatic dogma drivel are
worthless everywhere else.

 Xah
 xah@xahlee.org
 http://xahlee.org/PageTwo_dir/more.html



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

Date: Sat, 27 May 2000 03:07:09 -0700
From: Xah <xah@xahlee.org>
Subject: Re: Tanspose rows to columns
Message-Id: <B554EC5D.A66C%xah@xahlee.org>

Dear Ilmari Karonen <iltzu@sci.invalid> ,

you wrote:
> #!/usr/bin/perl -w
> use strict;
> 
> sub _transpose {
> my ($tree, $perm, $new, @pos) = @_;
> if (@pos < @$perm) {
> my $i = 0;
> _transpose($_, $perm, $new, @pos, $i++) for @$tree;
> } else {
> $new = \$$new->[$_] for map $pos[$_ - 1] => @$perm;
> $$new = $tree;
> }
> }
> 
> sub Transpose {
> my ($tree, $perm) = @_;
> $perm ||= [2,1];
> _transpose($tree, $perm, \my $new);
> return $new;
> }


Now that's respectful code. Terse, meet the spec, and without eval.

Some people in the Perl crowd, are non-trivial programers. I have to admit,
that i do come away very impressed at times in perl.misc. Do you like Perl?
and why do you like it? Do you have expertise in non-imperative languages?

--
           ___
       .-'`   `'-.
   _,.'.===   ===.'.,_
  / /  .___. .___.  \ \
 / /   ( o ) ( o )   \ \                                            _
: /|    '-'___'-'    |\ ;                                          (_)
| |`\_,.-'`   `"-.,_/'| |                                          /|
| |  \             /  | |                                         /\;
| |   \           /   | | _                              ___     /\/
| |    \   __    /\   | |' `\-.-.-.-.-.-.-.-.-.-.-.-.-./`   `"-,/\/ 
| |     \ (__)  /\ `-'| |    `\ \ \ \ \ \ \ \ \ \ \ \ \`\       \/
| |      \-...-/  `-,_| |      \`\ \ \ \ \ \ \ \ \ \ \ \ \       \
| |       '---'    /  | |       | | | | | | | | | | | | | |       |
| |               |   | |       | | | | | | | | | | | | | |       |
\_/               |   \_/       | | | | | | | | | | | | | | .--.  ;
                  |       .--.  | | | | | | | | | | | | | | |  | /
                   \      |  | / / / / / / / / / / / / / /  |  |/
               jgs |`-.___|  |/-'-'-'-'-'-'-'-'-'-'-'-'-'`--|  |
            ,.-----'~~;   |  |                  (_(_(______)|  |
           (_(_(_______)  |  |                        ,-----`~~~\
                    ,-----`~~~\                      (_(_(_______)
                   (_(_(_______)

Woouf, woouf, woOUF!
(Xah barking like a dog in admiration.)

(ascii art from
http://www.geocities.com/SoHo/7373/toystory.htm#slinkydog
)

Now i need to study the code... (will write to you personally afterwards...)

 Xah
 xah@xahlee.org
 http://xahlee.org/PageTwo_dir/more.html



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

Date: Sat, 27 May 2000 05:43:14 -0700
From: Xah <xah@xahlee.org>
Subject: Re: Tanspose rows to columns
Message-Id: <B55510F1.A685%xah@xahlee.org>

Ilmari Karonen <iltzu@sci.invalid>,

would you care to post an explanation of your implementation?

I'm interested in:

* an overview of the algorithm/method.

* what does constructs like '\my $new' mean? Also, lines like
$new = \$$new->[$_] for map $pos[$_ - 1] => @$perm;
will take me some time to figure out. (haven't seen the use like
'\$$new->[$_] and 'for' in such way.)

thanks.

 Xah
 xah@xahlee.org
 http://xahlee.org/PageTwo_dir/more.html



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

Date: Sat, 27 May 2000 08:14:39 GMT
From: rurban@x-ray.at (Reini Urban)
Subject: Re: using OLE to open files in READ ONLY mode
Message-Id: <392f8437.86582739@judy>

Scott Patterson wrote:

>I have been ablel to succesfuly open word docs and get text from them using
>the WIN32::OLE module, but if the word doc is opened I am prompted with a
>question asking if read only mode is ok.  Since I am simply wanting to read
>from the file, I always choose yes.  However, it would be nice to be able to
>suppress this message. So, is there a way to specify I want to open the file
>in read-only mode from the beginning?  Here's what I got so far:
>
>use Win32::OLE;
>use Win32::OLE::Const 'Microsoft Word';
>
>my $Word = Win32::OLE->new('Word.Application', 'Quit');
>#$Word->{'Visible'} = 1;         # if you want to see what's going on
>$Word->Documents->Open("C:\\test.doc")|| die("Unable to open document ",
>Win32::OLE->LastError());

this question is not perl related, it is msword-only related.
perl Win32::OLE just gives you access to the OLE Automation API provided
by the Automation server which is msword in this case, nothing else. if
you don't know what to do in certain cases ask the msword specialists
(or other applications with similar Win32::OLE problems), not here.

either check the file attribute before and change it to read-write to
overcome this warning if it annoys you (this is perl related but
trivial) or check the msword activex api docs if there other methods to
overcome this.

there's also an ActiveState perl for win32 users list for similar not so
perl related problems. the VB group might also help.
--
Reini Urban
http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html


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

Date: Sat, 27 May 2000 11:14:57 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: using param() and CGI.pm to store a persistent value
Message-Id: <4u7vissp9ui1fhm5sbr99g6chsbqt5d3d7@4ax.com>

On Fri, 26 May 2000 09:48:43 -0700, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:

>I use modules and know them well. 

and then oin the very next line

> My choice is to not use modules. 

Are you going for some kind of World Inconsistancy Record, Kiralynne?

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: Sat, 27 May 2000 05:58:21 GMT
From: stone@enetis.net
Subject: Where's the Syntax error in this?
Message-Id: <8gno5o$e0d$1@nnrp1.deja.com>

I have a subroutine that the Perl interpretor insists contains a
Syntax error but for the life of me I can't find it... yup that same old
sad story.   I've checked every line and counted all of my brackets.
There's probably no way I'm going to get out of this without looking
like a fool (obviously the problem's right there in front of me) but
I've spent too much time on it and I need a second opinion.  If you
have the time and patients to help a newbie I'd appreciate you
taking a look at this code and telling me if there is or is not a
Syntax error.  Thank you.

Details of returned errors:
  -- File 4928984.cgi; Line 844: # syntax error, near "else"
     Refers to the "else" statement within the section entitled "##
Separate out the deleted password entries."

  -- File 4928984.cgi; Line 867: # syntax error, near "}"
     Refers to the right bracket that ends the subroutine.

##--------Begin Subroutine------------##

sub delete_accounts
{
## Open the database file for reading
open (DATA, $active_database);
@database = <DATA>;
close (DATA);

## Open the password file for reading
open (PASS, $active_password);
@passwords = <PASS>;
close (PASS);

## Separate out the deleted database entries.
foreach $line(@database)
	{
	@account = split (/:/, $line);
	if ($input{"$account[0]"} eq 'delete')
		{
		push (@deleted_passwords, $account[1]);
		next;
		}
	else {push (@newdatabase, $line);}
	}

## Separate out the deleted password entries.
foreach $line(@passwords)
	{
	$crypt_password = crypt ($line, aa);
	foreach $word(@deleted_passwords)
		{
		if ($crypt_password eq $word) {next;}
		}
	else {push (@newpasswords, $line);}
	}

## Create the revised database file.
open (DATA, ">$active_database");
foreach $line(@newdatabase)
	{
	if ($line =~ m/\n/) {chomp($line);}
	print DATA "$line\n";
	}
close (DATA);

## Create the revised password file.
open (PASS, ">$active_password");
foreach $line(@newpasswords)
	{
	if ($line =~ m/\n/) {chomp($line);}
	print PASS "$line\n";
	}
close (PASS);

## Return to the active accounts control panel.
&active_panel;
}

##--------End Subroutine------------##


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Sat, 27 May 2000 18:48:37 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: Where's the Syntax error in this?
Message-Id: <392F8BE5.73A7@modulus.com.au>

stone@enetis.net wrote:
> 
> I have a subroutine that the Perl interpretor insists contains a
> Syntax error but for the life of me I can't find it... yup that same old
> sad story.   I've checked every line and counted all of my brackets.
> There's probably no way I'm going to get out of this without looking
> like a fool (obviously the problem's right there in front of me) but
> I've spent too much time on it and I need a second opinion.  If you
> have the time and patients to help a newbie I'd appreciate you
> taking a look at this code and telling me if there is or is not a
> Syntax error.  Thank you.
> 
> Details of returned errors:
>   -- File 4928984.cgi; Line 844: # syntax error, near "else"
>      Refers to the "else" statement within the section entitled "##
> Separate out the deleted password entries."
> 
>   -- File 4928984.cgi; Line 867: # syntax error, near "}"
>      Refers to the right bracket that ends the subroutine.
> 
> ##--------Begin Subroutine------------##
> 
> sub delete_accounts
> {
> ## Open the database file for reading
> open (DATA, $active_database);
> @database = <DATA>;
> close (DATA);
> 
> ## Open the password file for reading
> open (PASS, $active_password);
> @passwords = <PASS>;
> close (PASS);
> 
> ## Separate out the deleted database entries.
> foreach $line(@database)
>         {
>         @account = split (/:/, $line);
>         if ($input{"$account[0]"} eq 'delete')
>                 {
>                 push (@deleted_passwords, $account[1]);
>                 next;
>                 }
>         else {push (@newdatabase, $line);}
>         }
> 
> ## Separate out the deleted password entries.
> foreach $line(@passwords)
>         {
>         $crypt_password = crypt ($line, aa);
>         foreach $word(@deleted_passwords)
>                 {
>                 if ($crypt_password eq $word) {next;}
>                 }
>         else {push (@newpasswords, $line);}
>         }
> 
> ## Create the revised database file.
> open (DATA, ">$active_database");
> foreach $line(@newdatabase)
>         {
>         if ($line =~ m/\n/) {chomp($line);}
>         print DATA "$line\n";
>         }
> close (DATA);
> 
> ## Create the revised password file.
> open (PASS, ">$active_password");
> foreach $line(@newpasswords)
>         {
>         if ($line =~ m/\n/) {chomp($line);}
>         print PASS "$line\n";
>         }
> close (PASS);
> 
> ## Return to the active accounts control panel.
> &active_panel;
> }
> 
> ##--------End Subroutine------------##
> 
> Sent via Deja.com http://www.deja.com/
> Before you buy.

You have chosen an 'unusual' indenting and formatting style which is not
helping you in spotting your syntax errors. I have reformatted your code
to a more conventional style (below), which immediately made the errors
obvious.

Whilst indenting and formatting style are a matter for the individual,
some styles make errors more visible, and hence become accepted as
useful and productive.

More seriously, you (attempt to) open files without any check for the
result of the action, e.g.
open (DATA, $active_database);
would be better coded as:
open (DATA, $active_database) || die "Could not open
$active_database...$!";

Further, the use of warnings ( -w ) would have revealed that your call
to crypt is flawed (the salt should be a string, not a bareword).

Since you self-proclaim yourself to be a newbie (and aren't we all for
certain values of 'new'), you should be enabling warnings (-w on the
shebang line) and also using strict mode.

Try 
perldoc perlstyle 
from your local command line.

##--------Begin Subroutine------------##

sub delete_accounts{
	## Open the database file for reading
	open (DATA, $active_database);
	@database = <DATA>;
	close (DATA);

	## Open the password file for reading
	open (PASS, $active_password);
	@passwords = <PASS>;
	close (PASS);

	## Separate out the deleted database entries.
	foreach $line(@database){
           @account = split (/:/, $line);
           if ($input{"$account[0]"} eq 'delete'){
               push (@deleted_passwords, $account[1]);
               next;
           }
           else{
               push (@newdatabase, $line);
           }
        }

	## Separate out the deleted password entries.
	foreach $line(@passwords){
           $crypt_password = crypt ($line, aa);
           foreach $word(@deleted_passwords){
              if ($crypt_password eq $word){
            	next;
              }
              #} removed surplus brace
              else{
        	push (@newpasswords, $line);
              }
            }
        } #added missing brace

	## Create the revised database file.
	open (DATA, ">$active_database");
	foreach $line(@newdatabase){
           if ($line =~ m/\n/){
              chomp($line);
           }
           print DATA "$line\n";
        }
	close (DATA);

	## Create the revised password file.
	open (PASS, ">$active_password");
	foreach $line(@newpasswords){
           if ($line =~ m/\n/){
              chomp($line);
           }
           print PASS "$line\n";
        }
	close (PASS);

	## Return to the active accounts control panel.
	#&active_panel;
}

##--------End Subroutine------------##

hth
-- 
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/


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

Date: Sat, 27 May 2000 01:36:30 -0700
From: Garth Grimm <gdgrimm@pacbell.net>
Subject: WinNT 4.0 file permissions
Message-Id: <392F890E.C8501E51@pacbell.net>

I've been using some perl scripts to automatically build a bunch of web
pages.  Then I installed MS Frontpage which went and rewrote all the
permissions on my files, including the db files that the perl scripts
use.  Now the perl scripts can't write to the files.  I could always
just rewrite the permissions back to Everybody (Full Control), but I'd
prefer to do one of the following.  Unfortunately, I don't know how to
do either.

1)  Have the 'account' the perl script executes in included in a group
with permission to modify the file.  Unfortunately, I can't figure out
what 'account' the script executes in -- 'System', the account of the
person who is logged in, what?

2) Add some code to the perl scripts to get them to run with higher
level privelges, sort of like setUID from the NIX world.  What would
this code segment be though?

Any help would be greatly appreciated.

Garth



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

Date: Sat, 27 May 2000 07:49:30 -0400
From: H C <carvdawg@patriot.net>
Subject: Re: WinNT 4.0 file permissions
Message-Id: <392FB64A.5CB7E0FF@patriot.net>

> 1)  Have the 'account' the perl script executes in included in a group
> with permission to modify the file.  Unfortunately, I can't figure out
> what 'account' the script executes in -- 'System', the account of the
> person who is logged in, what?

The CGI is generally executed under the anonymous user account...or, more
appropriately, whichever account the web server runs under.

> 2) Add some code to the perl scripts to get them to run with higher
> level privelges, sort of like setUID from the NIX world.  What would
> this code segment be though?

Instead of adding complexity by adding code that uses the Win32::Perms
module, it's would be appropriate to set your permissions up correctly.
Consult
the ActiveState help docs...there is information there on how to do this...



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

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


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