[21908] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4112 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 13 09:06:27 2002

Date: Wed, 13 Nov 2002 06:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 13 Nov 2002     Volume: 10 Number: 4112

Today's topics:
        [Q] Getting started with perl programming? (Sir Loin of Beef)
    Re: [Q] Getting started with perl programming? <bernard.el-hagin@DODGE_THISlido-tech.net>
    Re: [Q] Getting started with perl programming? (Sir Loin of Beef)
    Re: [Q] Getting started with perl programming? <tassilo.parseval@post.rwth-aachen.de>
    Re: [Q] Getting started with perl programming? <bill.kemp@wire2.com>
    Re: [Q] Script to search auction sites? (Sir Loin of Beef)
    Re: [Q] Script to search auction sites? <bernard.el-hagin@DODGE_THISlido-tech.net>
        Emacs modules for Perl programming (Jari Aalto+mail.perl)
    Re: Help with https and lwp <eweintra@jhmi.edu>
    Re: help with Win32::OLE MS Word <ouellmi@videotron.ca>
        how do I turn off unicode on file I/O? (Jamie Zawinski)
        HTML::Forms Documentation <cj571@soi.city.ac.uk>
    Re: illegal use of comment ? <tk@WINDOZEdigiserv.net>
    Re: illegal use of comment ? (Alan Barclay)
    Re: Newbie with Perl (Helgi Briem)
    Re: Newbie with Perl <bart.lateur@pandora.be>
    Re: Perl CGI/DB advice. <nobody@noplace.com>
    Re: Perl: string vs. numeric <bart.lateur@pandora.be>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 13 Nov 2002 11:54:29 GMT
From: NOSPAMmdknight@pacific.net.sg (Sir Loin of Beef)
Subject: [Q] Getting started with perl programming?
Message-Id: <3dd23d5b.10120987@news.pacific.net.sg>

What would I need to get started with perl programming? Apart from a
Perl interpreter, do I need any modules?


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

Date: Wed, 13 Nov 2002 11:44:55 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: [Q] Getting started with perl programming?
Message-Id: <aqtdvn$av9$2@korweta.task.gda.pl>

In article <3dd23d5b.10120987@news.pacific.net.sg>, Sir Loin of Beef
wrote:
> What would I need to get started with perl programming? Apart from a
> Perl interpreter, do I need any modules?


Don't you think that depends on what you want to do? After all,
modules are designed with specific tasks in mind. Having said that,
since you're just starting out you probably won't need any modules
other than the standard ones which came with your distro of Perl.


Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'


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

Date: Wed, 13 Nov 2002 12:07:53 GMT
From: NOSPAMmdknight@pacific.net.sg (Sir Loin of Beef)
Subject: Re: [Q] Getting started with perl programming?
Message-Id: <3dd24088.10934131@news.pacific.net.sg>

Bernard
>Don't you think that depends on what you want to do? After all,
>modules are designed with specific tasks in mind. Having said that,
>since you're just starting out you probably won't need any modules
>other than the standard ones which came with your distro of Perl.

Well, I was thinking, do I need a web server or anything like that?


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

Date: 13 Nov 2002 12:05:37 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: [Q] Getting started with perl programming?
Message-Id: <aqtf6h$6c5$1@nets3.rz.RWTH-Aachen.DE>

Also sprach Sir Loin of Beef:

> Bernard
>>Don't you think that depends on what you want to do? After all,
>>modules are designed with specific tasks in mind. Having said that,
>>since you're just starting out you probably won't need any modules
>>other than the standard ones which came with your distro of Perl.
> 
> Well, I was thinking, do I need a web server or anything like that?

A webserver is not a module (in general). No one can tell you whether
you need a webserver. Perl certainly does not require one. Installing a
Perl distribution (and perhaps a capable text editor) is all you need
for programming Perl.

If, however, you intend to do server-side scripting you will need one.
apache is a very good choice in connection with Perl.

Tassilo
-- 
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;


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

Date: Wed, 13 Nov 2002 12:04:35 -0000
From: "W K" <bill.kemp@wire2.com>
Subject: Re: [Q] Getting started with perl programming?
Message-Id: <jfrA9.22$KI3.280@news.uk.colt.net>


Sir Loin of Beef <NOSPAMmdknight@pacific.net.sg> wrote in message
news:3dd24088.10934131@news.pacific.net.sg...
> Bernard
> >Don't you think that depends on what you want to do? After all,
> >modules are designed with specific tasks in mind. Having said that,
> >since you're just starting out you probably won't need any modules
> >other than the standard ones which came with your distro of Perl.
>
> Well, I was thinking, do I need a web server or anything like that?

Ermm. thats a different question.
You may well need a web server if you are trying to do cgi stuff.

Perl can do, and does do, many other things.
Even when you are doing cgi stuff, its useful/better to write simple things
that work on their own without a web server so that you can figure out how
to do all sorts of things without the complications of getting to work on a
web server.




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

Date: Wed, 13 Nov 2002 12:06:36 GMT
From: NOSPAMmdknight@pacific.net.sg (Sir Loin of Beef)
Subject: Re: [Q] Script to search auction sites?
Message-Id: <3dd23fe1.10766808@news.pacific.net.sg>



I'm afraid I've gotten stuck already. Here.s my code:

#!/usr/bin/perl

use CGI qw/:standard/;
use LWP::Simple;
 
  print header,
        start_html('Auction search'),
        h1('Auction Search'),
        start_form,
        "Search Term? ",textfield('name'),p,
        "What's the combination?", p,
        checkbox_group(-name=>'words',
		       -values=>['Yahoo Sg','Interauct'],
		       -defaults=>['Interauct']), p,
        submit,
        end_form,
        hr;

   if (param()) {
       print "Searching for search term: ",em(param('name')),p,
	     "on auction sites: ",em(join(", ",param('words'))),p,
	     hr;
	$content = get("http://www.interauct.com.sg/")
print $content;

  }



The $content line is just a dummy line to test the connection to the
auction site. It appears to cause errors there. What am I doing wrong?







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

Date: Wed, 13 Nov 2002 12:09:01 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: [Q] Script to search auction sites?
Message-Id: <aqtfct$khe$1@korweta.task.gda.pl>

In article <3dd23fe1.10766808@news.pacific.net.sg>, Sir Loin of Beef wrote:
> 
> 
> I'm afraid I've gotten stuck already. Here.s my code:
> 
> #!/usr/bin/perl
> 
> use CGI qw/:standard/;
> use LWP::Simple;
>  
>   print header,
>         start_html('Auction search'),
>         h1('Auction Search'),
>         start_form,
>         "Search Term? ",textfield('name'),p,
>         "What's the combination?", p,
>         checkbox_group(-name=>'words',
> 		       -values=>['Yahoo Sg','Interauct'],
> 		       -defaults=>['Interauct']), p,
>         submit,
>         end_form,
>         hr;
> 
>    if (param()) {
>        print "Searching for search term: ",em(param('name')),p,
> 	     "on auction sites: ",em(join(", ",param('words'))),p,
> 	     hr;
> 	$content = get("http://www.interauct.com.sg/")
> print $content;
> 
>   }
> 
> 
> 
> The $content line is just a dummy line to test the connection to the
> auction site. It appears to cause errors there. What am I doing wrong?


It has a syntax error. Add a ";" at the end.


Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'


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

Date: 13 Nov 2002 11:47:01 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_1037187816@rtfm.mit.edu>

Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://tiny-tools.sourceforge.net/
Maintainer: Jari Aalto <jari.aalto@poboxes.com>

Announcement: "What Emacs lisp modules can help with programming Perl"

    Preface

        Emacs is your friend if you have to do anything comcerning software
        development: It offers plug-in modules, written in Emacs lisp
        (elisp) language, that makes all your programmings wishes come
        true. Please introduce yourself to Emacs and your programming era
        will get a new light.

    Where to find Emacs/XEmacs

        o   Unix:
            http://www.gnu.org/software/emacs/emacs.html
            http://www.xemacs.org/

        o   Unix Windows port (for Unix die-hards):
            install http://www.cygwin.com/  which includes native Emacs 21.x.
            XEmacs port is bundled in XEmacs setup.exe available from
            XEmacs site.

        o   Pure Native Windows port
            http://www.gnu.org/software/emacs/windows/ntemacs.html
            ftp://ftp.xemacs.org/pub/xemacs/windows/setup.exe

        o   More Emacs resources at
            http://tiny-tools.sourceforge.net/  => Emacs resource page

Emacs Perl Modules

    Cperl -- Perl programming mode

        ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
        http://www.perl.com/CPAN-local/misc/emacs/cperl-mode/
        <ilya@math.ohio-state.edu>    Ilya Zakharevich

        CPerl is major mode for editing perl files. Forget the default
        `perl-mode' that comes with Emacs, this is much better. Comes
        standard in newest Emacs.

    TinyPerl -- Perl related utilities

        http://tiny-tools.sourceforge.net/

        If you ever wonder how to deal with Perl POD pages or how to find
        documentation from all perl manpages, this package is for you.
        Couple of keystrokes and all the documentaion is in your hands.

        o   Instant function help: See documentation of `shift', `pop'...
        o   Show Perl manual pages in *pod* buffer
        o   Grep through all Perl manpages (.pod)
        o   Follow POD references e.g. [perlre] to next pod with RETURN
        o   Coloured pod pages with `font-lock'
        o   Separate `tiperl-pod-view-mode' for jumping topics and pages
            forward and backward in *pod* buffer.

        o   Update `$VERSION' variable with YYYY.MMDD on save.
        o   Load source code into Emacs, like Devel::DProf.pm
        o   Prepare script (version numbering) and Upload it to PAUSE
        o   Generate autoload STUBS (Devel::SelfStubber) for you
            Perl Module (.pm)

    TinyIgrep -- Perl Code browsing and easy grepping

        [TinyIgrep is included in Tiny Tools Kit]

        To grep from all installed Perl modules, define database to
        TinyIgrep. There is example file emacs-rc-tinyigrep.el that shows
        how to set up dattabases for Perl5, Perl4 whatever you have
        installed

        TinyIgrep calls Igrep.el to to do the search, You can adjust
        recursive grep options, set search case sensitivity, add user grep
        options etc.

        You can find latest `igrep.el' module at
        <http://groups.google.com/groups?group=gnu.emacs.sources> The
        maintainer is Jefin Rodgers <kevinr@ihs.com>.

    TinyCompile -- To Browse grep results in Emacs *compile* buffer

        TinyCompile is a minor mode for *compile* buffer from where
        you can collapse unwanted lines or shorten file URLs:

            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT

            -->

            cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
            file1:NNN: MATCHED TEXT
            file1:NNN: MATCHED TEXT

End



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

Date: Wed, 13 Nov 2002 08:52:39 -0500
From: ETAN WEINTRAUB <eweintra@jhmi.edu>
Subject: Re: Help with https and lwp
Message-Id: <Pine.GSO.4.44.0211130852040.12616-100000@pine>

Nope, https:// does work at the site. Checked that before I even thought
of posting here....

On Wed, 13 Nov 2002, Bob Walton wrote:

> ETAN WEINTRAUB wrote:
>
> ...
> > It works if I use http:// instead of https://, however I need it to work
> > with https://. When I switch it to https://, I get the following message:
> >
> > ----------------------------------------------------------------
> > File: local.cshrc
> > 500 (Internal Server Error) Can't connect to localhost:443 ()
> > Client-Date: Tue, 12 Nov 2002 20:32:21 GMT
> >
> > ----------------------------------------------------------------
> >
> > Any ideas???
>
>
> Does the https://... work at the site using your favorite web browser?
> If not, then it is a web server problem, not a Perl problem.  Looks to
> me like that is probably the case.
>
>
> ...
> > -Etan Weintraub
>
> ...
> --
> Bob Walton
>
>



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

Date: Wed, 13 Nov 2002 06:43:09 -0500
From: "Michele Ouellet" <ouellmi@videotron.ca>
Subject: Re: help with Win32::OLE MS Word
Message-Id: <IkrA9.44673$uK5.464174@wagner.videotron.net>

Hi Ted!

I think the best way to approach this kind of problem is to record a Word
macro, test your macro on a good sample of documents, then port the macro to
Perl.

This has several benefits:

* It clears up the logic in your mind since you have to do it manually in
the first place;
* The macro reveals to you the stuff you need to know about the Word object
model.

Yours is really a Word question, not a Perl question, I feel.

Good luck,

Michele.

"ted" <tednospam94107@yahoo.com> wrote in message
news:aqsg4a$gmd$1@slb4.atl.mindspring.net...
> How would I figure out where the table is in relation to everything else
in
> the Document. For instance, how would I know if the table is after the
third
> paragragh or the fifth paragraph?
>
> Also, how would I figure out if a bulleted list has a nested list?
>
>
>
> "Brian Helterline" <brian_helterline@hp.com> wrote in message
> news:aqs46t$63f$1@hpcvsgen.cv.hp.com...
> > "ted" <tednospam94107@yahoo.com> wrote in message
> > news:<aqqdmq$k4c$1@slb2.atl.mindspring.net>...
> > > Hello,
> > >
> > > I'm trying to extract text from MS Word docs that have tables and
> bulleted
> > > lists.
> > >
> > > How would I detect tables and bulleted lists (and nested lists) in the
> > Word
> > > doc? They are scattered throughout the doc.
> > >
> > > Any help appreciated. Thanks.
> > > -Ted
> > >
> > Hi Ted,
> > There is a Tables collection for the document that contains all the
tables
> > within the document.
> > Word->Document->Tables
> > Bulleted lists are just a format style so you would have to search for a
> > style to locate them.
> > -brian
> >
> >
>
>




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

Date: 13 Nov 2002 05:57:39 -0800
From: jwz@jwz.org (Jamie Zawinski)
Subject: how do I turn off unicode on file I/O?
Message-Id: <8ef0bdd0.0211130557.2586d504@posting.google.com>

Can someone please explain to me how to break the legs off
of Perl 5.8.0's Unicode support?

I have files that have Latin1 characters in them.  I want
Perl to *not convert them at all*.  My program wants to treat
these files as simple bytes, with no interpretation.

If I set $LANG to C, then everything works as expected, but
I would like my program to work in the default locale that
Red Hat 8 ships, which is "en_US.UTF-8".  I'd rather not
have to tell users "set $LANG before running this program."

I've tried all kinds of variants of "use bytes" and other
things mentioned in the various man pages with no luck.
I've also tried calling "setlocale" and setting $ENV{LANG}
within the program, with no effect.

Apparently things work differently-wrongly if I open the
file in the top level script, than if I open it in a sub-script:
look at the difference in behavior between running the "b.pl"
script below directly, versus running the "a.pl" script which
includes "b.pl": when run directly, b.pl does what I want
(prints out the raw bytes, the Latin1 character.)  When I run
a.pl, it mangles it to Unicode for me.

I've included some "od" output too in case this gets posted
wrong, or in case news readers "fix" things.

Any suggestions?

The file "a" contains the word "foobar" with one o replaced
with an o-umlaut (octal byte 366.)

    % cat /tmp/a
    foöbar

    % od -c a
    0000000   f   o 366   b   a   r  \n
    0000007

The "b.pl" program opens file "a" and prints out the lines.
I've tried various "use" options with confusing results.

    % cat b.pl
    #!/usr/bin/perl -w

    require 5;
    use diagnostics;
    use strict;
    use bytes;

    sub foo {
       local *IN;
       open (IN, "<a") || die;
       while (<IN>) {
         print "<<  $_";
       }
       close IN;
     }

    foo();

    1;

The "a.pl" program just includes "b.pl" and runs it.

    % cat a.pl
    #!/usr/bin/perl -w

    require 5;
    use diagnostics;
    use strict;
    use bytes;

    require 'b.pl';
    foo();

Running "b.pl" directly does what I expect:

    % ./b.pl
    <<  foöbar

Running "a.pl" does something baffling:

    % ./a.pl
    <<  foöbar
    <<  foöbar

    % ./a.pl | od -c
    0000000   <   <           f   o 303 266   b   a   r  \n   <   <        
    0000020   f   o 303 266   b   a   r  \n
    0000030

    % ./b.pl | od -c
    0000000   <   <           f   o 366   b   a   r  \n
    0000013

Setting $LANG makes them both work as I expect, but I'd
rather not require users of my program to do that:

    % (setenv LANG C; ./a.pl | od -c )
    0000000   <   <           f   o 366   b   a   r  \n   <   <           f
    0000020   o 366   b   a   r  \n
    0000026

    % (setenv LANG C; ./b.pl | od -c )
    0000000   <   <           f   o 366   b   a   r  \n
    0000013

    % echo $LANG
    en_US.UTF-8

Linux 2.4.18-14 #1 Wed Sep 4 12:13:11 EDT 2002 i686 athlon i386 GNU/Linux
Red Hat Linux release 8.0 (Psyche)
This is perl, v5.8.0 built for i386-linux-thread-multi


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

Date: Wed, 13 Nov 2002 13:35:19 +0000
From: Lekeas GK <cj571@soi.city.ac.uk>
Subject: HTML::Forms Documentation
Message-Id: <Pine.GSO.4.02A.10211131334001.13845-100000@vega.soi.city.ac.uk>

Hi All,

Could somebody please provide some pointers to good online sources of
reference for the HTML::Forms module?

I look forward to hearing from you soon...

Thanks in advance...

George



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

Date: Wed, 13 Nov 2002 13:19:14 GMT
From: tk <tk@WINDOZEdigiserv.net>
Subject: Re: illegal use of comment ?
Message-Id: <u9k4tu485ju953k9aoaspv112bk4n81lib@4ax.com>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

In a fit of excitement on Tue, 12 Nov 2002 22:49:38 -0800, "Brandon L"
<spam@digitaltension.com> managed to scribble:

| since when does the UK or any non-US country use pound for weight? i
| thought we were the only bastard country that did that, isnt everyone
| metric now? now, a liter is like a pound right?
| 
| ;-)
| 

Please don't top post.

Agreed, that things are all going metric, some (buitchers for example)
have only recently gone into metric measurements.

For me, I'm kinda "old skool", and still do things in imperial
measurements.. feet/inches, stone/lbs etc etc =)


Regards,

  tk

-----BEGIN xxx SIGNATURE-----
Version: PGP Personal Privacy 6.5.3

iQA/AwUBPdJRkijNZg8h4REKEQLqqwCg4pG0G6k73eOTV0irPdajW6wfenkAn1ia
DIPXihFJEXT7j3GgY6tWaIBI
=C1Ba
-----END PGP SIGNATURE-----

-- 
 +--------------------------+
 |     digiServ Network     |
 |      Web solutions       |    Remove WINDOZE to reply.
 | http://www.digiserv.net/ |
 +--------------------------+


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

Date: 13 Nov 2002 12:54:57 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: illegal use of comment ?
Message-Id: <1037192096.898356@elaine.furryape.com>

In article <slrnat1c5s.ri9.garry@zfw.zvolve.net>,
Garry Williams  <garry@zvolve.com> wrote:
>Those last two are _not_ incorrect.  
>
>The final dot _is_ the root domain and (sendmail at least) doesn't
>make a distinction between upper and lower case for the part to the

This is true, but email addresses aren't allow to end in a dot.

So "telnet host.domain.com." is valid, but "mail user@host.domain.com."
isn't.

From RFC 822:

     addr-spec   =  local-part "@" domain        ; global address                                                                                                    local-part  =  word *("." word)             ; uninterpreted                                                                 ; case-preserved                                                                                                    domain      =  sub-domain *("." sub-domain)                                                                                                                     sub-domain  =  domain-ref / domain-literal                                                                                                                      domain-ref  =  atom                         ; symbolic reference  

so '.'s can be between each sub-domain, but not at the end.



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

Date: Wed, 13 Nov 2002 11:24:14 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Newbie with Perl
Message-Id: <3dd23538.2448601542@news.cis.dfn.de>

On Tue, 12 Nov 2002 22:45:42 -0800, "Brandon L"
<spam@digitaltension.com> wrote:

Don't top-post.  It seriously annoys the regulars
and severely reduces your chances of receiving 
useful answers to your questions.

For further guidelines on posting to comp.lang.perl.misc,
read
   
http://mail.augustmail.com/~tadmc/clpmisc.shtml

For more information about netiquette in general, see 
the "Netiquette uidelines" at:

http://andrew2.andrew.cmu.edu/rfc/rfc1855.html

>haha... i just LOVE RTFM's... the best book that was recommedned 

No, the best book is always the Perl documentation
that comes bundeled with every distribution.  Open
a command line use the perldoc program to access it.
perldoc perldoc will teach you how.


>o me was 'reilly's perl book... oh yeah it was great... 

Which one?  O'Reilly has published dozens of Perl books,
possibly hundreds.  Many of them are great.

>chapter 1 - here are 2 simple commands, chapter 2 - look what you 
>can do with these new 2 commands,
>chapter 3 - build this big freakin program using these commands we may or
>may not have ocvered very well, and good luck may the force be with you!

That does not sound like the description of any O'Reilly
Perl book I have ever seen.

You are treading perilously close to a lot of killfiles.

-- 
Regards, Helgi Briem
helgi AT decode DOT is

                           A: Top posting
                           Q: What is the most irritating thing on Usenet?
                                           - "Gordon" on apihna


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

Date: Wed, 13 Nov 2002 11:25:11 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Newbie with Perl
Message-Id: <9gd4tu8udk06i4euvvcufk7ou72spitduo@4ax.com>

Brandon L wrote:

>needless to say i wasnt able to learn from that book, it took my boss just
>sitting with me for a night to get me rolling... i find it hard to learn
>from books, i need to learn by example

Have you at least taken a look at the articles by Randal Schwartz I
pointed to? You won't find anything more hands-on than these. The code
in the articles works, no need for you to build any code at all for
yourself before getting any results.

Even the very first column for UnixReview, "basic parsing", does more
than 50% of what you want to accomplish. So get and install a perl (if
you don't have one), take a look at the columns, and start
experimenting.

-- 
	Bart.


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

Date: Wed, 13 Nov 2002 12:29:17 GMT
From: "Gregory Toomey" <nobody@noplace.com>
Subject: Re: Perl CGI/DB advice.
Message-Id: <01c28b11$b5714740$34498a90@gmtoomey>

sh <phase2@phase2.net> wrote in article
<2ec67b0f.0211121106.5f1d71a1@posting.google.com>...
> Hi,
> 
> I wanted to get some people's opinions on this authentication method
> and how 'secure' you think it is.  Bare in mind that this solution
> does not need to be foolproof, but at least provide a decent sense of
> security.
> 
> Because of a certain higher up person, they don't want the basic httpd
> authentication box coming up.  Therefore, I was tasked with writing
> our own authentication method.
> 
> We have a database with a table called 'users'.  The important rows
> for this post are 'user_name','passwd', and 'auth_num'.  The user_name
> is a regular varchar, the passwd is a MD5 encrypted string. ( I'll get
> to auth_num in a second. )
> 
> The user comes to the home page, and may enter his username/password
> in a form, then submit.  The form's method is post, the action is
> 'https://www.yourdomain.com/login.cgi'.
> 
> So thus, I pose my first question:  Does the user have to be on an SSL
> encrypted page BEFORE they submit the form or will the post data be
> encrypted to the login.cgi?

If its not, you send this password unencrypred. Just like the basic
authentication mechanism you are trying to avoid & so you gain nothing.
Fire you boss - she's a nitwit.


> The username and password are compared to the database record for that
> username ( which resides on the same box as the httpd, so it's via
> UNIX sockets. ), if he checks out ok, an 'auth_num' ( 128 bit ) random
> string is generated and stored in the user's record in the database. 
> They are then returned a cookie in the form of "username:auth_num";. 
> The cookie expires upon the closing of browsers.
> 
> On each page, the cookie is read in and compared to what is currently
> in the database.  If the auth_nums do not match, they are considered
> 'logged out' and aren't allowed to view the page and are presented
> with the login form again. If they do match, the script gets their
> permissions and spits out a response, basically giving them access to
> the functions that their permissions allowed.
> 
> Does this sound like a valid type of authentication?

Yes, but what about people that turn off cookies?

gtoomey


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

Date: Wed, 13 Nov 2002 11:30:02 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Perl: string vs. numeric
Message-Id: <8cd4tusqlkftdjbsauir0kpfhr04gseaq9@4ax.com>

Derek Thomson wrote:

>> For now, I'm passing it ("'hi'", 3) and that works. (That's single
>> quotes inside double quotes, if it's difficult to discern.)
>
>This is a perfectly good method.

In that case, passing the original as

	(q['hi'], 3)

might be a bit more readable, as now there is no sequence of quotes of
various kinds.

But my thought might be to "quote" strings if they don't look like
numbers. Perhaps DBI, or the various DBD::* drivers, might be a better
source of inspiration. I'm not sure, but DBI does something vaguely like
this, IIRC.

Or look at the regexes, as in the perlfaq (`perldoc -q number`)

  How do I determine whether a scalar is a number/whole/integer/float?

or as can be found in the module Regexp::Common.

-- 
	Bart.


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 4112
***************************************


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