[9912] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3505 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 22 00:07:40 1998

Date: Fri, 21 Aug 98 21:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 21 Aug 1998     Volume: 8 Number: 3505

Today's topics:
    Re: "+<" vs "+>>" (was Re: Opening a file as "+>>file") <tchrist@mox.perl.com>
        a Perl CGI color-organ demo. It's Cycluphonic! (RHS Linux User)
    Re: COBOL and Perl birgitt@my-dejanews.com
    Re: COBOL and Perl (paulr)
    Re: Code Style (Was: How to sort this associative array <zenin@bawdycaste.org>
    Re: Code Style (Was: How to sort this associative array (Larry Rosler)
    Re: Code Style (Was: How to sort this associative array <zenin@bawdycaste.org>
    Re: Code Style (Was: How to sort this associative array <mpersico@erols.com>
    Re: comp.lang.perl.announce redux (Michael Rubenstein)
        Compile perl scripts into an executable? (Harry McGreggor)
    Re: copying file to a remote machine (Kelly Hirano)
    Re: Followup: why doesn't this work as expected... (Ronald J Kimball)
        Helo locating Modules... <straderb@mindspring.net>
        Help interpreting error message re: modules <gnielson@charlotte.infi.net>
    Re: How do I read a file backwards. (RHS Linux User)
        In which directory 'CGI.pm' file should be copied? <sucheta@nmtec.com>
    Re: Is Perl5.004 Year 2000 compilant? (Larry Rosler)
    Re: Looking for Perl FAQ Bot <jbc@west.net>
        need perl cgi help... <.>
    Re: Perl Bots! [Chatterbots, FAQbots, InfoBots] <mpersico@erols.com>
    Re: Reading from files (Ronald J Kimball)
    Re: Script wanted to change /etc/passwd passwords. <sneaker@sneex.fccj.org>
    Re: Substitution issue. (Ronald J Kimball)
    Re: Test Post 1 - please ignore (Gary L. Burnore)
    Re: Turn Perl program into binary (Abigail)
    Re: Turn Perl program into binary (Abigail)
    Re: Turn Perl program into binary <terjekv@ifi.uio.no>
    Re: vim - printing on DOS/Windows <nhdesign@netcom.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 22 Aug 1998 03:33:50 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: "+<" vs "+>>" (was Re: Opening a file as "+>>file")
Message-Id: <6rle6u$aem$1@csnews.cs.colorado.edu>

In comp.lang.perl.misc, Scratchie <upsetter@ziplink.net> writes:
:What's confusing -- and
:what may have been confusing the original poster -- is that there are
:numerous examples using "+<" (the "good" way to open a file for read/write
:access) but no examples using "+>>" (as Randal used in his original,
:much-imitated column).

That's because he didn't understand "+>>" when he wrote that.
This problem has since been fixed.

:	Just what is the [practical] difference between opening a file
:with a mode of "+<" and "+>>" ??  (and where, if not in the perl docs, is
:is it documented?)

Consider what O_APPEND means.

--tom
-- 
The Unix Way of doing something [...] is to make it look as much like a filter
as possible.  (Richard O'Keefe)        


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

Date: 22 Aug 1998 01:24:54 GMT
From: humbubba@raptor.cqi.com (RHS Linux User)
Subject: a Perl CGI color-organ demo. It's Cycluphonic!
Message-Id: <slrn6ts7ss.hmg.humbubba@raptor.cqi.com>


#!/usr/bin/perl   
#    rudimentary  CGI demo of cycluphonics 
#    Rick Hohensee    199980819   http://cqi.com/~humbubba
#    humbubba@cqi.com

#    This array is how we map a color wheel to the Cycle of Fifths.
#    That's the crux of the cycluphonic biscuit.
@cycle = ( 0 , 7 , 2 , 9 , 4 , 11 , 6 , 1 , 8 , 3 , 10 , 5 ,);

#  don't try CGI without something like the next 2 lines.  whew.
printf("Content-type:text/html\n\n");
printf("<!DOCTYPE html PUBLIC \"-//IETF// DTD HTML 2.0//EN\">\n");

printf("<html>  \n<title> CGI Cycluphone </title> \n<body ");

#  cgi form input parse code from Rueven M. Lerner
#    via Kira's Web Toolbox
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
    ($name, $value) = split(/=/, $pair);
    # Un-Webify plus signs and %-encoding
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    # Stop people from using subshells to execute commands
    # Not a big deal when using sendmail, but very important
    # when using UCB mail (aka mailx).
    #  $value =~ s/~!/ ~!/g;   ## huh?
    $FORM{$name} = $value;
}

delete ($FORM{submit});

#  declare a 12-hue color wheel as separate R, G and B arrays
@wheelred  =
( 255 , 255 , 255 , 127 , 0 , 0 , 0 , 0 , 0 , 127 , 255 , 255 );
@wheelgreen =
( 0 , 127 , 255 , 255 , 255 , 255 , 255 , 127 , 0 , 0 , 0 , 0 );
@wheelblue =
( 0 , 0 , 0 , 0 , 0 , 127 , 255 , 255 , 255 , 255 , 255 , 127 );


@noteons = values(%FORM);
$increm = 0;
for ( @noteons ){
	$sum = $sum + $_  ;
	$redac=$redac + ($wheelred[$cycle[$increm]] * $noteons[$increm]); 
	$greenac=$greenac + ($wheelgreen[$cycle[$increm]] * $noteons[$increm]);
	$blueac=$blueac + ($wheelblue[$cycle[$increm]] * $noteons[$increm]);
	$increm=$increm + 1;
}
unless ( $sum > 0 ) { $sum = 3; }
$red = $redac / $sum;
$green = $greenac / $sum;
$blue = $blueac / $sum;

# the following text=  is our color output
printf(" bgcolor = \"#%x%x%x\" text=\"#FFFFF0\" >\n",$red ,$green ,$blue);

# body of page
printf("      <p>     simple CGI demo of Cycluphonics <br>\n");
printf("Here's 12 notes. Enter numbers for the relative weight ");
printf("of each note you'd like to see combined into a chord/color. \n");
printf("A C Major triad would be a 1 in C, E and G.<br>\n"); 
printf("When you get the notes you want specified hit the Submit widget \n");
printf("and the background color will change to the cycluphonic \n");
printf("equivalent of the chord you specified.<br>\n");

printf("      <form method=get action=\"cycluphone-cgi\" >\n");
printf("             <input name=submit type=submit>\n");
printf("             <input name=reset type=reset ><br>\n");

printf("\n");
printf("  C .   <input name=\"aa\" size=3 value=1>\n");
printf("  D .   <input name=\"ac\" size=3 value=0>\n");
printf("  E .   <input name=\"ae\" size=3 value=1>\n");
printf("  F .   <input name=\"af\" size=3 value=0>\n");
printf("  G .   <input name=\"ah\" size=3 value=1>\n");
printf("  A .   <input name=\"aj\" size=3 value=0>\n");
printf("  B .   <input name=\"al\" size=3 value=0><br>\n");
printf("             C shrp   <input name=\"ab\" size=3 value=0>\n");
printf("             D shrp   <input name=\"ad\" size=3 value=0>\n");
printf("  .....    F shrp<input name=\"ag\" size=3 value=0>\n");
printf("             G shrp   <input name=\"ai\" size=3 value=0>\n");
printf("             A shrp   <input name=\"ak\" size=3 value=0>\n");

printf("      ");
printf("      </form>");
print "More info on Cycluphonics is accessible from my top page at<br>";
print "<a href = http://cqi.com/~humbubba>Rich Hohensee's page</a>";

printf("\n\n</body>\n</html>\n");

-- 
Rick Hohensee          http://cqi.com/~humbubba
colorg on EFnet IRC    #linux chanop
Forth  C   Linux   graphics   music    Md., USA


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

Date: Sat, 22 Aug 1998 01:47:34 GMT
From: birgitt@my-dejanews.com
Subject: Re: COBOL and Perl
Message-Id: <6rl7vn$27s$1@nnrp1.dejanews.com>

In article <6rkfeb$kqc@sjx-ixn6.ix.netcom.com>,
  "William M. Klein" <wmklein@ix.netcom.com> wrote:

[snip]

> However, I did think that I would
> point out, that the one and only thing that the comp.lang.cobol charter says
> that is NOT welcome in the NG is "language wars".

I have to apologize, may be, to have posted the original question.
But I was not aware that I would initiate a "language war", which
caught me a bit by surprise.


> Having said that, I know a lot about COBOL and almost nothing about Perl.
> Therefore, I have been following the debate (discussion? diatribes?) back
> and forth in the hope that I might read something that would give me some
> understanding about the differences and what Perl offers (that is harder or
> impossible in COBOL).  I have seen a few posts like this, but they sure are
> in the minority.

Basically I asked the question in order to get pointers in which
areas both languages are different, so that I can choose what to
read more effectively. But the question was still so general that
also it didn't make a lot of sense to post it at all, I admit.



>
> Is there anyone in either NG who actually makes their living today with both
> COBOL (the current variation, not some pre-ANS'85 archaic version) and also
> Perl who can give a *brief* comment on when they use which and what types of
> constructs or applications are better in one than the other?  My guess is
> that the major difference on when you use which is dependent on what your
> management wants, what your shop is used to, and/or what an existing
> application is already expecting.   However, if there are some real
> differences (that someone who works with both today) can tell me, then I
> would be interested in this.
>

Me too.

Birgitt Funk

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 22 Aug 1998 03:22:27 GMT
From: paulr@bix.com (paulr)
Subject: Re: COBOL and Perl
Message-Id: <6rldhj$na5@lotho.delphi.com>


Well, sure, you can rewrite a COBOL program in PERL. It 
may be incomprehensible to you six days later, but you can 
do it. 

PERL does not have the built in database capabilities that
COBOL has, so you will find it more difficult to do the 
same tasks in PERL that COBOL excels in. On the other paw,
I sure wouldn't use COBOL for a text scanning or SGML 
application. <grin> 

If you have started into C, then go ahead into PERL. 
You will find COBOL is a very different world than either of 
those two languages, but a very rewarding one to learn.
In fact, learning ANY programming language is a rewarding 
experience. 

-Paul


birgitt@my-dejanews.com wrote:
: A couple of months ago I got here (clpm) the advice not using Perl
: as the first language when starting to learn how to program. It was
: recommended using PASCAL, C, AWK, and then Perl.

: I will be exposed to COBOL programs on my first internship
: and wonder if COBOL could replace the role of PASCAL for me.

: Having skipped reading much about PASCAL, reading only about
: C so far and not getting into Perl yet, I would like to know
: if in general COBOL programs could be rewritten effectively in
: Perl.

: I saw a thread in comp.lang.cobol where someone indicated that
: a three page COBOL program could be rewritten in AWK in five
: lines, so I wonder if this might be the same with Perl.
: Are there things in COBOL which can't  be done in Perl.
: Are there any or many ?

: Birgitt Funk



: -----== Posted via Deja News, The Leader in Internet Discussion ==-----
: http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 22 Aug 1998 00:33:53 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <903745929.766265@thrush.omix.com>

John Porter <jdporter@min.net> wrote:
: Thank you, Zenin!  Great minds think alike. ;-)

        And so do ours. :-)

: Although, for ST-type multi-liners, I usually align the lbrace too:
: 	map  { $_->[0] }
: 	sort { $b->[1] <=> $a->[1] } # descending numeric
: 	map  { [ $_, (split (',', $team{$_})[3] ] }

        I only do that when I've had more then 3 hours sleep in the
        last 48. :-)

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Fri, 21 Aug 1998 19:02:38 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <MPG.1047c6995712eaa49897db@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <35DDBC27.69E3@min.net> on Fri, 21 Aug 1998 14:27:51 -0400, 
John Porter <jdporter@min.net> says...
> Zenin wrote:
 ...
> >         for (
> >             map { $_->[0] }
> >             sort { $b->[1] <=> $a->[1] } # descending numaric
> >             map { [ $_, (split (',', $team{$_})[3] ] }
> >             keys %team
> >         ) {
> >             ## Insert nifty code here
> >         }
 ...
> 	map  { $_->[0] }
> 	sort { $b->[1] <=> $a->[1] } # descending numeric
> 	map  { [ $_, (split (',', $team{$_})[3] ] }

Does either of you believe in balancing parentheses also? :-)

-- 
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 22 Aug 1998 02:32:26 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <903753039.820322@thrush.omix.com>

Larry Rosler <lr@hpl.hp.com> wrote:
        >snip<
: Does either of you believe in balancing parentheses also? :-)

        Oh yes, normally to the next tab stop too, just because it's
        easier to quickly align that way.

        fooBar          ('cat',         'dog')  or die $@;          # comment
        somethingElse   ('something'    'dog')  or die "duh!";      # comment
        barkAtDog       ('something'    'else') or die "hmm...";    # comment

        Only if they are somehow related of course.  It's style like this and
        good arguments from Russ in another thread that that made me recently
        move to use spaces instead of tabs.
-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Fri, 21 Aug 1998 23:20:36 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <35DE3904.9F2A3A89@erols.com>

I format it however Ilya formats it.

:-)
-- 
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're 
## supporting the program at 2AM


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

Date: Sat, 22 Aug 1998 03:05:17 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: comp.lang.perl.announce redux
Message-Id: <35e2322c.42610550@nntp.ix.netcom.com>

On 21 Aug 1998 22:46:47 GMT, Tom Christiansen <tchrist@mox.perl.com>
wrote:

> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, "Daniel Adams" <dan@fearsome.net> writes:
>:However, the divisions between American English and British English are too
>:great to fall under any lesser category of divission (such as "dialect") and
>:have reached a stage where they are two seperate languages in their own
>:right. 
>
>Pardon me, but what language is it that has words such as "divission"
>and "seperate"?  Certainly not English.  Whatever your native language
>actually happens to be, I don't think you're in much a position to be
>dictating to scholars what constitutes a language and what a dialect,
>particularly with regard to a language that you do not appear to write.

Perhaps he learned from a very old book. "seperate" is listed in the
OED as an obsolete variant of "separate."  The most recent quote given
with that spelling is from 1555. :-)

--
Michael M Rubenstein


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

Date: Sat, 22 Aug 1998 07:36:53 GMT
From: harry@dublin.net (Harry McGreggor)
Subject: Compile perl scripts into an executable?
Message-Id: <35de7492.8138816@news.netcom.ca>

Hi!

I have a few perl scripts I have written which I don't want people to
"rip" off. How can I compile a perl script into an executable? I've
seen many commercial perl scripts in a compiled form ... just
wondering how I could do this.

I'm running FreeBSD, so I only need the perl script compiled into an
executable for this platform.

Any help would be super!



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

Date: 21 Aug 1998 17:19:08 -0700
From: hirano@Xenon.Stanford.EDU (Kelly Hirano)
Subject: Re: copying file to a remote machine
Message-Id: <6rl2ps$r75@Xenon.Stanford.EDU>

In article <35DE0140.AD516979@pacbell.net>, josri  <josri@pacbell.net> wrote:
>Hi
>I have a perl script to fetch a file from a remote machine. But I would
>like to know how to put (upload) a file on a remote machine.
>
># script for fetching a file from a remote machine.
>use LWP::UserAgent;
>$ua=new LWP::UserAgent;
>$req=new HTTP::Request 'GET' = 'http://www.xxxxxx.com/';
>$res=$ua=>request($req);
>if($res->is_success) {
>   print $res->content;
>}

well, you're already using LWP, so check the docs for info on how to use put
or post (for http transfers).

	perldoc LWP

for ftp transfers, you should probably use Net::FTP

	perldoc Net::FTP

of if it isn't installed on your system (not sure if it is in the standard
distribution of perl), you can pick it up at your closest CPAN mirror (check
http://www.perl.com).
-- 
Kelly William Hirano	                    Stanford Athletics:
hirano@cs.stanford.edu	                 http://www.gostanford.com/
hirano@alumni.stanford.org      (WE) BEAT CAL (AGAIN)! 100th BIG GAME: 21-20


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

Date: Fri, 21 Aug 1998 22:47:51 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Followup: why doesn't this work as expected...
Message-Id: <1de4v7y.15olv16kk3ss1N@bay2-20.quincy.ziplink.net>

<newsgrp@business-heaven.com> wrote:

> Am I right is assuming that the following commands are equivalent. ie both
> escape all the .'s in a string.
> 
> $_ = "a.b.c"  trying to produce $_ = "a\.b\.c"
> 
> $_=~s/\./\\\./g;
> 
> is the same as
> 
> $_=~tr/./\./;

No, you cannot use tr/// to escape characters.  tr only performs
*one-to-one* translation.  You can never end up with more characters
than you started with when using tr///.  (You can end up with less,
though, if you use tr///d.)

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


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

Date: Fri, 21 Aug 1998 23:47:06 -0400
From: Billy Strader <straderb@mindspring.net>
Subject: Helo locating Modules...
Message-Id: <35DE3F39.6A2C6ABE@mindspring.net>

Hey Everyone,

OK I need a little help.  Where is a good source to find modules for
perl on a Linux 2.0.34 i586.  The module I am looking for mainly is GD.
Any help available will be greatly appricaited.

Regards,

Billy Strader
straderb@mindspring.com



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

Date: Fri, 21 Aug 1998 22:30:16 -0400
From: Gary Nielson <gnielson@charlotte.infi.net>
Subject: Help interpreting error message re: modules
Message-Id: <35DE2D38.FDD4F693@charlotte.infi.net>

I have a perl script I'm running that works fine on other machines but
on this one generates the following error. What does this error mean?
Both these files, perldiag.pod and diangostics.pm, exist. Any help
appreciated. Please email reply as well.

couldn't find diagnostic data in /usr/lib/perl5/pod/perldiag.pod
/usr/lib/perl5/i586-linux/5.003 /usr/lib/perl5
/usr/lib/perl5/site_perl/i586-linux /usr/lib/perl5/site_perl .
submitsite.pl at /usr/lib/perl5/diagnostics.pm line 225, <POD_DIAG>
chunk 507.
BEGIN failed--compilation aborted at submitsite.pl line 69, <POD_DIAG>
chunk 507.





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

Date: 22 Aug 1998 01:30:11 GMT
From: humbubba@raptor.cqi.com (RHS Linux User)
Subject: Re: How do I read a file backwards.
Message-Id: <slrn6ts86p.hmg.humbubba@raptor.cqi.com>

On 21 Aug 1998 17:59:32 -0500, Jim Woodgate <jdw@dev.tivoli.com> wrote:
>
>Robert Saunders <saunder@kben.co.uk> writes:
>> I want to look through some very large files for particular lines.
>> Since I want the last occurence of these lines,  working from the end
>> of the file towards the start would be preferable. other than repeatedly
>> 
>> invoking `tail -n` with n increasing can anybody suggest a better way.
>
>perldoc -f seek
>
>you could seek to the end of the file, read backwards (saving
>characters as you went along, when you hit the end of a line, simply
>return  reverse $line.
>
>I don't know if that would actually be faster than just going through
>the entire file (where you have perl and os optimizations working in
>your favor) even if the file is really long, but under certain
>conditions it might...
>
>-- 
>Jim Woodgate 
>Tivoli Systems
>E-Mail: jdw@dev.tivoli.com

you can call unix tac. cat backwards line-wise. rev is charachter-wise.



-- 
Rick Hohensee          http://cqi.com/~humbubba
colorg on EFnet IRC    #linux chanop
Forth  C   Linux   graphics   music    Md., USA


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

Date: Fri, 21 Aug 1998 18:07:35 -0700
From: Sucheta Khot <sucheta@nmtec.com>
Subject: In which directory 'CGI.pm' file should be copied?
Message-Id: <35DE19D7.FB2@nmtec.com>

Hi,

First of all, I am thankful who responded to all of my questions posted
on this newsgroup. That has helped me a lot for my perl scripting.

My question is, in which directory CGI.pm file should be copied? I have
Perl 5.005 version. So there are 'lib' & 'bin' directories under
C:\Perl\5.005 directory.

Thanks.


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

Date: Fri, 21 Aug 1998 18:10:49 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <MPG.1047ba72faf7b20898976d@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <6rk3qq$k1o$1@clarknet.clark.net> on 21 Aug 1998 15:30:34 GMT, 
alexk@appliedtheory.com <alexk@appliedtheory.com> says...
> Jeff Gao <jeff_gao@bctel.net> wrote:
> : Does anybody know that whether perl 5.004 is y2k compilant?
> 
> Yes, but it is not Y2.38K compliant.

I wouldn't care much about that.  But you meant Y2.038K, and that *is* 
something to be concerned about. 

-- 
(Yet Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 21 Aug 1998 17:32:19 -0700
From: John Callender <jbc@west.net>
Subject: Re: Looking for Perl FAQ Bot
Message-Id: <35DE1193.9CE7324D@west.net>

> Harry McGreggor <harry@dublin.net> wrote:
> : I'm looking for a Perl FAQ Bot which spits out entrys in a given FAQ
> : according to the users input. Do any such programs exist?

There was a handout floating around at the Perl Conference with the
following URL, where you get something like this, at least for FAQs
covering Perl, CGI scripting, HTML, and JavaScript:

http://www.querybot.com/faqbot/

--
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: Fri, 21 Aug 1998 21:38:53 -0400
From: <.>
Subject: need perl cgi help...
Message-Id: <6rl7ip$79u@woody.wcnet.org>

JFTR i'm totally new to perl and cgi stuff.  I'm kind of hopping someone is
willing to write a skeleton program for me. but if someone can point me to a
site that will help me out that'll work too. I want to take some input from
a web page(like 6 single line text inputs) and then compare each one against
a list from a text file.  so it will compare input 1 with line 1 of the file
and input 2 with line 2 and so on.  if will then tell you which ones are
right and which are wrong.  like I said if someone could write a skeleton
program that would be great.  thanks in advanced.

alan

p.s. sorry if this is the wrong newsgroup to be asking but I'm not sure
where to go.




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

Date: Fri, 21 Aug 1998 23:36:04 -0400
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Perl Bots! [Chatterbots, FAQbots, InfoBots]
Message-Id: <35DE3CA4.6363A9A4@erols.com>

Well, looks like TPJ is healthy. That's the third thread on this topic I've seen in the last week.

-- 
#!/usr/bin/perl -- Matthew O. Persico
print "Just Another Perl Neophyte\n";
## Simplicity is a blessing when you're 
## supporting the program at 2AM


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

Date: Fri, 21 Aug 1998 22:47:45 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Reading from files
Message-Id: <1de4udr.1dy3uvt1hoahj4N@bay2-20.quincy.ziplink.net>

I.J. Garlick <ijg@csc.liv.ac.uk> wrote:

> Ok Ok. I never put a die there, I know I should but I never do. This was
> supposed to only give the relevant bit, I wasn't going to the trouble of
> writing a complete script.

My point was just that you could have put the die there, instead of a
comment saying you should put the die there.  :-)
I hope you didn't take it as a criticism, it was just an observation of
something amusing.

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


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

Date: Fri, 21 Aug 1998 23:09:43 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Script wanted to change /etc/passwd passwords.
Message-Id: <35DE3677.B754C30E@sneex.fccj.org>

Vincent Verhagen wrote:
> 
> Hi.
> 
> I'm looking for a CGI / Perl script that allows users of my Linux system to
> change their /etc/passwd password via the web server. Does anybody know
> if/where such a script is available?
> 
> Thanks very much in advance!
> 
> Vincent.

At http://www.perl.com Look under Security.

HTH,
-Sneex- 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | Murphy's Law of Research:
           Enough research will tend to support your theory.


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

Date: Fri, 21 Aug 1998 22:47:48 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Substitution issue.
Message-Id: <1de4uny.11m8e91oggawyN@bay2-20.quincy.ziplink.net>

Kevin Holbrook <kevin@templegames.com> wrote:

> I am trying to substitute all commas in a string between double quotes
> with carats.
> 
> I have tried :
> 
> 1 while ($string =~ s/\"(.*?)\,(.*?)\"/$1^$2/g);
> 
> Also :
> 
> $string =~ s/\"(.*?)\,(.*?)\"/$1^$2/gs;
> 
> But, I can never seem to replace more thjan the first instance of the
> comma.

Both regexes remove the double quotes the first time they match a comma.
After that, there are no more double quotes for the regexes to match, so
they're not able to replace any more commas.

You could fix this by preserving the double quotes, but here's a better
way to do it:

$string =~ s/("[^"]*")/($x=$1)=~tr!,!^!;$x/ge;

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


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

Date: Sat, 22 Aug 1998 00:26:17 GMT
From: gburnore@databasix.com (Gary L. Burnore)
Subject: Re: Test Post 1 - please ignore
Message-Id: <35df1000.166220765@nntpd.databasix.com>

On Fri, 21 Aug 1998 11:46:59 -0700, in article
<35DDC0A3.804C6C5C@hsc.hac.com>, Ben Pavon <ben.pavon@hsc.hac.com> wrote:

>Doing a test. Had problems posting a reply.

Did you know if you posted to a TEST group that you'd receive an automatic
reply to your post?  This is _NOT_ a test group.
-- 
      I DO NOT WISH TO RECEIVE EMAIL IN REGARD TO USENET POSTS
---------------------------------------------------------------------------
                  How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore                       |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
DOH!                                  |  ][3:]3^3:]33][:]3^3:]3]3^3:]3]][3
                                      |  ][3 3 4 1 4 2  ]3^3 6 9 0 6 9 ][3
Special Sig for perl groups.          |     Official Proof of Purchase
===========================================================================


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

Date: 22 Aug 1998 01:45:51 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Turn Perl program into binary
Message-Id: <6rl7sf$oo3$1@client3.news.psi.net>

Lily Y. Fu (lily@tigr.org) wrote on MDCCCXVI September MCMXCIII in
<URL: news:35DDEAC6.347B@tigr.org>:
++ Hi,
++ 
++ I have a perl program having password information in clear text.
++ I want people to run the program but don't want them to
++ know the password. If I make the program not readable by
++ the user, it won't run.
++ 
++ Is there a way to "compile" the program into binary
++ so that the password is not in clear text at least?

No, for the trivial reason that such a binary could be decompiled
and the password retrieved.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: 22 Aug 1998 01:52:48 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Turn Perl program into binary
Message-Id: <6rl89g$oo3$2@client3.news.psi.net>

Terje Kvernes (terjekv@ifi.uio.no) wrote on MDCCCXVI September MCMXCIII
in <URL: news:wxx67fmneid.fsf@hel.ifi.uio.no>:
++
++  2) I dont think it wouldn't help much.
++     Programs like "strings" fetch strings from files. A compiled file
++     still contains the literal strings you have enterd in he file.
++     This is at least the case for C and Java, and I doubt it'll change
++     with perl.

Yes. But that's trivial to fix. A program like "strings" just looks for
sequences of printable characters, with a minimum lenght. Strings won't
find your password if it contains enough non-printable characters.

Another technique is to not store the password, but say an array of
1000 strings, and generate the password by xorring a subset of them,
or perform some other technique on them.

It still won't stop the one with a decompiler, or an hex editor though.

++ Hint:
++ Since your not running Windows, use crypt. Makes things so much safer.
++ And it isn't easy to get around...


And crypt is going to solve his problem exactly how?



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9 and
         ${qq$\x5F$} = q 97265646f9 and s g..g;
         qq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: 22 Aug 1998 04:52:12 +0200
From: Terje Kvernes <terjekv@ifi.uio.no>
Subject: Re: Turn Perl program into binary
Message-Id: <wxxaf4x919f.fsf@gladsheim.ifi.uio.no>

abigail@fnx.com (Abigail) writes:

> Terje Kvernes (terjekv@ifi.uio.no) wrote on MDCCCXVI September MCMXCIII
> in <URL: news:wxx67fmneid.fsf@hel.ifi.uio.no>:
> ++
> ++  2) I dont think it wouldn't help much.
> ++     Programs like "strings" fetch strings from files. A compiled file
> ++     still contains the literal strings you have enterd in he file.
> ++     This is at least the case for C and Java, and I doubt it'll change
> ++     with perl.
> 
> Yes. But that's trivial to fix. A program like "strings" just looks for
> sequences of printable characters, with a minimum lenght. Strings won't
> find your password if it contains enough non-printable characters.
> 
> Another technique is to not store the password, but say an array of
> 1000 strings, and generate the password by xorring a subset of them,
> or perform some other technique on them.
> 
> It still won't stop the one with a decompiler, or an hex editor though.

It all just depends on how much time someone cares to try. Nothing is
"safe". =)
 
> ++ Hint:
> ++ Since your not running Windows, use crypt. Makes things so much safer.
> ++ And it isn't easy to get around...
> 
> 
> And crypt is going to solve his problem exactly how?
 
If the user is being prompted for the password, no matter where you
retrive the correct password from it'll be pretty safe.
 
like:
$pass = "XrdKIkaN/ucs4";
chomp($try = <>)
if ($try eq $pass) {
	let's go!
}

or am I missing something here?

-- 
Terje Kvernes
http://www.stud.ifi.uio.no/~terjekv/


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

Date: Sat, 22 Aug 1998 00:38:17 GMT
From: Vic <nhdesign@netcom.com>
Subject: Re: vim - printing on DOS/Windows
Message-Id: <nhdesignEy2F3t.Ct7@netcom.com>



tested with win95 in a dos window.

:w !lpr

nope, no response as far as I can tell.

Both:

:!type filename.txt > prn

:w >> lpt1

Both send the file to my HP deskjet
but it prints then stops, does not form feed.
Display says "waiting for data".


To print a file from a dos window I use this bat file,
but after I do, the regular windows, click mouse stuff, print
command does not work until after I reboot.
Formfeed.txt is just a file with a ctrl-l in it to eject the paper.

17:29:Fri 08-21-1998 C:\tmp >cat \etc\lp.bat
copy %1 lpt1
copy \etc\formfeed.txt lpt1


Thanks, 

Vic



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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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