[8300] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1917 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 17 07:07:15 1998

Date: Tue, 17 Feb 98 04:00:28 -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           Tue, 17 Feb 1998     Volume: 8 Number: 1917

Today's topics:
    Re: .rc file parser, anyone? <webmaster@fccj.cc.fl.us>
    Re: <$x> OK but <$_[0]> NOT?!! (Keith Kong)
    Re: <$x> OK but <$_[0]> NOT?!! <tchrist@mox.perl.com>
    Re: <$x> OK but <$_[0]> NOT?!! <rjk@coos.dartmouth.edu>
        Accessing MS Sql on NT Query ???
    Re: Can't use string ("") as a subroutine ref while "st <webmaster@fccj.cc.fl.us>
    Re: FAQless Forays (was: Code Example Needed) (Chip Salzenberg)
    Re: htpasswd <nobody@nobody.com>
    Re: newbie question about reloading a web page through  (Jonathan Feinberg)
    Re: Novice: 6 - Can't figure out how to read input from <rjk@coos.dartmouth.edu>
    Re: perlshop with cybercash <tchrist@mox.perl.com>
        Quick Reg Expression help (Mike Binkley)
    Re: Quick Reg Expression help (Craig Berry)
    Re: Quick Reg Expression help (Jonathan Feinberg)
    Re: Quick Reg Expression help (Craig Berry)
    Re: Retrieving mail from host (Jonathan Feinberg)
    Re: Retrieving mail from host (Martien Verbruggen)
    Re: RFC about ``Matt's Script Archive'' <webmaster@fccj.cc.fl.us>
    Re: script won't run...displays script text <corky@ultranet.com>
    Re: script won't run...displays script text (Jonathan Feinberg)
    Re: script won't run...displays script text <tchrist@mox.perl.com>
    Re: script won't run...displays script text (Jonathan Feinberg)
    Re: The Young Man and the Beach (Mark Kramer)
    Re: The Young Man and the Beach (Mark Kramer)
    Re: The Young Man and the Beach (Mark Kramer)
    Re: Using getopts() and exec() <rjk@coos.dartmouth.edu>
        Using HTML Tags in forms (Content Type) JesusDLG
        Using Perl to encrypt credit card numbers at Web sites <shareware@erols.com>
    Re: WANTED UK PEARL SCRIPT PROGRAMER (Jim Michael)
    Re: WANTED UK PEARL SCRIPT PROGRAMER (Jeeves)
    Re: what is exaclty the "_" Variable ?!?! <ebohlman@netcom.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 16 Feb 1998 22:39:03 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
To: Grant@fccj.cc.fl.us, Totten@fccj.cc.fl.us, "<grantt"@americasm01.nt.com>
Subject: Re: .rc file parser, anyone?
Message-Id: <34E90656.F2322FC2@fccj.cc.fl.us>

You may wish to look thru similar 'requiments' in coding
that I have posted here...

(Search on Bill Jones)

HTH,
Bill



Grant Totten (EXCHANGE:CAR:5J42) wrote:

> Hi all,
>
> Has anyone written a 'run command' file parser?  Are there any libraries
> availabe to do this?
>
> I would like to be able to have a .rc file like this:
>
> .sderc:
>
> [defaults]
> default_view = grantt
> default_umask = 002
>
> [view grantt]
> umask = 022
> directory = /home/grantt/test
> ...
>
> and have my program read the values into a hash or something that I can
> then work wtih.
>
> I'll write my own routines if I have to but I would just as soon avoid
> re-inventing this particular wheel.
>
> Thanks in advance,
>
> Grant Totten
> Nortel Public Data Networks
> grantt@nortel.ca





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

Date: 17 Feb 1998 04:22:49 GMT
From: kkong@ece.ucdavis.edu (Keith Kong)
Subject: Re: <$x> OK but <$_[0]> NOT?!!
Message-Id: <6cb3ap$7hq$1@mark.ucdavis.edu>

I read perlfaq5 but don't quite understand how it explains using
$x instead of $_[0] fixes things.  I'm still in "perl4 mode" and
have been using perl5 mainly because it is the version that is
installed in the system I'm using.

Does anyone have a perl4 explanation for why using $x in place of
$_[0] works?  Is $_[0] somehow "less" of a scalar variable than $x?


Keith

Tom Christiansen (tchrist@mox.perl.com) wrote:
:  [courtesy cc of this posting sent to cited author via email]
: 
: In comp.lang.perl.misc, kkong@ece.ucdavis.edu (Keith Kong) writes:
: :So what's the deal?  
: 
: You mean above and beyond the explanation I already provided 
: regarding this issue in perlfaq5?  Probably nothing else.
: 
: --tom


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

Date: 17 Feb 1998 03:41:57 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: <$x> OK but <$_[0]> NOT?!!
Message-Id: <6cb0u5$1dk$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, kkong@ece.ucdavis.edu (Keith Kong) writes:
:So what's the deal?  

You mean above and beyond the explanation I already provided 
regarding this issue in perlfaq5?  Probably nothing else.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
     "... an initial underscore already conveys strong feelings of
      magicalness to a C programmer."
	--Larry Wall in <1992Nov9.195250.23584@netlabs.com>


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

Date: Tue, 17 Feb 1998 01:04:13 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: Keith Kong <kkong@ece.ucdavis.edu>
Subject: Re: <$x> OK but <$_[0]> NOT?!!
Message-Id: <34E92861.BB008AB2@coos.dartmouth.edu>

[posted and mailed]

Keith Kong wrote:
> 
> [...]
>
> Things don't seem to work so I tried to simplify:
> 
> $_[0] = \*FILE;
> $line = <$_[0]>;
> print $line;
> 
> Things still don't work so I tried another simplification:
> 
> $_[0] = \*FILE;
> $x = $_[0];
> $line = <$x>;
> print $line;
> 
> This works.  So what's the deal?  I'm using perl 5.003 (is that the
> reason?)

man perlop

     If the string inside the angle brackets is a reference to a scalar
     variable (e.g. <$foo>), then that variable contains the name of the
     filehandle to input from, or a reference to the same.  For example:

         $fh = \*STDIN;
         $line = <$fh>;

     If the string inside angle brackets is not a filehandle or a scalar
     variable containing a filehandle name or reference, then it is
     interpreted as a filename pattern to be globbed, and either a list of
     filenames or the next filename in the list is returned, depending on
     context.  One level of $ interpretation is done first, but you can't say
     <$foo> because that's an indirect filehandle as explained in the
     previous paragraph.

An unfortunate conflict in Perl's syntax.

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/


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

Date: 14 Feb 1998 01:46:59 GMT
From: Query ???
Subject: Accessing MS Sql on NT
Message-Id: <6c2t2j$gk@triton.np.ac.sg>

Hi,

     How can I use PERL to access MicroSoft SQL running on a NT from
     my Unix Box.
     I had installed on my hpux workstation( Os 9.05)
     -  Perl (v 5.004_4)
     -  Dbi  (v 0.89)
     -  DBD::ODBC (v 0.16)

     Are there anymore steps that I am missing?
     Any pointers would be much appreciated.

Thanks.




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

Date: Mon, 16 Feb 1998 22:22:16 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
To: bill@astro.fccj.cc.fl.us
Subject: Re: Can't use string ("") as a subroutine ref while "strict refs" in use
Message-Id: <34E90267.AC9A9FCA@fccj.cc.fl.us>

What I came up with, eventually, was the following -

sub readCF {
        open (prjCF, $cfFile) or &ioError("Cannot open CF file: $!\n\n");
        while(<prjCF>) {
                chomp; # Chop-off C/R at EOL...
                # Read real data lines...
                (length($_)) ? ( $vFlag, $vData ) = split(':')
                             : next; #  We are on a blank line...

                # Let's see what we have...
                             last if (substr($vFlag, 1, 3) eq 'END');
                $vSub = \&Sneex   if (substr($vFlag, 1, 5) eq 'SNEEX');
                $vSub = \&Admin   if (substr($vFlag, 1, 5) eq 'ADMIN');
                $vSub = \&Reports if (substr($vFlag, 1, 7) eq 'REPORTS');
                $vSub = \&Logs    if (substr($vFlag, 1, 4) eq 'LOGS');
                $vSub = \&Targets if (substr($vFlag, 1, 7) eq 'TARGETS');
                $vSub = \&Usenet  if (substr($vFlag, 1, 6) eq 'USENET');

(substr($_, 0, 1) eq '[') ? next    # On [TAG], read next line.
                          : &$vSub; # Else, call data-biased subroutine...
        }

        close (prjCF) or &ioError("Cannot close CF file: $!\n\n");
}


However, I like what Paul posted, see below .sig -


Thanks Paul!

Bill
PS - I used Perl 5.004_03 on Solaris...

Paul Makepeace wrote:

> Bill Jones wrote in message <34E850FA.6B4DE23E@fccj.cc.fl.us>...
> >Found answer for Case-Switching -
> >
> >How do I create a switch or case statement?
>
> Judicious use of hashes means you don't have to ponder this problem too
> much, at least IME. If I see more than two elsif's I get twitchy...
>
> $^W = 1;
> use strict refs;
>
> sub Admin { print "Admin\n"; }
> sub Logs { print "Logs\n"; }
> sub Targets { print "Targets\n"; }
> sub Usenet { print "Usenet\n"; }
>
> # Here you're effectively 'declaring' which subroutines you're likely to
> refer to later.
> # The lowercase key gives a smattering of robustness; see later.
>
> my %SubTable = (
>  admin => \&Admin,
>  logs => \&Logs,
>  targets => \&Targets,
>  usenet => \&Usenet,
> );
>
> # 'Switch'...
>
> my $vSub = $SubTable{lc $vFlag};    # see?
>
>  # Perform data-biased subroutine...
>
>  &$vSub;
>
> __END__
>
> Of course, if making one of those SubTable's looks boring,
>
> my @SubTable = qw(Admin Logs Targets Usenet);
> my %SubTable;
> @SubTable{map {lc $_} @SubTable} = map {\&$_} @SubTable;
>
> It's not big and it's not clever but it does give you a level of job
> security.
>
> Cheers, Paul.
>
> (I'm slightly surprised \&$_ got past strict refs...? [5.004_02/NT])





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

Date: Tue, 17 Feb 1998 06:12:54 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: FAQless Forays (was: Code Example Needed)
Message-Id: <6cb9sk$2pc$1@cyprus.atlantic.net>

According to rjk@coos.dartmouth.edu:
>Chip Salzenberg wrote:
>> According to rjk@coos.dartmouth.edu (Chipmunk):
>> >                PC     non-PC
>> >good post       ??      ??
>> >bad post       Many     Few
>> >
>> >Your conclusion, that in general posts from PCs should be killfiled, does
>> >not necessarily follow.
>> 
>> It follows *if* you have limited time.  I do.  Don't you?
>
>In that case, you could save even more time by not reading the newsgroup
>at all.

Each person has his limits for discretionary time use.
-- 
Chip Salzenberg                - a.k.a. -                <chip@pobox.com>
      "Hoist the failure sails, men!  We're goin' home!"  // MST3K
           ->  Ask me about Perl training and consulting  <-
     Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Mon, 16 Feb 1998 23:44:56 -0500
From: Alexander Selkirk <nobody@nobody.com>
Subject: Re: htpasswd
Message-Id: <34E915C4.17DE@nobody.com>

Help!

I am having a similar problem - for some reason even though I tried
implementing the script as you have described, it still prompts me for a
password...please see below.
	For some reason I'm having trouble getting the args through from the
perl script that drives the expect script as well - even when I
substitute fixed values for the args I continue to get prompted for the
password until it times out:

in the perl script:

'makepass.exp $sn $passwordpref';


makepass.exp:

#!/usr/local/bin/expect -f
#set sn "$argv(0)"
set sn "888888888"
#set passwordpref "$argv(1)"
set passwordpref "hellothere"
spawn htpasswd ../../../plsc172b/.htpasswd $sn
expect {
 "New password:" {
#  send "$passwordpref\r"
   send "hellothere\r"
  exp_continue
 }
 "Re-type new password:" {
#  send "$passwordpref\r"
   send "hellothere\r"
 }
}


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

Date: Mon, 16 Feb 1998 22:42:32 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: newbie question about reloading a web page through perl
Message-Id: <MPG.f52d130da486fed9896e4@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

kigray@cs.utexas.edu said...
: they hit the reload button on their browser.  Is their anyway
: one can force the browser to reload through perl.  

This question is not related to the Perl language.  You might find some 
success on one of the newsgroups whose topic is web authoring.

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


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

Date: Tue, 17 Feb 1998 00:03:40 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Novice: 6 - Can't figure out how to read input from the keyboard.
Message-Id: <34E91A2D.A748EF03@coos.dartmouth.edu>

Marek Jedlinski wrote:
> 
> gabor@vmunix.com (Gabor)  wrote:
> 
> >And think about it just for a moment.  getc gets the next character
> >from the buffer, but you still have to hit at least one more character
> >to get that character.  Namely <enter>.
> 
> Yep. I was assuming (hoping ;) that getc puts *all* it gets into
> the variable, including <enter>.

That is what it does.  It just happens, as the documentation you quoted states,
that getc() gets *one* character at a time.
So the first time through your loop, it gets the letter, and the second time
through, it gets the newline.

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/


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

Date: 17 Feb 1998 03:21:30 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perlshop with cybercash
Message-Id: <6cavnq$sgg$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, airpix@hotmail.com writes:
:We are using perlshop.  It works well, but we are having trouble interfacing
:with cybercash.  Please help if you can.  Need no know how to put the cart
:into a this cart type id and carry it on into cybercash's invoice.

You have obviously posted to the wrong newsgroup.  There's no 
Perl language content in your message.  

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


The best defense against logic is ignorance.


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

Date: Mon, 16 Feb 1998 21:30:53 -0600
From: Zena_Goddess_Of_Fire@mindless.com (Mike Binkley)
Subject: Quick Reg Expression help
Message-Id: <Zena_Goddess_Of_Fire-1602982130530001@magmysmac.lfc.edu>

2 questions:

First of all, is there an easy way to look for a regular expression in
addition to any characters after it in a string?

   For example, given the string:  "This is a string of characters"

   if I searched for "is", I would want back "is is a string of characters"

Second, I'm having some trouble splitting on white space.  I was using:

      $_=$tokens;
      @tokens = (split);

which did exactly what I wanted it to, however when I was looking through
one of the man pages, I saw that doing a split on / / should have the same
effects.  So I though that:
      
      @tokens = split (/ /, $tokens)

should have exactly the same effect, but it doesn't always seem to work. 
Particularly, it has a tendency to put an null character in the first
space in the array.  

Any ideas about what I'm doing wrong?

Or will splitting in the second manner always put a null character into
the first space in the array so I can always compensate for it?

---

And on an unrelated note...is there a good way to access the indices of an
array that I'm traversing with a foreach loop?  or should I just use a for
loop?
Also, if such a method exists, would I run into trouble using it with
nested loops?


Thanks!

-Bink.


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

Date: 17 Feb 1998 05:10:32 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Quick Reg Expression help
Message-Id: <6cb648$3kc$1@marina.cinenet.net>

Mike Binkley (Zena_Goddess_Of_Fire@mindless.com) wrote:
: First of all, is there an easy way to look for a regular expression in
: addition to any characters after it in a string?

Do yourself a massive, incredible, you-won't-believe-how-cool-it-is favor 
and read one or more of:

- The 'perlre' man page
- _Learning Perl_ (the "Llama Book")
- _Programming Perl_ (the "Camel Book")

Without unerstanding how to set up a regex this simple, you've truly no 
hope at all of using Perl 'properly' (that is, to optimal effect).

: Second, I'm having some trouble splitting on white space.  I was using:
[snip]

perldoc -f split   -- and read what it says about the default splitting 
mode and other similar patterns.

: Any ideas about what I'm doing wrong?

Not R'ing TFM -- and I say that in the nicest possible way.  You simply 
*can't* use Perl effectively without studying the copious documentation, 
online and otherwise.

: Or will splitting in the second manner always put a null character into
: the first space in the array so I can always compensate for it?

Nope, unless your lines consistently have leading whitespace (hint,
hint...). 

: And on an unrelated note...is there a good way to access the indices of an
: array that I'm traversing with a foreach loop?  or should I just use a for
: loop?

'for' and 'foreach' are synonyms; only arguments distinguish the "C-like"
from the "csh-like" form. 

Most of the time, needing to use an explicit index in Perl indicates 
you've attacked the problem the wrong way (that is, you're working too 
hard, not taking advantage of Perl's power).

: Also, if such a method exists, would I run into trouble using it with
: nested loops?

Not if you use it correctly (how's that for a non-answer? :) ).

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Tue, 17 Feb 1998 00:22:51 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Quick Reg Expression help
Message-Id: <MPG.f52e8b7c394eb539896e8@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

Zena_Goddess_Of_Fire@mindless.com said...
:    For example, given the string:  "This is a string of characters"
: 
:    if I searched for "is", I would want back "is is a string of characters"

How about 
           m/is.*/

:       @tokens = split (/ /, $tokens)
: 
: should have exactly the same effect, but it doesn't always seem to work. 
: Particularly, it has a tendency to put an null character in the first
: space in the array.  

This means you've got a space at the beginning of the string $tokens.  But 
you've misunderstood perlfunc.  Read again:

   If PATTERN is also omitted, splits on whitespace (after skipping
   any leading whitespace).

"Whitespace" is not / /, it's /\s*/.  If the difference is unclear to you, 
then please fetch a cup of tea and settle down with perlre.  In fact, given  
your first question, I'd advise you to start the kettle.  There's also an 
entire FAQ about regexes, perlfaq6.  You might also enjoy the book "Learning 
Perl,"  which has an excellent tutorial section on regexes.

: And on an unrelated note...is there a good way to access the indices of an
: array that I'm traversing with a foreach loop?  or should I just use a for
: loop?

: Also, if such a method exists, would I run into trouble using it with
: nested loops?

The section "Foreach Loops" in the perlsyn document addresses these questions.

HTH.
-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 17 Feb 1998 06:30:44 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Quick Reg Expression help
Message-Id: <6cbaqk$8ht$1@marina.cinenet.net>

Martien Verbruggen (mgjv@comdyn.com.au) wrote:
: 
: my $string = "This is a string of characters";
: 
: # get everything after the first 'is'
: 
: $string =~ /(is.*)$/;

I don't think dropping the $ anchor changes the meaning of your regex, so 
you might as well leave it out.

: print $1, "\n";

Or even

  print "$1\n";

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Mon, 16 Feb 1998 23:52:40 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Retrieving mail from host
Message-Id: <MPG.f52e1a294e530799896e5@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

farber@f-tech.net said...
: Well, does perl have a module or something that will just return teh
: message of an e-mail????

Yes indeedy-do.  And, in the spirit of a certain aphorism which suggests that 
teaching a man to fish is better than serving him a tasty filet of sole, I 
send you on your way to

   http://www.perl.com/CPAN-local//CPAN.html

where you can look any time you wonder whether there's a module to do a given 
thing.  Hint: use your browser's "Find in page" command to search for "Mail".

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 17 Feb 1998 02:51:15 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Retrieving mail from host
Message-Id: <6catv3$63h$1@comdyn.comdyn.com.au>

In article <34e8ea7a.11827036@news.f-tech.net>,
	farber@f-tech.net (Paul Farber) writes:
> Hello all,
> 
> I need to take delivered mail (from /var/spool/mail/$username) and
> take the message out of the header and do some processing with it. 
> Basically, I want to send commands to a script via e-mail.  For
> example, if an e-mail comes in and has "add this line to the page", I
> want to remove the message and then pass it on to a script. Easy???
> 
> Well, does perl have a module or something that will just return teh
> message of an e-mail????

Check to see if procmail is installed. it will do all this.

man procmail
man procmailrc
man procmailex

If you have to do it yourself, 

man forward

and check one of the modules that start with Mail:: on CPAN.

http://www.perl.com/CPAN/

-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.       | cynical. It's perfectly easy to be
NSW, Australia                      | cynical.


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

Date: Mon, 16 Feb 1998 22:47:23 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
Subject: Re: RFC about ``Matt's Script Archive''
Message-Id: <34E9084B.52EFF68B@fccj.cc.fl.us>

What I would wonder is, if it is truly bad, why hasn't someone re-written it?

Or have they?
Things that make you go "Hmmmm..."

:-)
Bill



Tom Christiansen wrote:

>  [courtesy cc of this posting sent to cited author et al. via email]
>
> In comp.lang.perl.misc, mikael@techtalk.se (Mikael Skogstrom) writes:
> :I'm trying to use FormMail, from Matt's Script Archive...
>
> I have heard no end of criticisms about that set of programs.  I once
> looked at them myself and found them to be full of programming errors
> and undersights.  Could an expert perl programmer who has more recently
> examined them please comment on their robustness and style?
>
> --tom
> --
>         Tom Christiansen        tchrist@jhereg.perl.com
>
>     "Just because something is obviously happening doesn't mean something obvious
>     is happening." --Larry Wall





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

Date: Mon, 16 Feb 1998 23:09:58 -0500
From: Bob Trieger <corky@ultranet.com>
Subject: Re: script won't run...displays script text
Message-Id: <34E90D95.7EE5@ultranet.com>

SmallWorks wrote:
> 
> how do i make my perl script run?
> 
> UNIX system...
> I've uploaded the script file via ftp...
> I've used chmod 755 on the file name and checked that using the command
> ls -l...
> 
> I know the 'action' in the HTML page is correct (directory-wise) because
> 
> the script does display as text.


Sounds like the directory you are running the script from isn't
configured in your server. Talk to your sysadmin.

This question does not belong in the perl newsgroup, try 
news:comp.infosystems.www.authoring.cgi

HTH 
Bob Trieger
corky@ultranet.com


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

Date: Tue, 17 Feb 1998 00:00:38 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: script won't run...displays script text
Message-Id: <MPG.f52e37e38a49c029896e6@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

gameday@uslink.net said...
: how do i make my perl script run?

Hmm.  Sounds like something that may be addressed in the docs.  But I'm game.

: UNIX system...
: I've uploaded the script file via ftp...
: I've used chmod 755 on the file name and checked that using the command
: ls -l...

So far, so good.  You've got my attention.

: I know the 'action' in the HTML page is correct (directory-wise) because

D'oh!  It's a CGI/httpd configuration question.  You were *so* close to being 
on-topic.  You'll want to ask the same exact question over in

   news://comp.infosystems.www.authoring.cgi

assuming, of course, that you've first read both the documentation for your 
httpd and that newsgroup's FAQ.  You might want to browse ours, too.  It would 
have told you what I'm telling you now, and without being so irritatingly 
facetious.

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 17 Feb 1998 04:33:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: script won't run...displays script text
Message-Id: <6cb3ts$4tr$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, SmallWorks <gameday@uslink.net> writes:
:how do i make my perl script run?

Get up at 91 minutes before dawn, clothe yourself in neon green body
paint and nothing else, pour a little (blended) scotch out on the ground,
face the east, and cluck like a hen.

:I know the 'action' in the HTML page is correct (directory-wise) because

You have a web config problem.  This is unrelated to Perl, and anathema
to this newsgroup.

:I'm using cgi-lib.pl with require "cgi-lib.pl"; in the script...

Well, that was your third mistake.  Wouldn't you just rip out
your fingernails -- slowly -- instead of using that old thing?

Here, read these:

    The CGI Newsgroup (NOT THIS ONE):
	comp.infosystems.www.authoring.cgi

    CPAN's Web-related modules in Perl:
	http://www.perl.com/CPAN/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/

    The Idiot's Guide to solving Perl/CGI problems 
        http://www.perl.com/perl/faq/idiots-guide.html

    Perl FAQs
        http://www.perl.com/CPAN/doc/FAQs/

    Perl Manpages (old)
        http://www.perl.com/CPAN/doc/manual/html/

    CGI FAQ
        http://www.webthing.com/page.cgi/cgifaq

    WWW Security FAQ
        www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html

    Web FAQ
        http://www.boutell.com/faq/

    HTTP Spec
        http://www.w3.org/pub/WWW/Protocols/HTTP/

    HTML Spec
        http://www.w3.org/pub/WWW/MarkUp/

    CGI Spec
        http://hoohoo.ncsa.uiuc.edu/cgi/interface.html


--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    X-Windows: It could be worse, but it'll take time.
	--Jamie Zawinski


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

Date: Tue, 17 Feb 1998 00:30:35 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: script won't run...displays script text
Message-Id: <MPG.f52ea8315d4f2519896e9@news.concentric.net>

tchrist@mox.perl.com said...
: In comp.lang.perl.misc, SmallWorks <gameday@uslink.net> writes:
: :how do i make my perl script run?
: 
: Get up at 91 minutes before dawn, clothe yourself in neon green body
: paint and nothing else, pour a little (blended) scotch out on the ground,
                                         ^^^^^^^
With all due respect, you've misspelled "single-malt."

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


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

Date: Tue, 17 Feb 1998 02:45:37 GMT
From: c28f62@world.std.com (Mark Kramer)
Subject: Re: The Young Man and the Beach
Message-Id: <EoI501.16E@world.std.com>

In article <34E87585.3DDF6222@ti.com>, Graham Barr  <gbarr@ti.com> wrote:
>> Now, I notice, you were not able to tell me what I was to be so grateful
>> for, so your comment about "ungrateful" earlier must have been a typo.
>
>You should be grateful that there are people on this list who are
>here to just "help", Tom is just one of those people.

Ok, it took only three iterations, but we finally go to the answer:
there was nothing in that article I should have exhibited gratitude
for. It was "gratitude in general" that you found lacking because I 
commented on a specific article negatively.
 
I'm sorry if you don't think that personal thank you notes sent via
email aren't showing sufficient gratitude.

>> Then his actions do not match his purpose.
>
>Different people do things in different ways, once you learn to accept
>that you will find it a lot easier to get on with others on the net.

Hmmm, seems like that is supposed to be a two way street, isn't it?
Some people post using netscape...



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

Date: Tue, 17 Feb 1998 03:00:25 GMT
From: c28f62@world.std.com (Mark Kramer)
Subject: Re: The Young Man and the Beach
Message-Id: <EoI5op.99q@world.std.com>

In article <m3en13e6jp.fsf@windlord.Stanford.EDU>,
Russ Allbery  <rra@stanford.edu> wrote:
>There are some things on Usenet one either has to understand and accept or
>ignore.  

Good point. More later.

>Excessive interpretation followed by endless argument concerning
>them accomplishes absolutely nothing.  

Oh, please. Tom didn't intend it to be interpreted even though he spent 
the effort to post it? He didn't intend anyone to interpret his comments
about scurilous softtware to be interpreted that way? Am I to believe that
Tom does not mean what he posts?

>that level, and you're not even doing the newsgroup as a whole the
>courtesy of answering questions in the process of doing so.

I'm sorry. Which question was I asked that I didn't answer? Which
question was "The Young Man and the Beach" the answer to? Are you
seriously contending that every article posted to this discussion group
must be an answer to a perl question? 

>Please stop.

This is the answer to which question? "What does Russ say when he comes
across something in Usenet he can't understand and accept or ignore"?



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

Date: Mon, 16 Feb 1998 16:11:02 GMT
From: c28f62@world.std.com (Mark Kramer)
Subject: Re: The Young Man and the Beach
Message-Id: <EoHBME.5Ly@world.std.com>

In article <34E5DD0C.8677B4FF@hotmail.com>,
Larry D'Anna  <ldanna@hotmail.com> wrote:
>It is because of him and those like him that you have perl to talk 
>about anyway.  Those people _created_ this beach, if you want
>to be here you should play by their rules.

You need a USENET history lesson, perhaps.

>He doesn't jump down peoples throats for using crappy news readers. 

You need to learn how to read, perhaps. Read some of his recent articles.

> He
>informs people that their posts are ugly and need to be formatted correctly.

Yes, and he does this even when the articles are formatted correctly.

>He also makes several humorous and accurate comments about crappy news readers.

Hmmm.

>Maybe you should thank him for making you aware that better software than
>what you are currently using is available for free.

Excuse me? What problem do you have with trn?

>I have found his posts to be tremendously helpful, you would too if you 
>weren't so busy being defensive.

Hey, maybe that's the point. Make people defensive by insulting them
because they use a certain newsreader you don't like and maybe they
won't listen to you.




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

Date: Tue, 17 Feb 1998 00:22:27 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Using getopts() and exec()
Message-Id: <34E91E95.573D4098@coos.dartmouth.edu>

Grant Totten (EXCHANGE:CAR:5J42) wrote:
> 
> ... So I tried using this:
> 
> $command_line = "$CLEARTOOL, 'setview', '-exec', $0, $opt_v".;
> exec ($command_line);

That contains a syntax error.  What code did you really use?

-- 
 _ / '  _      /             rjk@coos.dartmouth.edu
( /)//)//)(//)/(                     chipmunk@m-net.arbornet.org
    /                                        http://www.ziplink.net/~rjk/


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

Date: 16 Feb 1998 15:34:23 -0800
From: JesusDLG
Subject: Using HTML Tags in forms (Content Type)
Message-Id: <6caidv$6bm@edrn.newsguy.com>

Hi all,
 
    This it's my 1st. post and probably you can give a hand with this:
 
    I'm looking for a Mailing List script and I want to inlude some HTML Tags 
in my message. Can anyone know a "free" script that handle this?. If so, where 
can I find it?
 
    Also, I'm doing some test modyifing some free scripts that I found on the 
net, and perhaps someone can help me with an answer, Did I need to have 
something in my server to handle HTML Tags in my forms? or just I need to 
modify or include the Contet-Type... in the script?
 
    I need that my users receive an email like a WebPage. Something like a I 
fill a field named message with some HTML code and my user receive an email in 
HTML format.

    Any comments or suggestions will be really apreciatte it.
 
    Thanks in advance!!!


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

Date: 17 Feb 1998 03:38:37 GMT
From: "Philip Kapusta" <shareware@erols.com>
Subject: Using Perl to encrypt credit card numbers at Web sites
Message-Id: <01bd3b55$36df3a60$3667accf@pentium-233mmx>

I have a Web site at which customers can place and order with a credit
card.  The site has SSL support, and the doorway page to the secure page is
called with "https".  Once at the secure page, I have a form with a Submit
button that posts the form's data to a CGI perl script.  Currently I am
performing a very basic 1 for 1 character swapping with the credit card
number, and then sending the form's data with the encrypted card number to
an email account.  So far it works, and no customer has called to report
that the process has been intercepted, nonetheless, not being a Perl expert
I'm a little concerned if some hacker may eventually break the very simple
trick I am doing:

$encrypted_card =~ s/1/g/g;  # replace all 1's with g's
$encrypted_card =~ s/2/q/g;  # replace all 2's with q's
$encrypted_card =~ s/3/d/g;  # replace all 3's with d's
 ..etc...

Is there a better way to handle a credit card order using HTML and Perl?  I
have been thinking that I should not be emailing the encrypted result to
myself, but rather write the form's data to a disk file in a protected
directory and then pick it up (FTP it) at a later time.

Currently when I receive an email order, I simply copy and paste the order
into a Delphi application on my local PC that decodes the encrypted card
number.

My questions would be:

1) Is there a better method to handle such a situation?

2) Can PGP be used with a Perl script?  If so, how?

Any comments, examples?

Thanks.

Phil


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

Date: Tue, 17 Feb 1998 03:23:04 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: WANTED UK PEARL SCRIPT PROGRAMER
Message-Id: <genepoolEoI6qG.CLF@netcom.com>

Martien Verbruggen (mgjv@comdyn.com.au) wrote:

: Now, if only someone would need my Visual Basic experience.

Could you write a PEARL compiler in Visual Basic?


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

Date: 17 Feb 1998 05:31:53 GMT
From: darlenem@flash.net (Jeeves)
Subject: Re: WANTED UK PEARL SCRIPT PROGRAMER
Message-Id: <slrn6ei9i4.6dp.darlenem@jeeves.flash.net>

On Tue, 17 Feb 1998 03:23:04 GMT, Jim Michael <genepool@netcom.com> wrote:
>Martien Verbruggen (mgjv@comdyn.com.au) wrote:
>
>: Now, if only someone would need my Visual Basic experience.
>
>Could you write a PEARL compiler in Visual Basic?

Isn't there a graphics language called pearl? Maybe whoever made the original
post meant to type 'comp.lang.pearl.misc' instead? ;p

-- 
---------------------------------------------------------------------
     J |  Copyright (c) 1997 Jeeves Industries Limited.
     J |  All rights reserved. Void where prohibited.
     J |  Some restrictions may apply. Limit 1 per customer.
 J   J |  Offer not valid in conjunction with any other offer.
  JJJ  |  Some sold separately. Not intended for children under 3.
---------------------------------------------------------------------
>From .cshrc:
alias rm 'rm -rf \!*'
alias hose kill -9 '`ps -augxww | grep \!* | awk \'{print $2}\'`'
alias kill 'kill -9 \!* ; kill -9 \!* ; kill -9 \!*'
alias renice 'echo Renice\?  You must mean kill -9.; kill -9 \!*'
=====================================================================


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

Date: Tue, 17 Feb 1998 04:57:26 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: what is exaclty the "_" Variable ?!?!
Message-Id: <ebohlmanEoIB3r.9Dt@netcom.com>

Claus van de Vlierd <vlierd@uni-oldenburg.de> wrote:
: I did not find in Larry Wall's "Programming Perl" - book
:   (O'Reilly , second edition , September 1996) a precise
:  definition of this (at least for me ..) strange Variable "_" .

That's because Perl doesn't have a special variable called "_"; it has 
two completely different special variables, one called "$_" and another 
called "@_".  This is consistent with Perl's rules for variable naming: 
$name, @name, %name and &name are different thingies entirely.


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

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

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