[8632] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2249 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 4 13:07:14 1998

Date: Sat, 4 Apr 98 10:00:23 -0800
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, 4 Apr 1998     Volume: 8 Number: 2249

Today's topics:
        5.004.004 won't configure on RH5 gatman@gate.nospam.net
        CGI.pm and &UNIVERSAL::isa called... <mefe@usa.net>
    Re: CGI.pm and &UNIVERSAL::isa called... <jdf@pobox.com>
    Re: changing perms w/CHMOD. (M.J.T. Guy)
    Re: changing perms w/CHMOD. <lr@hpl.hp.com>
    Re: contexts: is there such a thing as array? (M.J.T. Guy)
    Re: current week (M.J.T. Guy)
    Re: foreach loop & current element index (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
        help for a newbie?? <mm93064@central.ntua.gr>
    Re: How can I get the title from HTML file?, then how d <libub@erols.com>
        How can I get the title from HTML file? <seong@cse.bridgeport.edu>
    Re: How can I get the title from HTML file? (Todd Lehman)
    Re: How do I strip newlines from a var (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
    Re: How do I strip newlines from a var <rjk@coos.dartmouth.edu>
    Re: Is there a "Newsgroup" for Newbies to Perl? (Mark-Jason Dominus)
    Re: Overriding compile time builtins? (namely, "use") (M.J.T. Guy)
    Re: Overriding compile time builtins? (namely, "use") (Ilya Zakharevich)
    Re: perl 5 CGI with NT IIS3.0, this one is challenging  (David Green)
        Perl program...... email to HTML and vice-versa (Steven Fletcher)
    Re: Random numbers (Perl fails this test) <stackhou@execpc.com>
    Re: SIGINT ? (M.J.T. Guy)
    Re: Someone put my munged e-mail address on a spam list (John Stanley)
    Re: Urgent: Perl Win32 vs Unix Perl <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 04 Apr 1998 15:55:08 GMT
From: gatman@gate.nospam.net
Subject: 5.004.004 won't configure on RH5
Message-Id: <35265736.1792778@news.gate.net>

Compile won't work.  Can't find the fix in perl or Linux on this -
Anybody??

Thanks
John
gatman@gate.net


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

Date: Sat, 04 Apr 1998 07:05:58 -0800
From: "M.EFE" <mefe@usa.net>
Subject: CGI.pm and &UNIVERSAL::isa called...
Message-Id: <35264C55.C6016D43@usa.net>

Hello,
I installed CGI.pm 2.39 library on a UNIX server / Perl5.003

Then I tried a form handling script which parses inputs and prints on
the fly to pages, I got this error message:

&UNIVERSAL::isa called at /usr/local/lib/perl5/CGI.pm line 276

The script I tried starting with this:

use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);

use strict;


And The line that server is talking about is this:

276)          unless (defined($_[0]) &&
277)          (ref($_[0]) eq 'CGI' || UNIVERSAL::isa($_[0],'CGI')) #
slightly optimized for common case

Any help will be appreciated
Thanks in advance,
Sincerely





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

Date: 04 Apr 1998 13:12:48 -0400
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: CGI.pm and &UNIVERSAL::isa called...
Message-Id: <67kph5nz.fsf@mailhost.panix.com>

"M.EFE" <mefe@usa.net> writes:

> I installed CGI.pm 2.39 library on a UNIX server / Perl5.003

I can't say whether this will solve the problem you're experiencing,
but you are running a rather old version of perl.  You'll benefit
greatly by installing the latest, which can be found at

   http://www.perl.com/

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 4 Apr 1998 14:23:05 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: changing perms w/CHMOD.
Message-Id: <6g5fo9$14t$1@lyra.csx.cam.ac.uk>

Jason C. Hill <jhill@mitre.org> wrote:
>for $i (@other_dir) {
>    opendir THISDIR, $i;
>    @all_files = readdir THISDIR;
>
>    for $j (@all_files) {
>    ($dev, $ino, $mode, $nlink, $uid) = stat $j;
>        if ( $uid == 0 ) {
>
>
>        }
>   }  #end inner for
>   closedir THISDIR;
>}  #end out for

You obviously haven't tried that code, or anything similar.   $j is not
a full path name.    You need to write

     ($dev, $ino, $mode, $nlink, $uid) = stat "$i/$j";

(assuming a Unix platform  -  otherwise set the path separator accordingly).

And then follow Greg Bacon's advice on actually twiddling the bits.


Mike Guy


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

Date: Sat, 04 Apr 1998 08:05:58 -0800
From: Larry Rosler <lr@hpl.hp.com>
To: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>
Subject: Re: changing perms w/CHMOD.
Message-Id: <35265A66.EEE91646@hpl.hp.com>

M.J.T. Guy wrote:
> 
 ...
>     You need to write
> 
>      ($dev, $ino, $mode, $nlink, $uid) = stat "$i/$j";
> 
> (assuming a Unix platform  -  otherwise set the path separator accordingly).
> 
 ...

This is not sound advice.  The forward-slash directory separator works
fine using Perl on all platforms.  The back-slash works on some
platforms only, and requires noise-polluting extra escapes.

Perl is portable, and Perl code should be written portably, too,
whenever possible.

Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com


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

Date: 4 Apr 1998 14:06:13 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: contexts: is there such a thing as array?
Message-Id: <6g5eol$p4$1@lyra.csx.cam.ac.uk>

Randal Schwartz  <merlyn@stonehenge.com> wrote:
>Spider> Maybe.  If you can explain away this one:
>
>Spider> 	$a = @hash{'a','b','c','d'};
>
>A slice in a scalar context, by definition, returns the last element
>of that slice.  This falls out directly of the equivalent full-blown
>form:
>
>	$a = ($hash{a},$hash{b},$hash{c},$hash{d});
>
>where we see our friend, the comma operator, happily chugging away in
>this scalar context, returning $hash{d} after evaluating each of the
>other three.

Nope.   It isn't equivalent.   @hash{stuff} always provides a list
context for `stuff', even if the whole expression is in a scalar
context.   Those commas are list forming commas in Spider's example.

And Spider's example doesn't generate "Useless use of ..." while the
"equivalent" does.

Although you say "by definition" above, I can't actually find a
definition of the behaviour in this case in the Perl documentation.
There ought to be a form or words equivalent to

    An array or hash slice evaluated in a list context returns the
    list of selected elements;  an array or hash slice evaluated in
    scalar context yields the last of the selected elements.

But I can't find them anywhere.


Mike Guy


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

Date: 4 Apr 1998 15:15:40 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: current week
Message-Id: <6g5iqs$2c5$1@lyra.csx.cam.ac.uk>

Bob Trieger  <sowmaster@juicepigs.com> wrote:
>FRANCOIS GERT wrote:
>> Can anyone can give me a piece of code, or just a method I can
>> use to calculate the current weeknumber (1 - 52) ?
>> Can I use the localtime -function ?
>
>a start would be:
>
>	@date = localtime();
>	$week = $date[7]/7;

Nope.   Week number is rather more complicated than this; in particular
it depends on what day of the week Jan 1st fell on.

I don't have the exact rule to hand.


Mike Guy


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

Date: Sat, 04 Apr 1998 17:26:21 +0200
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: foreach loop & current element index
Message-Id: <lassehp-0404981726240001@ygdrasil.imv.aau.dk>

In article <891662953.954906@cabal>, ? the platypus {aka David Formosa}
<dformosa@st.nepean.uws.edu.au> wrote:

>In <Pine.SGI.3.95.980402102433.27534A-100000@vangogh.bergen.org> Jeff
Pinyan <jefpin@bergen.org> writes:
>>Currently, there are _no more_ puncuation variables left
>
>What about all the $^ ones, have these combernations been used up?

Or what if Perl changed to Unicode (or even just ISO-8859), wouldn't that
allow a myriad of (or with 8859 at least a sufficient number of) new
possibilities?

1/2 :-)

-Lasse


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

Date: 4 Apr 1998 16:30:45 GMT
From: "Manos Tsiavos" <mm93064@central.ntua.gr>
Subject: help for a newbie??
Message-Id: <01bd5fe7$a68a2f80$4cdf6693@default>

I use the Sambar server to "view" my perl scripts..
but when i used the function SYSTEM("tr.exe","trlist.dat"); in a cgi, it
failed to respond why?? (it opens command mode c:\Program files\sambar>)
and nothing happens :-(
(tr.exe is a DOS application that needs trlist's.dat elements to present an
output on the screen)
On the contrary when i launch the above perl script in "pure Perl
mode"(from an ms-dos prompt),   SYSTEM("tr.exe","trlist.dat");  works
fine..!!
Where is the problem??? 



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

Date: Sat, 04 Apr 1998 12:20:18 -0500
From: I-MAP <libub@erols.com>
To: Todd Lehman <lehman@visi.com>
Subject: Re: How can I get the title from HTML file?, then how do i get rest of them?
Message-Id: <35266BD2.A9B@erols.com>

Thanks Todd.

Sorry that I have one more question.
Acutually what i want is  a string for the title and a string for the
rest of the file.  Then how do I do that?

Sincerely
Seong Y. Kim
 
> Seong,
> 
> I can't tell how critical it is that $strings be collected and returned,
> or that the other lines be output, but if all you need is to extract the
> title, then here is one quick & dirty possibility...
> 
>    sub extract_title
>    {
>       my ($filename) = @_;
> 
>       local *HTML;
>       open HTML, "<$filename" or die;
>       local $/;
>       my ($title) = <HTML> =~ m{<TITLE>\s*(.*)\s*<\/TITLE>}si;
>       close HTML;
> 
>       return $title;
>    }
> 
> ...of course you might be better off using one of the HTML parsing modules at
> CPAN if you're going to be doing a lot of HTML work processing.
> 
> --Todd


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

Date: Sat, 04 Apr 1998 09:07:04 -0500
From: "Seong Y. Kim" <seong@cse.bridgeport.edu>
Subject: How can I get the title from HTML file?
Message-Id: <35263E88.81D8B0DC@cse.bridgeport.edu>

Hi, everyone!!!!

I am trying to get a title from one HTML file.  This is my subroutine
that I did.
This will read first line of the file and set to title.  It doesn't work
well.
Can some one help?  Do you have better subroutine?
Thanks

sub format_output{
    local ($file_path) = @_;
    local ($line, $strings, $title);
    (open(FILENAME, $file_path)) || print "can'topen $file_path in
file_format";

    print "Content-type: text/html\n\n";
    print "<html><body>";
    while( $line = <FILENAME>){
        if(length($line)){
                $line =~ s/\<(.*?)\>//g;
                $line =~ s/\n//g;
                $line =~ s/&nbsp\;|&lt\;|&gt\;//g;

        }
        if  (!$title && $line){
                if ( $line )  {
                $title = $line;
                print $title,"<br>";
                next;
        }
        $strings = $strings.$line;
        if (length($strings) >= 500){
                last;
        }
    }
    $strings  =~ s/\<(.*?)\>//g;
    $strings =~ s/\n//g;
    print "strings",$strings,"\n";
    print "</body></html>";
    close FILENAME;
    return $strings;

}



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

Date: Sat, 04 Apr 1998 15:26:36 GMT
From: lehman@visi.com (Todd Lehman)
Subject: Re: How can I get the title from HTML file?
Message-Id: <MisV.6$Nr1.135576@ptah.visi.com>

Seong Y. Kim <seong@cse.bridgeport.edu> writes:
> Hi, everyone!!!!
>
> I am trying to get a title from one HTML file.  This is my subroutine
> that I did.
> This will read first line of the file and set to title.  It doesn't work
> well.
> Can some one help?  Do you have better subroutine?
> Thanks
>
> sub format_output{
>    local ($file_path) = @_;
>    local ($line, $strings, $title);
>    (open(FILENAME, $file_path)) || print "can'topen $file_path in file_format";
>
>    print "Content-type: text/html\n\n";
>    print "<html><body>";
>    while( $line = <FILENAME>){
>        if(length($line)){
>                $line =~ s/\<(.*?)\>//g;
>                $line =~ s/\n//g;
>                $line =~ s/&nbsp\;|&lt\;|&gt\;//g;
>
>        }
>        if  (!$title && $line){
>                if ( $line )  {
>                $title = $line;
>                print $title,"<br>";
>                next;
>        }
>        $strings = $strings.$line;
>        if (length($strings) >= 500){
>                last;
>        }
>    }
>    $strings  =~ s/\<(.*?)\>//g;
>    $strings =~ s/\n//g;
>    print "strings",$strings,"\n";
>    print "</body></html>";
>    close FILENAME;
>    return $strings;
>
> }


Seong,

I can't tell how critical it is that $strings be collected and returned,
or that the other lines be output, but if all you need is to extract the
title, then here is one quick & dirty possibility...

   sub extract_title
   {
      my ($filename) = @_;

      local *HTML;
      open HTML, "<$filename" or die;
      local $/;
      my ($title) = <HTML> =~ m{<TITLE>\s*(.*)\s*<\/TITLE>}si;
      close HTML;

      return $title;
   }

 ...of course you might be better off using one of the HTML parsing modules at
CPAN if you're going to be doing a lot of HTML work processing.

--Todd


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

Date: Sat, 04 Apr 1998 16:57:07 +0200
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: How do I strip newlines from a var
Message-Id: <lassehp-0404981657080001@ygdrasil.imv.aau.dk>

In article <3525D2F4.ACE574CC@coos.dartmouth.edu>, rjk@coos.dartmouth.edu wrote:
>Lasse Hillerxe Petersen wrote:

>> [rant rant rant]
>
>Up yours.

Your choice of words reflects on you and does not impress me.

>  I found Abigail's suggestion informative, creative, and quite
>amusing.

Your definition of "informative" must be strange, so I have to ask you in
what way do you think Abigail's "answer" was informative? As for its
creativity, I think it's on par with graffiti: considered creative in its
own subculture, but ugly and destructive by most other people. And what
you found amusing made me feel a bit sick and quite depressed, so your
sense of humor must be strange too.

>Answering blatantly obvious questions with blatantly non-obvious
>solutions is a harmless means of defusing frustration at the newbies who post
>such questions, and also an entertaining way to demonstrate your skill at
>hacking Perl.

I don't agree with your assumption that this is a harmless means of
defusing frustration. I find stupid answers are just as frustrating as
stupid questions. So now I get frustrated by both newbies _and_ by people
who at other times post highly intelligent articles. I find that
depressing. My "rant" was a concern that the Perl community is becoming a
place where "demonstrating your skill at hacking perl" is more important
than "helping people help Perl help people".

I don't consider it helpful to throw clever hacks and rude remarks at a
person who asks an extremely stupid, but most likely sincere question. I
refuse to believe that newbies post such stupid questions because they
want to annoy other people, so trying to scare them by humiliating them in
public does not achieve anything, except maybe some of them turn away from
Perl in disgust. If a newbie had read the group and seen how they are
treated, I doubt he would post. So naturally, the newbies that _do_ post,
have most likely _not_ seen this treatment.

>Ask a stupid question, get a stupid answer.  (Only we go one better; we give
>intelligent, if obtuse, answers.  ;-)

So you want to fight stupidity with stupidity? I suppose being stupid will
help in that case.

>BTW, your newsreader appears to be attributing quoted text with the pronoun
>"you" instead of the sender's name or email address.  Odd.

I edited the attribution because I first intended to mail the reply only.
However, I decided to post as well, forgetting to reinstate it. Sorry if
this has caused any confusion.

-Lasse


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

Date: Sat, 04 Apr 1998 10:50:19 -0500
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: "LasseHillerxePetersen" <lassehp@imv.aau.dk>
Subject: Re: How do I strip newlines from a var
Message-Id: <352656BC.242401EC@coos.dartmouth.edu>

[posted and mailed]

[For context...]
Abigail wrote:
> $var=join+q,,,grep{ord${qq$\137$}<10 or+10<ord}split+q,,,$var;

Lasse Hillerxe Petersen wrote:
> 
> In article <3525D2F4.ACE574CC@coos.dartmouth.edu>, rjk@coos.dartmouth.edu wrote:
> >Lasse Hillerxe Petersen wrote:
> 
> >> [rant rant rant]
> >
> >Up yours.
> 
> Your choice of words reflects on you and does not impress me.

That's okay, I expected such and wrote it that way anyway.  :-)

> >  I found Abigail's suggestion informative, creative, and quite
> >amusing.
> 
> Your definition of "informative" must be strange, so I have to ask you in
> what way do you think Abigail's "answer" was informative? 

"Informative" does not mean "simplest" or "most obvious".
What do we learn from Abigail's one-liner?
You can use the unary + operator instead of whitespace.
You can use q,, as the first argument to a list operator to create a minor
obfuscation with the subsequent , operator.
${\137} is a symbolic reference to the oft-used $_ variable.
You can remove unwanted pieces of a string by splitting it, grepping for the
parts you want to keep, and then joining it back together.
ord 10 is the line feed character.

Some of those are generally useful, and as to the others...  Ever hear of the
Obfuscated Perl Contest?

> As for its
> creativity, I think it's on par with graffiti: considered creative in its
> own subculture, but ugly and destructive by most other people. And what
> you found amusing made me feel a bit sick and quite depressed, so your
> sense of humor must be strange too.

Well, since comp.lang.perl.misc is part of the Perl subculture, I expect that
it would be considered creative in this newsgroup.
And how is it destructive, hmm?  Abigail even directed the newbie to the
manual, should he be unsatisfied with her tricky solution.

> >Answering blatantly obvious questions with blatantly non-obvious
> >solutions is a harmless means of defusing frustration at the newbies who post
> >such questions, and also an entertaining way to demonstrate your skill at
> >hacking Perl.
> 
> I don't agree with your assumption that this is a harmless means of
> defusing frustration. I find stupid answers are just as frustrating as
> stupid questions. So now I get frustrated by both newbies _and_ by people
> who at other times post highly intelligent articles. I find that
> depressing. My "rant" was a concern that the Perl community is becoming a
> place where "demonstrating your skill at hacking perl" is more important
> than "helping people help Perl help people".

Okay, who is it harming?

As we've said over and over again, clpm helps people who help themselves.  If
they're too lazy to look things up in the manual or the FAQ, I feel no
obligation to do that work for them.

And you know what?  clpm is *not* a help desk.  Notice the last word: "misc". 
Not "questions" or "help" or "newbies".  We can discuss *anything* we want to
concerning Perl in this newsgroup.  And sometimes, we want to discuss hacking
and obfuscation.  Live with it.

> I don't consider it helpful to throw clever hacks and rude remarks at a
> person who asks an extremely stupid, but most likely sincere question. I
> refuse to believe that newbies post such stupid questions because they
> want to annoy other people, so trying to scare them by humiliating them in
> public does not achieve anything, except maybe some of them turn away from
> Perl in disgust. If a newbie had read the group and seen how they are
> treated, I doubt he would post. So naturally, the newbies that _do_ post,
> have most likely _not_ seen this treatment.

I didn't say it was helpful.  ;-)

And you're propagating another fallacy.  "Newbies" are not treated this way. 
People who post questions which have clear and simple answers in the
documentation are treated this way.  Not all newbies post such questions, and
not all such questions are posted by newbues.

> >Ask a stupid question, get a stupid answer.  (Only we go one better; we give
> >intelligent, if obtuse, answers.  ;-)
> 
> So you want to fight stupidity with stupidity? I suppose being stupid will
> help in that case.

Read the parenthetical comment, please, and note the word "intelligent".

Any programmer, even a stupid one, could supply the answer tr/\n//d;  But it
takes someone clever and experienced to come up with Abigail's
$var=join+q,,,grep{ord${qq$\137$}<10 or+10<ord}split+q,,,$var;

:-)

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 4 Apr 1998 11:54:26 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <6g5ok2$r74$1@monet.op.net>

In article <352426cb.77422537@news.mmc.org>,
Jeffrey Drumm <drummj@mail.mmc.org> wrote:
>On 2 Apr 1998 08:37:16 -0800, smitty77@pacbell.net wrote:
>all the gurus will have fled to the
>moderated group currently under discussion. I'll follow them, because I
>want to learn. The newbies won't, because moderation won't let them.

It was never the intent of the moderated group to exclude new users,
or questions from new users.

It's only the intent to exclude questions like `how do I remove a
file' which are trivially answered by looking in the documentation, or
questions which are FAQs, or questions which are essentially unrelated
to Perl.

The moderated group is not about setting up a hierarchy of who's
allowed to speak and who isn't.  Nor is it about making a private club
for experts only.



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

Date: 4 Apr 1998 14:56:33 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Overriding compile time builtins? (namely, "use")
Message-Id: <6g5hn1$1ss$1@lyra.csx.cam.ac.uk>

Zenin  <zenin@archive.rhps.org> wrote:
>Is there anyway to override compile time builtins, namely "use"?
>Method to my madness:
>
>	I'd like to extend use to be able to search compressed file
>	archives for modules and maybe even be able to use URLs
>	as well to locate them, ala Java's "jar" files and such.  I
>	thought about creating a "loadmod" function, however this
>	would meen that I'd have to change every use statement in
>	every module including the core modules.  So much for
>	reusability. :-/

This subject has been kicked around on perl5-porters.   The basic idea
is to allow objects in @INC as well as directory names.   Then a
use or require search will call an appropriate method which can
get the module from wherever it likes.

So to handle compressed archives, you'd write a class which did the
uncompressing, and put an object of that class in @INC.

Don't know if / when this extension will go into Perl.   The actual
change is quite minor, so it _could_ go into perl 5.005.


Mike Guy


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

Date: 4 Apr 1998 15:28:35 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Overriding compile time builtins? (namely, "use")
Message-Id: <6g5jj3$knn$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Sneaker's Nest 
<sneaker@mediaone.net>],
who wrote in article <3522D59D.49CC@mediaone.net>:
> I do no the answer, however I would be interested in considering the
> impact on system performamce as the only way I can think of is
> duplicating similar funcnality to this -
> 
> use { `gzip -d perlmods.tgz | tar t - | grep modwanted` }
> 
> Or some such.  When I use the first two thirds my Ultrasparc hates me
> for a while...

This is a part of "not invented here" syndrom.  Each trade has its
tools.  If you want random access, use zip/unzip.

Ilya


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

Date: Sat, 04 Apr 1998 16:58:34 GMT
From: dgreen@uab.edu (David Green)
Subject: Re: perl 5 CGI with NT IIS3.0, this one is challenging ...
Message-Id: <MPG.f9022a1fbc1e46a989692@news.atl.bellsouth.net>

In article <6fb7fn$d6j$1@tenax.raex.com>, pcbob@raex.com says...

<snip>

> 
> Even with the NT Authentication the cgi still runs as the anonymous user.
> The revision directory MUST be read only access for the anonymous user.
> 
> 1. How do I tell perl to run the cgi script as Administrator or another user
> that
>     has write access to the revision directory ?
> 
> 2. How do I get the sever to know that the cgi is to be run as the
> Authenticated
>     User and not as the anonymous user ?
> 
> Thanks Again for any help you can give !
> Bob Waris
> bwaris@comintertech.com
> Information Systems Specialist
> Commercial Intertech Corp.
> 

Really a CGI question for a different NG but...

Basically, check the username from IIS, if none (anonymous), send the 
HTTP stuff to say back to the browser that it needs to authenticate.

The browser should send the right stuff to authenticate which will give 
you the user name and you will be off and running.

Regards,

Dave

-- 
David G. Green    mailto:dgreen@uab.edu
UAB Electrical and Computer Engineering
Birmingham, AL  35294-4461



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

Date: Sat, 04 Apr 1998 15:22:24 GMT
From: ircadmin@shellnet.co.uk (Steven Fletcher)
Subject: Perl program...... email to HTML and vice-versa
Message-Id: <35264f03.14669283@news.shellnet.co.uk>

Greets........

I am looking for a program (preferably written in perl) that would
allow users to retrive their email over the WWW, via CGI and a few
login boxes.

Does anyone know of such a program?

TIA;

-Steven Fletcher (steven@shellnet.co.uk)


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

Date: Sat, 04 Apr 1998 08:06:02 -0600
From: Mark Stackhouse <stackhou@execpc.com>
Subject: Re: Random numbers (Perl fails this test)
Message-Id: <6g5f0u$ki4@newsops.execpc.com>

This looks interesting.  Could you please explain why these numbers where chosen
as variables?  I'd like to understand why these particular numbers where
chosen:)

Thanks
--
Mark Stackhouse

***********************************************************************

homepage: http://www.execpc.com/~stackhou

"The best things in life aren't things."
--Art Buchwald

***********************************************************************

Excession wrote:
> 
> On 3 Apr 1998 15:11:53 -0800, rokicki@cello.hpl.hp.com (Tom Rokicki) wrote:
> 
> >Perl's random numbers (from rand()) are atrocious---almost useless.
> >They just aren't very random.
> 
> Try this:
> $s1 = time();
> $m=2147483647;
> $q=127773;
> $a=16807;
> $r=2836;
> 
> for(1..100){print &r()};
> 
> sub r{
>    $h=$s1/$q;$l=$s1%$q;$t=$a*$l-$r*$h;if($t>0){$s1=$t}else{$s1=$t+$m}
> }
> 
> ---
> David Andrew Clayton     # Please remove NO_SPAM when
> dac@NOSPAM.pcug.org.au   # sending email replies.
> I post therefore I am.   #


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

Date: 4 Apr 1998 14:33:22 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: SIGINT ?
Message-Id: <6g5gbi$1di$1@lyra.csx.cam.ac.uk>

Phil R Lawrence <prl2@lehigh.edu> wrote:
>Jonathan Feinberg wrote in message <4t0ashy0.fsf@mailhost.panix.com>...
>>The perlipc doc suggests that on SYSVish systems (and therefore in
>>the minds of all portability-minded scripters) you'll need to
>>reinstall the signal handler, e.g.,
>>
>>   sub HANDLE_SIGINT {
>>      print "Ouch, that smarts.\n";
>>      $SIG{INT} = \&HANDLE_SIGINT;
>>   }
>
>
>Hmm.  Actually,
>
>sub int_handler {
>    print "Handled!\n";
>    main();
>    $SIG{"INT"} = \&int_handler;
>}
>
>gives same result as without reinstalling.

Apart from the possible need for reinstatement of the signal handler,
you aren't exiting from the signal handler.    Perl won't accept
another INT signal until the previous handler has completed.

So you can't just call main() in the handler.    You'll have to set a
flag in the handler and test it in the main line.    Or do a die in
the handler and use eval to trap it.

And remember that, in current Perls, signals are inherently unreliable.
Use them as little as possible, and only do the simplest things in
the signal handler.


Mike Guy


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

Date: 4 Apr 1998 16:48:58 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Someone put my munged e-mail address on a spam list
Message-Id: <6g5o9q$8gr$1@news.orst.edu>

In article <891686800.706026@cabal>,
? the platypus {aka David Formosa}  <dformosa@st.nepean.uws.edu.au> wrote:
>In <6g4hug$5k0$1@news.orst.edu> stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>
>>In article <891661616.31034@cabal>,
>>? the platypus {aka David Formosa}  <dformosa@st.nepean.uws.edu.au> wrote:
>>>However Usenet grew out of a mail system and is tightly it.
>
>>As for USENET being "tightly it", I have no idea what you mean.
>
>Oops I dropped a word there "and is tightly bound to it."

Two words, and you are still wrong.

>>USENET works even when email does not. There is no such assumption.
>
>Usenet the propergation dose,  Usenet the culture doese not.

The "culture" works just fine without mail.

>>There is no such "need". Some people desire it, but that does not make
>>it a need.
>
>It is needed for the culture to work.

Nonsense. If it were such a mandatory part of the process, then news
systems would have always enforced authentication of From: headers. The
news system authors didn't consider it important to authenticate the
From: header, so apparently the email address there isn't as important
as it is being made out to be.

>>What is an "intermasy"?
>
>Intermasy,  being close to someone else.

I'm sorry, not a single one of the dictionaries I have access to knows
the word "intermasy". Yes, I suppose mail is "close" to news because
you can enter a command to the newsreader to send mail, and both are
subject to RFC 822 for message format, but that's about it.  

Mail is as close to news as ftp is to gopher. Just cause web browsers
access both doesn't make them the same.



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

Date: Sat, 4 Apr 1998 08:49:43 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Urgent: Perl Win32 vs Unix Perl
Message-Id: <6g5o6s$og5@bgtnsc03.worldnet.att.net>


J. Probert wrote in message <3525e058.418441@news.saix.net>...
>Hello all,
>
>I have a situation in which I need to make a decision urgently, and
>any guidance will be much appreciated.
>


<snip>

>The service provider who quoted on the hosting of this site is busy
>preparing their side for the upload, and have informed me that all the
>Perl scripts will be placed on their Unix machine, the rest of the
>Frontpage stuff will be on an NT machine.
>Their reason is that Perl Win32 is "buggy, and more than capable of
>causing NT to crash, and Perl is more stable on Unix", and they are
>not prepared to put their other clients hosted on that NT machine at
>risk.
>

Find a different service provider. If they're the only game in town I
suppose you'd have to follow their rules, but I don't think Perl on Win32 is
any more buggy than any other piece of software. I don't know the relative
stability of Perl/Unix vs. Perl/Win32, but enough people are using
Perl/Win32 and getting enough work done that it can't be as horrible as they
make it out to be.

Of course if you have to make massive changes to your web site, you have
access to Perl to do it . . .    :D





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

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

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