[15957] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3369 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 15 09:10:30 2000

Date: Thu, 15 Jun 2000 06:10:19 -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: <961074619-v9-i3369@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 15 Jun 2000     Volume: 9 Number: 3369

Today's topics:
    Re: Help with strings <noone@nowhere.org>
    Re: Help with strings <noone@nowhere.org>
    Re: Help with strings <noone@nowhere.org>
    Re: How to check browser for Javascript enable? <bill.kemp@wire2.com>
    Re: How to check browser for Javascript enable? <bill.kemp@wire2.com>
    Re: how to find what modules are available in a server <scott@industrial-linux.org>
    Re: Infinity ? <iltzu@sci.invalid>
    Re: Infinity ? <gaborit@enstimac.fr>
    Re: Is there a NET::Time call to get remote time. Or so <henry@penninkilampi.net>
    Re: Is there a NET::Time call to get remote time. Or so (hymie!)
    Re: my vs. our (Anno Siegel)
    Re: need recommended Perl hosting urgently <latsharj@my-deja.com>
    Re: NET::SMTP <tschilbach@aodinc.com>
    Re: NET::SMTP <tschilbach@aodinc.com>
    Re: Pattern matching - case sensitive/insensitive (Rafael Garcia-Suarez)
    Re: Protect and HTML page? (Jukka Korpela)
    Re: Protect and HTML page? <scott@industrial-linux.org>
        sendmail in Win32 <cleverest@bitsmart.com>
    Re: simple pattern matching question <debjit@oyeindia.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 15 Jun 2000 11:24:56 GMT
From: "Mike Ray" <noone@nowhere.org>
Subject: Re: Help with strings
Message-Id: <c2325.31896$hp4.761167@newsread1.prod.itd.earthlink.net>


Tad McClellan wrote in message ...
>On Wed, 14 Jun 2000 03:24:35 GMT, Mike Ray <noone@nowhere.org> wrote:
>
>>I have a problem with string comparisons which has me climbing the
>>walls. I've exhausted all I can think to do to resolve the problem(s).
>
>
>Did that include "use strict" and -w?

Yup.

>>Help would be much appreciated. My environment is Perl 5.004 on Unix.
>>The code that is giving me problems is as follows:
>>
>>for( $k = 0; $k <= $#PLines; $k++) {
>>    if ($PLines[$k] =~ /FORMNAME/) {
>>        $PLines[$k] =~ /=(.+?)\]/;
>>        if ($Form{'FORMID'} eq $1) {          #THIS LINE ALWAYS FAILS
>
>
>You should *never ever* use the dollar-digit variables unless
>you first test to see if the match succeeded.
>
>They are only updated if the match succeeds. If it fails, they
>will have whatever they had in them before the pattern match.


Duh...this I know. The test for success was removed as a simplification.
Because the test data supplied to the script has known valid data, I
know that $1 *MUST* contain a valid result, and, in fact, printing $1
confirms this. For some reason the match is returning whitespace in $1
that does not exist in the string and is therefore causing the "if"
comparison to fail.




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

Date: Thu, 15 Jun 2000 11:51:50 GMT
From: "Mike Ray" <noone@nowhere.org>
Subject: Re: Help with strings
Message-Id: <qr325.32102$hp4.762838@newsread1.prod.itd.earthlink.net>


Bart Lateur wrote in message <39495c46.4485779@news.skynet.be>...
>Mike Ray wrote:
>
>> if $foo contains the string 'NLD_Inquiry' the result of the
>>"length" function is 17 - longer than the expected 11.
>
>It does sound as if you have invisible characters. Try a hex dump.
>
> local ($, , $\) = (" ", "\n");
> print map { sprintf '%02X', $_ } unpack 'C*', $foo;
>
>for 'NLD_Inquiry', I get:
>
> 4E 4C 44 5F 49 6E 71 75 69 72 79

Thanks. A hex dump is the only thing I hadn't done. I did a hex dump and
got the following:

20 4E 4C 44 5F 49 6E 71 75 69 72 79 09 20 20 20 20

which turns out to be 17 bytes as reported by 'length'. The problem is
the leading and trailing whitespace is NOT preset in the searched string
(as confirmed by a hex dump). The searched string contains
"[FORMNAME=NLD_Inquiry]" so the match result in $1 should be
"NLD_Inquiry" without the leading and trailing whitespace. At this point
I'm stumped as to why this whitespace is introduced into the $1 variable
by the match operation.

In earlier debugging I had attempted to remove any whitespace (even
though there is not any in my test data) with the following:

$foo = $1;
$foo =~ tr/\s//; (and $foo =~ tr/\s//d;)

which obviously, in hindsight, failed to remove whitespace (as confirmed
by a hex dump). However, if I strip whitespace as follows:

$foo = $1;
$foo =~ s/\s//g;

the whitespace is removed and everything works fine. This effectively
"fixes" the problem. However, the point is that there shouldn't be a
problem to begin with as the whitespace introduced by the match
operation should not be there at all!

Also, I do not understand why "tr/\s//" failed to remove whitespace
while "s/\s//g" did remove whitespace. Are not these two expressions
equivalent?

At this point I'm just running in circles trying to resolve this problem
without applying suppression of whitespace after the match operation as
it is: 1) unnecessary as the data will never contain whitespace, and 2)
the match operator should extract a string without itself adding
whitespace that did not exist in the original string.

Something is wrong but I have not a clue as to what at this point.

Any relevant input is appreciated.


>>The line with the assignment to the $length1 variable
>>causes Perl 5.004 to crash and terminate my script.
>
>As for a "crash"... in CGI context, this could simply mean a warning
>which makes the server abort... Are you sure that the variable you're
>taking the length of, isn't simply undefined?


I found the problem. Left out the closing right paren on the "length"
function...duh. The result of spending way too much time debugging a
problem that shouldn't exist.

Mike




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

Date: Thu, 15 Jun 2000 11:59:49 GMT
From: "Mike Ray" <noone@nowhere.org>
Subject: Re: Help with strings
Message-Id: <Vy325.32163$hp4.762985@newsread1.prod.itd.earthlink.net>

Hey Godz, are you smoking some whacky weed or do you just like to hear
yourself type? (Or maybe even both?.) Sheesh!

I guess you are trying to be helpful, but you haven't even begun to
address my question and apparently didn't RMFP (read my f*ing post).

Man you are off-the-wall!!!

Godzilla! wrote in message <3947326F.5F645C47@stomp.stomp.tokyo>...
>Mike Ray wrote:
>
>(snipped - context retained)
>
>> The code that is giving me problems is as follows:
>
>>  if ($PLines[$k] =~ /FORMNAME/) {
>>  $PLines[$k] =~ /=(.+?)\]/;
>>  if ($Form{'FORMID'} eq $1) { #THIS LINE ALWAYS FAILS
>
>
>Your line which always fails relies on
>two items matching. Logic dictates you
>test those two items, as a small module.
>
>Two of many very powerful tools we can
>create ourselves, are a simple print
>and replication of an abstract of a
>script, that portion with a problem.
>
>Logic dictates you print out both
>your variables you are trying to
>match, FORMID and $1 then look
>at them, visually. Otherwords,
>visually verify what is happening.
>
>Piece of cake, yes?
>
>
> if ($PLines[$k] =~ /FORMNAME/)
>  {
>   $PLines[$k] =~ /=(.+?)\]/;
>
>   print "PLines Is: $PLines[$k]",
>         "FORMID Is: $Form{'FORMID'}",
>         "Variable \$1 Is: $1";
>
>   if ($Form{'FORMID'} eq $1)
>

>
>Get the idea? Just a matter of pulling
>out only that part of your script you
>need to create those variables, under
>realistic conditions, leaving out all
>else possible. Test your script for
>this functional part only via a print
>to your screen. Wallah! Instant answer.
>Well, lots of answers with your loop
>in operation. Doesn't matter though
>does it? Multiple prints but only
>one clear answer, in reality. Maybe
>you could kill the loop? last; ??
>
>Finding an answer is no more difficult
>than rolling up your sleeves and doing
>a bit of copy and paste along with a
>bit of typing to create a test script.
>
>Down below you will see printed results
>and a test script I wrote to verify your
>style of programming does, in fact, work.
>I knew right off, it would. Still, for
>me, I want to know with absolute certainty.
>If I can take time out to write a bit of
>a script to test a few things before making
>a post in response, you sure can put out
>some effort to test a few things yourself.
>
>Write yourself a test script and find out
>exactly what is going on at that stage
>of your program where you have problems.
>
>=) <-- That is a smile face, ok?
>
>Now get busy and resolve this bug.
>
>
>Godzilla!
>
>
>
>PRINTED RESULTS
>_______________
>
>Begin Test
>
>     Variable 1 Is: Kira
>
>     Variable 2 Is: 123GAK!456
>
>     Variable 3 Is: GAK!
>
>Inside IF:
>
>     Variable 1 Is: Kira
>
>     Variable 2 Is: 123GAK!456
>
>     Variable 3 Is GAK!
>
>     Variable $1 Is: GAK!
>
>Success: GAK! Kira is a geek!
>
>
>
>TEST SCRIPT
>___________
>
>#!/usr/local/bin/perl
>
>print "Content-Type: text/plain\n\n";
>
>$variable1 = "Kira";
>$variable2 = "123GAK!456";
>$variable3 = "GAK!";
>
>print "Begin Test\n
>     Variable 1 Is: $variable1\n
>     Variable 2 Is: $variable2\n
>     Variable 3 Is: $variable3\n\n";
>
>if ($variable1 =~ /Kira/)
> {
>  $variable2 =~ /[0-9]+([a-zA-Z!]+)[0-9]+/;
>
>  print "Inside IF:\n
>     Variable 1 Is: $variable1\n
>     Variable 2 Is: $variable2\n
>     Variable 3 Is $variable3\n
>     Variable \$1 Is: $1\n\n";
>
>  if ($variable3 eq $1)
>   {
>    print "Success: $variable3 $variable1 is a geek!\n\n";
>   }
>  else
>   {
>    print "Failure: Oh Fudge!\n\n";
>   }
> }
>
>exit;




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

Date: Thu, 15 Jun 2000 11:25:21 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: How to check browser for Javascript enable?
Message-Id: <961064833.1390.0.nnrp-14.c3ad6973@news.demon.co.uk>

<snip>
>The main point is that you need to do server-side validation of the form
>input *regardless* of whether the user's browser supports JavaScript, for


<snip>

not me actually, I remember being five years old, and having a classmate
saying 'open your eyes and shut your mouth' ...




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

Date: Thu, 15 Jun 2000 11:29:12 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: How to check browser for Javascript enable?
Message-Id: <961065063.1531.0.nnrp-14.c3ad6973@news.demon.co.uk>

<snip>
>Meantime the user, seeing that their browser was noodling away doing
>something they hadn't expected to happen, would turn off Javascript,
>and leave you up sh** creek without a paddle.


The commercial folks assure me that the users will have Javascript turned on
anyway.
I feel uneasy.

>That's what <NOSCRIPT> is for.  Write your page so that it works
>usefully with or without javascript, then the whole idea of the server
>needing to know whether it's enabled or not is irrelevant.

<snip>

ahh.
recent change of policy from 'no javascript' to 'needs javascript' leaves me
rather green.




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

Date: Thu, 15 Jun 2000 07:51:43 -0600
From: "scott thomason" <scott@industrial-linux.org>
Subject: Re: how to find what modules are available in a server
Message-Id: <zj425.139$Sf1.54864@feed.centuryinter.net>

Assuming you're on a *nix platform, you can do a "find" command. If you do a
"perl -V", you'll get a listing that includes the directories automatically included
in your @INC. You'll probably find that all but two are actually under the same root dir.
Just do a "find <dir> -name \*.pm" (where <dir> is replaced by the aforementioned 
directories) and you'll have what you're looking for.

There's probably a Perl module to do this, too, but I don't have enough headroom
to memorize everything.

Automating this with Perl is left as an exercise for the reader.
---scott


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

Date: 15 Jun 2000 10:22:58 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Infinity ?
Message-Id: <961063783.19341@itz.pp.sci.fi>

In article <8ia539$3gb$1@towncrier.cc.monash.edu.au>, Damian Conway wrote:
>So build your infinity out of machine-dependent components:
>
>	$inf = (~0)**(~0); 

And exactly what is this supposed to accomplish?

  $ perl -le 'print (~0)**(~0)'
  4294967295

Not the -1 I was expecting, but not infinity either.

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.




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

Date: 15 Jun 2000 14:13:30 +0200
From: Paul GABORIT <gaborit@enstimac.fr>
Subject: Re: Infinity ?
Message-Id: <r7og53qh05.fsf@enstimac.fr>

Julien Quint <julien.quint@xrce.xerox.com> writes:

> Hi Paul, to follow-up on that I noticed something else:
> 
> > perl -e 'printf "%f\n", 2**1024'
> Inf

perldoc -f sprintf :

             Returns a string formatted by the usual `printf'
             conventions of the C library function `sprintf'.
             See sprintf(3) or printf(3) on your system for an
             explanation of the general principles.

Ok. 'Inf' comes from my C library (like NaN).
> 
> as you see you get "Inf" instead on Infinity.
> 
> > PS: i can't find the word 'Infinity' in source codes of Perl...:-(
> 
> Maybe just "Inf" then?

	> perl -le 'print 2**1024'
	Infinity
	>

How and where perl finds the word 'Infinity' ?

With MacPerl, i obtained 'Inf' instead of 'Infinity'...

-- 
Paul Gaborit - <http://www.enstimac.fr/~gaborit/>
Perl en français - <http://www.enstimac.fr/Perl/>


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

Date: Thu, 15 Jun 2000 20:59:25 +0930
From: Henry <henry@penninkilampi.net>
Subject: Re: Is there a NET::Time call to get remote time. Or something like that
Message-Id: <henry-7ECC3F.20592515062000@news.metropolis.net.au>

In article <8i9rgh$o5f$1@newsflash.concordia.ca>, 
nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar) wrote:

>> Is there a call to retrieve the time from a system (port 13 I think)
>> - Maybe in NET or something like that. I can't find anyting, but
>> that doesn't mean anyting.
> 
> You're thinking of Network Time Protocol (NTP), on port 123.
> 
> I don't know of anything perlish to handle NTP. Typically you use ntpd
> to getting the whole system in sync rather than just a user program. 
> Assuming we're talking unix.


NAME

Net::Time - time and daytime network client interface 

SYNOPSIS

    use Net::Time qw(inet_time inet_daytime);

    print inet_time();          # use default host from Net::Config
    print inet_time('localhost');
    print inet_time('localhost', 'tcp');

    print inet_daytime();       # use default host from Net::Config
    print inet_daytime('localhost');
    print inet_daytime('localhost', 'tcp');

Henry.


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

Date: 15 Jun 2000 14:38:06 GMT
From: hymie@lactose.smart.net (hymie!)
Subject: Re: Is there a NET::Time call to get remote time. Or something like that
Message-Id: <8iapoe$n1e$1@news.smart.net>

In our last episode, the evil Dr. Lacto had captured our hero,
  nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar), who said:
>In article <anZ15.23$1x4.1433@nsw.nnrp.telstra.net>,
>Robert Chalmers <robert@chalmers.com.au> wrote:
>>Is there a call to retrieve the time from a system (port 13 I think) - Maybe
>>in NET or something like that. I can't find anyting, but that doesn't mean
>>anyting.
>
>You're thinking of Network Time Protocol (NTP), on port 123.

How do you know what he's thinking, when his request is crystal clear?

I adapted this from another program.  I don't know how robust it is,
but it works for me.  I'm sure I copied the original out of a book.  YMMV.

=== 8< === 8< ===
#!/usr/bin/perl

require 5.002;
use Socket;

$remote = 'bwi_gate';
$port = 13;
$iaddr = inet_aton($remote);
$paddr = sockaddr_in($port, $iaddr);
$proto = getprotobyname('tcp');

socket (SOCK, PF_INET, SOCK_STREAM, $proto) or die "socket: $!";
connect (SOCK, $paddr) or die "connect: $!";

$oldFH=select(SOCK);
$|=1;
select ($oldFH);
$line = <SOCK>; 
print $line;   
=== 8< === 8< ===

When I run this, I get
erich-x:~> ./timetest.pl 
Thu Jun 15 08:38:20 2000

hymie!          http://www.smart.net/~hymowitz          hymie@lactose.smart.net
===============================================================================


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

Date: 15 Jun 2000 12:08:53 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: my vs. our
Message-Id: <8iah0l$9dh$1@lublin.zrz.tu-berlin.de>

Bart Lateur <bart.lateur@skynet.be> wrote in comp.lang.perl.misc:

[excellent explanation snipped]

>The stashes contain all global variables. local() *temporarily* saves
>and clears a global variable; it will be restored at the end of that
>block.

Just one nit to pick: unlike my(), local() is really concerned with
values, not variables.  That is, you can local()ize individual array
or hash elements. Witness

my @a = qw( a b c);
{
  local $a[ 1];
  $a[ 1] = 1;
  print "@a\n";
}
print "@a\n";

a 1 c
a b c

You can't do that with my(); it expects one or more variables and
everything else is a syntax error.

While this feature is unlikely to be of much practical use, i think
it bears mentioning in this context.

Anno


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

Date: Thu, 15 Jun 2000 12:22:23 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: need recommended Perl hosting urgently
Message-Id: <8iahpj$mgu$1@nnrp1.deja.com>

In article <8ia7ub$595$1@pacifica.access.ch>,
  "Reto H." <no_spam_4me_cut_here_retoh@dplanet.ch> wrote:
> Hope, there's an ISP on this planet ;-)

We like Heller: www.his.com.  They currently host seven of our sites.
Always up.

--
Regards,
Dick


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


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

Date: Thu, 15 Jun 2000 06:57:13 -0500
From: "Timothy H. Schilbach" <tschilbach@aodinc.com>
Subject: Re: NET::SMTP
Message-Id: <8iagd0$lel$1@news.chatlink.com>

Dan,

  No upgrades of PERL over libnet. It works in all my other apps except for
this one. All my casing is correct (went back and corrected it) and yet
still get the same results. Any other suggestions?



--
Timothy H. Schilbach
Alpha Omega Design Inc.
tschilbach@aodinc.com
1-877-263-7094
Visit our website at www.aodinc.com

Dan Sugalski <dan@tuatha.sidhe.org> wrote in message
news:dkX15.1123$Zg4.5233@news1.rdc1.ct.home.com...
> Timothy H. Schilbach <tschilbach@aodinc.com> wrote:
> > Dan,
>
> >   This did not fix the problem, get the same errors reguardless. PERL on
NT
> > doesnt seem to be case sensitive.  Any other suggestions?
>
> Perl on NT is case-sensitive. Perl everywhere is case-sensitive. (Actually
> you can get away with the "use" bit in a case-insensitve manner on systems
> with case-insensitive filesystems, but it can cause problems and is
> generally a good way to get unreliable results. Been there. Done that.
> Didn't like it... :)
>
> Did you maybe upgrade perl over an existing libnet install? That might
> cause you problems of some sort, and a reinstall can't hurt. It's
> certainly easy enough with PPM.
>
> Dan
>
> > "Timothy H. Schilbach" <tschilbach@aodinc.com> wrote in message
> > news:8i8su3$pc6$1@news.chatlink.com...
> >> Ok here is a simple question and some background.  I have a script that
> >> automatically activates user accounts when they signup for our
services.
> >> This works great except for the NET::SMTP section that is supposed to
> > email
> >> the client and then the administrator when the account is activated. I
> > keep
> >> getting this:
> >>
> >> Can't call method "mail" on an undefined value at
> >> I:\aodinc.com\cgi-bin\signup.pl line 298.
> >>
> >> Below I have imput the lines of code as well. For some reason its not
> >> recognizing the "mail" command. Without this varable, the message would
> > not
> >> be sent to the user. Any suggestions on how to overcome this? I have
> >> commented the troubled line.
> >>
> >> Code:
> >> sub sendmailtouser {
> >>
> >> if ($FORM{'email'} =~ /\@/) {
> >>
> >>   use NET::SMTP;
> >>
> >>   $smtp = Net::SMTP->new($server);
> >>   $smtp->mail($ENV{USER});              # This is the line it says it
> > cannot
> >> recognize
> >>
> >>   $smtp->to("$FORM{'email'}\n");
> >>
> >>   $SMTP->data();
> >>   $SMTP->datasend("From: Automated Server\n");
> >>   $SMTP->datasend("To: $FORM{'first_name'}\n");
> >>   $SMTP->datasend("Subject: Internet Service Order Completed.\n");
> >>   $SMTP->datasend("\n");
> >>
> >>   $SMTP->datasend("Below is your account information\n");
> >>   $SMTP->datasend("please print this out for your reference:\n\n");
> >>   $SMTP->datasend("Dial-Up Username: ${dialuser}\n");
> >>   $SMTP->datasend("Dial-Up Password: $FORM{'password'}\n");
> >>   $SMTP->datasend("Access Numbers: $location\n\n");
> >>
> >>   $SMTP->datasend("Newsgroup Username: newservice\n");
> >>   $SMTP->datasend("Newsgroup Password: begin\n");
> >>   $SMTP->datasend("Newsgroup Server:   ${news}\n\n");
> >>
> >>   if ($e =~ /1|3/) {
> >>     $SMTP->datasend("Email Username: $FORM{'username'}\n");
> >>     $SMTP->datasend("Email Password: $FORM{'password'}\n");
> >>   }
> >>
> >>   $SMTP->datasend("Incoming Mail Server: ${pop}\n");
> >>   $SMTP->datasend("Outgoing Mail Server: ${smtp}\n\n");
> >>
> >>   if ($e =~ /2|3/) {
> >>     $SMTP->datasend("FTP Username: $FORM{'username'}\n");
> >>     $SMTP->datasend("FTP Password: $FORM{'password'}\n");
> >>     $SMTP->datasend("FTP Server: ${ftp}\n");
> >>     $SMTP->datasend("Web Address:
> >> http://members.${domain}/$FORM{'username'}/\n");
> >>   }
> >>
> >>   $SMTP->datasend("If you have any problems, please call $phone\n");
> >>   $SMTP->datasend();
> >>
> >>   $SMTP->quit;
> >>
> >> } }
> >>
> >> --
> >> Timothy H. Schilbach
> >> Alpha Omega Design Inc.
> >> tschilbach@aodinc.com
> >> 1-877-263-7094
> >> Visit our website at www.aodinc.com
> >>
> >>
>
>




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

Date: Thu, 15 Jun 2000 06:58:24 -0500
From: "Timothy H. Schilbach" <tschilbach@aodinc.com>
Subject: Re: NET::SMTP
Message-Id: <8iagf8$lev$1@news.chatlink.com>

Nnickee,

  The module works with 5 other cgi and perl scripts. I have tried
uninstalling it and reinstalling it. Same result. :-(

--
Timothy H. Schilbach
Alpha Omega Design Inc.
tschilbach@aodinc.com
1-877-263-7094
Visit our website at www.aodinc.com

Nnickee <nnickee@nnickee.com> wrote in message
news:986760FC9A26D585.E4809979D5129CB1.80E16037937DA732@lp.airnews.net...
> On Wed, 14 Jun 2000 16:20:00 -0500, someone claiming to be "Timothy H.
> Schilbach" <tschilbach@aodinc.com> said:
>
> >Ok here is a simple question and some background.  I have a script that
> >automatically activates user accounts when they signup for our services.
> >This works great except for the NET::SMTP section that is supposed to
email
> >the client and then the administrator when the account is activated. I
keep
> >getting this:
>
> >Can't call method "mail" on an undefined value at
> >I:\aodinc.com\cgi-bin\signup.pl line 298.
>
> <snip>
>
> Try reinstalling libnet -- I had the same problems with Net::SMTP
> until I reinstalled.
>
> Nnickee
>




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

Date: Thu, 15 Jun 2000 10:21:17 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: Pattern matching - case sensitive/insensitive
Message-Id: <slrn8khbo8.p1s.garcia_suarez@rafael.kazibao.net>

A.J. Norman wrote in comp.lang.perl.misc:
> In article <slrn8kfbfb.76b.garcia_suarez@rafael.kazibao.net>, Rafael 
> Garcia-Suarez <garcia_suarez@hotmail.com> wrote: 
> > Note that allowing any pattern from user input can be a major 
> > security hole.  Don't use that in CGI programs.  
>
> As a point of interest, I have played around with this on a couple of 
> servers and looked at a couple of FAQs (Lincoln Stein's and a very 
> old one by Tom Christiansen) and it appears that provided I have 
> taint checking turned on (which I do these days as a matter of 
> course) pattern matching should be safe - and even in the absence of 
> taint checking it should be safe provided I don't use eval().  Are 
> there any other potential loopholes in allowing users to specify a 
> pattern to be matched?  

This should be OK. See the perlre man page, section on '(?{code})'
(interpolation of code into regular expressions), and the re(3) man
page of the Perl Programmers Reference Guide for more info.

-- 
Rafael Garcia-Suarez


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

Date: Thu, 15 Jun 2000 11:39:46 GMT
From: Jukka.Korpela@hut.fi (Jukka Korpela)
Subject: Re: Protect and HTML page?
Message-Id: <3948be7e.610658620@news.cs.hut.fi>

vivekvp <vivekvp@spliced.com> wrote:

>Is there any wayt to protect and HTML page with perl so that only
>authorized people can view it.

In a sense yes, if you can run a Perl program as a CGI script.

>I was thinking of just rewriting the html out be outputted by perl - and
>changed permissions - but this would mean one would have to login into
>my site.

It's not a matter of permissions. Rather, you would make the Perl program read
some password and respond by sending the HTML document only if the password is
correct. You could e.g. set up a form which has password input field and where
the action attribute refers to the CGI script. No login is needed (in any other
sense). And the page could also be accessed directly, using a URL like
http://www.something.example/cgi-bin/secretdoc.pl?pwd=grumps
(However, it is generally not advisable at all to include passwords into URLs.)

But in most cases, it is both simpler and safer to use the appropriate HTTP
mechanisms for protection. No need for Perl there. See
http://www.htmlhelp.com/faq/html/publish.html#password
http://www.sbrady.com/hotsource/faqs/alt-html-faq.html#12
-- 
Yucca, http://www.hut.fi/u/jkorpela/
To join the Clueless Club, send a followup to this message
quoting everything up to and including this sig!


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

Date: Thu, 15 Jun 2000 07:17:29 -0600
From: "scott thomason" <scott@industrial-linux.org>
Subject: Re: Protect and HTML page?
Message-Id: <tP325.138$Sf1.53506@feed.centuryinter.net>

If you are running Apache, and your intent is to only allow access from
certain IP addresses or domain names, you might be better off trying
something like:

<Location /protected-url-space>
    Order deny,allow
    Deny from all
    Allow from 192.168.1.0/24
    Allow from .somedomain.com
</Location>


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

Date: Thu, 15 Jun 2000 19:34:39 +0800
From: "Gary" <cleverest@bitsmart.com>
Subject: sendmail in Win32
Message-Id: <8iaf0b$50k7@rain.i-cable.com>

Why ActivePerl 5.6 for Win32 does not provide the "sendmail" module in the
lib?
Is this can't be used in Win32?
If so, how can I send mail in Win32?




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

Date: Thu, 15 Jun 2000 17:43:50 +0530
From: "Debjit" <debjit@oyeindia.com>
Subject: Re: simple pattern matching question
Message-Id: <8ibmal$apf$1@news.vsnl.net.in>

See perlfaq9





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

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


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