[9913] in Perl-Users-Digest
Perl-Users Digest, Issue: 3506 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 22 07:07:27 1998
Date: Sat, 22 Aug 98 04: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 Sat, 22 Aug 1998 Volume: 8 Number: 3506
Today's topics:
"No index" cgi <bpn@get2net.dk>
Re: <SELECT multiple...> only returns 1st value <REPLY_TO_lastronin@earthlink.net>
array of alphabet <dvwatson@exodus.wvnet.edu>
Re: ASP,perlscript,@array <masonj@erols.com>
Re: Code Style (Was: How to sort this associative array <zenin@bawdycaste.org>
Re: Compile perl scripts into an executable? <nguyend7@msu.edu>
Re: Compile perl scripts into an executable? (Harry McGreggor)
Re: Compile perl scripts into an executable? <hairong@pilot.msu.edu>
Re: File updating question <REPLY_TO_lastronin@earthlink.net>
Re: Helo locating Modules... <jbc@west.net>
Help writing a TCP client <dove67@netscape.net>
Re: Is Perl5.004 Year 2000 compilant? (Marc Haber)
Re: Is there a manner to get around the problem of POSI (Lupe Christoph)
Re: need perl cgi help... <dove67@netscape.net>
Re: Perl Bots! [Chatterbots, FAQbots, InfoBots] (Harry McGreggor)
Re: Perl Lex ? Perl Yacc ? <eatonn@msn.com>
Sending file to browser <stathy@jaske.com>
Re: Sending file to browser <nguyend7@msu.edu>
Re: Sending file to browser <stathy@jaske.com>
testing Text::GenderFromName <jbc@west.net>
Re: Turn Perl program into binary (Abigail)
Re: Turn Perl program into binary (Abigail)
Re: Turn Perl program into binary (Harry McGreggor)
Warnings when dereferencing hashes? <jc_cann@ix.netcom.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 22 Aug 1998 12:16:37 +0200
From: "Brian Nielsen" <bpn@get2net.dk>
Subject: "No index" cgi
Message-Id: <6rm5pp$mss$1@dalen.get2net.dk>
Hi there,
I am looking for a cgi-script that can make a nice html site of all the
files in a directory without an index.html.
Do you know where I can find sutch a script.
There is an example here http://saturn.ssdel.com/cgi-bin/midi.pl? (this
script take all the files in the
ftp dir and makes a html site on the fly.
Please help
Brian
------------------------------
Date: Sat, 22 Aug 1998 00:45:20 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: <SELECT multiple...> only returns 1st value
Message-Id: <6rlhom$8qq$1@holly.prod.itd.earthlink.net>
Tom Phoenix wrote in message ...
>On Fri, 14 Aug 1998, Ha wrote:
>
>> Tom Christiansen wrote in message
<6qav3d$16b$1@csnews.cs.colorado.edu>...
>> >In comp.lang.perl.misc, someone wrote:
>> >:EEk!!!!
>> >:
>> >:Everyone yells about using CGI.pm. People overcomplicate things and
force
>> >:the rest of us to be lazy. It's wonderful to NOT reinvent the wheel.
Then
>> >:again, if you don't even know the basics of wheel-ism, you're not gonna
>> >:learn much.
>> >
>> >Guess what? Your code is wrong. Better go study CGI.pm some more.
>>
>> yup. that was me. guess what? it works--all the time, every time.
>
>Tom C was right. If you're going to write your own code, you have to
>follow the specification. The fact that your code "works" is no excuse.
>You can skydive for years without bothering to bring a second parachute,
>but that doesn't mean that your actions are acceptable.
>
>If you're going to write your own code, instead of using CGI.pm, you have
>to follow the CGI specification. There's no way around it.
Both Toms AND Larry are right. For some reason, I get the sense there are
two worlds of scripters/programmers--that's it exactly. Larry was very
correct on the points, however, it's a matter of perspective. If my whole
intention is to have a quick and dirty script, then that's what that little
sub was for. Pardon my obstinance, but that was my *original* post. And I do
believe I'm obeying the CGI rules.
I had thought to post a lengthy reply citing RFC this number and that
number, etc., particularly concerning "what if REQUEST_METHOD is not
defined" or to that effect. HUH??? On the one hand, the programmer, and this
is something I learned straight out of the turquoise camel book a la Tom C.,
would do well to account for all eventualities, then on the other hand, my
purpose is to let other people do their job and for my little scripts to do
their jobs as efficiently as possible, even if I'm bending the rules a bit.
Isn't that why Perl is so great? Yes, I have namespace problems. Yes, I take
a lot of things for granted and assume other things. This is because I am
writing for myself and I know how I set up my system.
One last weak attempt at self defense and this will be the last I'll speak
of it... If folks would read my original post, perhaps they would understand
my gist?!! At least by writing this quick, dirty, and yes, flawed little
sub, and humbly posting and then getting whacked down by
the almighty Perl gurus of the group
i've learned something. i can't say the same for someone who just wanted to
extract all the values from a multiselect and had to wade through the CGI.pm
module to get that nugget of info.
alright, i'm tired.
let's all go for a beer.
cheers,
ha quach
> http://hoohoo.ncsa.uiuc.edu/cgi/
>
>Cheers!
>
>--
>Tom Phoenix Perl Training and Hacking Esperanto
>Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
------------------------------
Date: Thu, 20 Aug 1998 10:19:11 -0400
From: Dave Watson <dvwatson@exodus.wvnet.edu>
Subject: array of alphabet
Message-Id: <35DC30B6.2C72@exodus.wvnet.edu>
Hi All:
What is the easiest way to create a 26 element array
where each element is a different letter of the alphabet.
I can do this the long way, use qw and list them all, but I'm
sure there is a slicker way than that.
Thanks for your time.
--
Dave Watson
dvwatson@exodus.wvnet.edu
#! rnews 1427
Path: uunet!uunet!uunet!in2.uu.net!chippy.visi.com!news-out.visi.com!newsfeed1.swip.net!swipnet!news-feed.inet.tele.dk!bofh.vszbr.cz!nntp.news.xara.net!xara.net!server5.netnews.ja.net!HEAnet!web3.tcd.ie!acer.gen.tcd.ie!tpwalsh
From: tpwalsh@acer.gen.tcd.ie (Ormond)
Newsgroups: soc.culture.irish,ni.politics
Subject: Re: Gobshite Awards - New Nomination
Date: 20 Aug 1998 11:15:38 GMT
Organization: Urmhummhan
Lines: 21
Message-ID: <6rh0gq$3fq@web3.tcd.ie>
References: <35DADDB5.481366E0@hotmail.com> <35db776e.98588916@news.supercity.ns.ca> <35dbfcda.46825250@news.nwlink.com> <35DC0043.912977EC@hotmail.com>
NNTP-Posting-Host: acer.gen.tcd.ie
Xref: uunet soc.culture.irish:212308 ni.politics:20606
In article <35DC0043.912977EC@hotmail.com>,
Paul Moloney <paul_moloney@hotmail.com> wrote:
>Danielle Ni/ Dhighe wrote:
>
>You know, I should bother to reply to you,
>but I think don't think there's any point.
>Your blithe dismissal of Omagh as a "mistake"
>and your total insensitivity to people here
>(like me) who knew people in Omagh by talking
>about violence as a "useful tool" pegs you
>as a sociopath.
>
It pegs her as a supporter of fascist criminals. Don't waste your time and
sanity arguing with these people.
>P.
-- But it's no use, says he. Force, hatred, history, all that. That's not life
for men and women, insult and hatred. And everybody knows that it's the very
opposite of that that is really life.
------------------------------
Date: Sat, 22 Aug 1998 02:22:28 -0400
From: "John Mason Jr" <masonj@erols.com>
Subject: Re: ASP,perlscript,@array
Message-Id: <6rlo6u$gha$1@winter.news.erols.com>
Let me try to point you in the right direction although I am still very new
to perl. In Advanced Perl Programming pg 8
it appears that $key contains the reference not the scalar value if I
understand this correctly then changing to $$key should give you the scalar
referenced by $key or if it is a hash then %$key.
John
David@iqtexas.com wrote in message <6r9s06$6ah$1@nnrp1.dejanews.com>...
>Code:
>$key=$Request->Cookies()->{logon};
>$Response->write($key);
>$Response->write("<br>");
>$Response->write(join("<br>",split(/&/,$key)));
>
>Output:
>password&john&logon&john&remember&on
>Win32::OLE=HASH(0x3c6ef30)
>
>What's going on?!!
>
>Thanks.
>
>-----== 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 08:17:48 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Code Style (Was: How to sort this associative array?)
Message-Id: <903773818.789755@thrush.omix.com>
Matthew O. Persico <mpersico@erols.com> wrote:
: I format it however Ilya formats it.
:
: :-)
Ack, no!
J/K :-)
--
-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: 22 Aug 1998 05:10:35 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Compile perl scripts into an executable?
Message-Id: <6rljsc$l84$1@msunews.cl.msu.edu>
Harry McGreggor <harry@dublin.net> wrote:
: 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.
There is a compiler available. But unless your script is very simple,
you might not get it to compile. If you do it may not even run.
If you don't want others to "rip" off you script then don't allow them
read access...
: I'm running FreeBSD, so I only need the perl script compiled into an
: executable for this platform.
: Any help would be super!
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Sat, 22 Aug 1998 09:28:02 GMT
From: harry@dublin.net (Harry McGreggor)
Subject: Re: Compile perl scripts into an executable?
Message-Id: <35de8eee.14888267@news.netcom.ca>
Hi!
>If you don't want others to "rip" off you script then don't allow them
>read access...
Yeah, but then no one can run the cgi script since you need read
permissions in order for perl to execute it.
------------------------------
Date: Sat, 22 Aug 1998 01:53:41 -0400
From: "Hairong Li" <hairong@pilot.msu.edu>
Subject: Re: Compile perl scripts into an executable?
Message-Id: <6rlmka$sk6$1@msunews.cl.msu.edu>
It works on my machine. I use the follow command:
chmod 700 filename.pl
to set the permission of my perl files and they all work.
Hairong Li
http://www.admedia.org/
Harry McGreggor wrote in message <35de8eee.14888267@news.netcom.ca>...
>Hi!
>
>>If you don't want others to "rip" off you script then don't allow them
>>read access...
>
>Yeah, but then no one can run the cgi script since you need read
>permissions in order for perl to execute it.
>
------------------------------
Date: Sat, 22 Aug 1998 00:59:27 -0400
From: "Ha" <REPLY_TO_lastronin@earthlink.net>
Subject: Re: File updating question
Message-Id: <6rlij6$a52$1@holly.prod.itd.earthlink.net>
Okay, okay. a thousand apologies regarding flock 8 and the +< issue.
mea culpa. mea super whammo culpa.
no, it so happens i do use windows for local development and to make sure
things are cross-platform compatible. the end products go on Linux. but who
knows, among the two Toms and Larry, whoever mentioned it, i probably am
still clueless (and a thousand more apologies if either Toms is offended by
his name with the other's in the same breath).
still learning....
are the gurus' patience running short these days? just a thought...
cheers,
ha quach
Tom Christiansen wrote in message <6r3qpp$spu$1@csnews.cs.colorado.edu>...
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc,
> Ketan Patel <kpatel@mathworks.com> writes:
>:As far as I understand, '-i' has to be used at the beginning of the file
>:like:
>:
>:#!/usr/local/bin/perl5 -i.bak
>:
>:Right?
>
>Nope. As you guessed, I was referring to $^I.
>
> @ARGV = ('more', 'files', 'here');
> $^I = ".orig"; # that would be -i
> while (<>) {
> s/foo/bar/;
> print;
> }
>
>--tom
>--
> "Just because you're screwed *up* doesn't mean you're screwed." --Larry
Wall
------------------------------
Date: Fri, 21 Aug 1998 23:54:05 -0700
From: John Callender <jbc@west.net>
Subject: Re: Helo locating Modules...
Message-Id: <35DE6B0D.3C2BE4D0@west.net>
Billy Strader wrote:
>
> 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.
You want CPAN.
http://www.perl.com/CPAN-local/CPAN.html <- browseable front end by Jon
"Mad Dog" Orwant.
http://cpan.perl.com/ <- way nifty search tool cooked up by Eric
Eisenhart and Dustin Mollo and demoed by them at the Perl Conference
Thursday.
--
John Callender
jbc@west.net
http://www.west.net/~jbc/
------------------------------
Date: 21 Aug 1998 21:46:18 PDT
From: Dav Amann <dove67@netscape.net>
Subject: Help writing a TCP client
Message-Id: <35DE4DB7.876520E3@netscape.net>
Hi all,
I'm trying to write a perl based TCP client to use with my favorite past
time, FIBS (the First Internet Backgammon Server). I'm trying to get my
client to login automatically, but it's not working and I think that
buffering has something to do with it.
Normally, when you telnet to FIBS at fibs.com (port 4321), you'll get a
long message of the day, and then a login: prompt. I've tried the
following code:
#!/usr/local/bin/perl -w
use strict;
use IO::Socket;
my $remote_host = "fibs.com";
my $remote_port = "4321";
my ($handle, $buffer);
$handle = IO::Socket::INET->new(PeerAddr => $remote_host,
PeerPort => $remote_port,
Proto => "tcp",
Type => SOCK_STREAM)
or die "Couldn't connect to $remote_host:$remote_port: $\n";
print STDERR "[Connected to $remote_host:$remote_port]\n";
while (<$handle>) {
print;
if (/^login/) {
print "loginname\n";
}
if (/^password/) {
print "password\n";
}
}
exit();
This doesn't seem to work. I'm not sure what I'm doing wrong. Could
someone give me a hand?
Thanks,
-=dav
------------------------------
Date: Sat, 22 Aug 1998 10:17:22 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: Is Perl5.004 Year 2000 compilant?
Message-Id: <6rm5tg$9co$3@nz12.rz.uni-karlsruhe.de>
lr@hpl.hp.com (Larry Rosler) wrote:
>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.
Actually, I believe that perl will be Y2.038K compliant as soon as the
underlying OS is. Am I missing something?
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: 22 Aug 1998 10:52:20 +0200
From: lupe@alanya.m.isar.de (Lupe Christoph)
Subject: Re: Is there a manner to get around the problem of POSIX on NT?
Message-Id: <6rm0s4$dt8$1@alanya.m.isar.de>
Kris Van Gompel <kvangompel@imagic.be> writes:
>Like Tom Adriaenssens, I have the same problem. But I really need a
>manner to create non-blocking sockets.
>Please is there any way to get around this problem without changing of
>OS... It has to run on NT
Been there done that. It's not a pretty sight. I only got non-blocking
sockets working for my application, doing my own XS to set non-blocking
because I couldn't do it with Perl's iooctl, and IO::Handle and Tk::IO
refuse to do it.
Tk::IO's fileevent can't deal with async Winsocks. It's just not
implemented. I did not try with select(), IO::Select, or IO::Poll.
If you want to do your own XS, here's the core of my code:
void
mb_blocking(handle,blk=-1)
InputStream handle
int blk
PROTOTYPE: $;$
CODE:
{
#if defined(__WIN32__) || defined(_WIN32)
int ret;
int block = (items == 1 ? -1 : blk ? 1 : 0);
int res;
/* AFAIK, Win32 does not support non-blocking I/O
on anything but winsock. */
if(!handle) {
errno = EBADF;
ret = -1;
}
/* As per the winsock mailing list, there is no way to find out
if the socket is blocking or not. Sigh.
I hate doing this. Suggestions? */
ret = -1;
if (block >= 0) {
int val = block ? 0 : 1;
res = ioctlsocket(PerlIO_fileno(handle),FIONBIO,(u_long FAR *)&val);
if (res < 0) {
perror("ioctlsocket FIONBIO");
ret = -1;
}
}
if(ret >= 0)
XSRETURN_IV(ret);
else
XSRETURN_UNDEF;
#else
croak("mb_blocking is only implemented for WIN32\n");
#endif
}
I'd like to know if I really have to check __WIN32__ and _WIN32
to cover Borland and Microsoft, or if there is a common #define.
--
| lupe@alanya.m.isar.de (private) | lupe@octogon.de (business) |
| "In short, just as the Multics mentality of careful access controls |
| shows up throughout Unix, the cretinous CP/M mentality of uncontrolled |
| havoc shows up in DOS and all its mutant children." Tom Christiansen |
------------------------------
Date: 21 Aug 1998 21:38:10 PDT
From: Dav Amann <dove67@netscape.net>
Subject: Re: need perl cgi help...
Message-Id: <35DE4BC9.A18038DE@netscape.net>
Try this, Alan. You also might want to pick up Licoln Stein's excellent CGI
book "The Official Guide to Programming with CGI.pm". Amazon.com has it.
Take care.
-=dav
#!/usr/local/bin/perl
use CGI qw/:standard :html3 :netscape/;
$_ = param('action');
my $ANSWER_FILE = "answers";
my @QUESTIONS = ('line1', 'line2', 'line3', 'line4', 'line5', 'line6');
my %QUESTION_TEXT = ( 'line1', 'First Question',
'line2', 'Second Question',
'line3', 'Third Question',
'line4', 'Fourth Question',
'line5', 'Fifth Question',
'line6', 'Sixth Question' );
print_header();
CASE: {
/^check/i and do { check_answers(); last CASE; };
/^test/i and do { print_test(); last CASE; };
#default
print_test();
};
sub print_header {
print header(),
start_html(),
center(h1("TEST"));
}
sub print_test {
my ($question_var);
print start_form();
foreach $question_var (@QUESTIONS) {
print $QUESTION_TEXT{$question_var},
textfield(-name=>"$question_var"),
br();
}
print submit(-name=>'action', -value=>'Check Answers'),
end_form();
}
sub check_answers {
my @correct_answers;
my $index = 0;
open(ANSWERS, "$ANSWER_FILE");
@correct_answers = <ANSWERS>;
chomp @correct_answers;
close(ANSWERS);
my ($question_var);
foreach $question_var (@QUESTIONS) {
if (param($question_var) eq $correct_answers[$index]) {
print "$QUESTION_TEXT{$question_var}: ", b("CORRECT"), br();
} else {
print "$QUESTION_TEXT{$question_var}: ",
b("WRONG"),
br();
}
$index++;
}
print start_form(),
submit(-value => 'Test Again',
-name => 'action'),
end_form(),
}
. wrote:
> 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: Sat, 22 Aug 1998 11:29:59 GMT
From: harry@dublin.net (Harry McGreggor)
Subject: Re: Perl Bots! [Chatterbots, FAQbots, InfoBots]
Message-Id: <35deab01.22076162@news.netcom.ca>
Hi!
>Well, looks like TPJ is healthy. That's the third thread on this topic I've seen in the last week.
Any idea where I could find any documentation that will aid me in
programming a FAQBot/InfoBot?
I've been searching around and found many 'commercial' solutions, but
I'm not interested in that - I need raw perl code! :)
Are any of TPJ's articles online? Or do I need to subscribe to the
'paper' magazine? I noticed that the latest issue of TPJ includes an
article about Infobots - anyone have a digital copy?
Cheers,
------------------------------
Date: Fri, 21 Aug 1998 23:37:36 -0500
From: "Nathan Eaton" <eatonn@msn.com>
Subject: Re: Perl Lex ? Perl Yacc ?
Message-Id: <ecnV2cYz9GA.221@upnetnews03>
I'd suggest you try perl-byacc, available on CPAN sites under
CPAN-local/src/misc. It is basically just yacc (the Berkley version)
customized to generate Perl instead of C. The only thing you still have to
do yourself is write the lexer to use with it. Works on just about anything
that yacc works on and supports 'left-recursive' rules.
Regards,
Nathan Eaton
Tk Soh wrote in message <35DAD983.2999FFEE@email.sps.mot.com>...
>Watch out! Although Parse::RecDescent does offer some very nice
>features, it does NOT supported 'left-recursive' rules, which could mean
>redesigning your yacc grammer. However, it could be due to fact that I
>am kinda new to compiler design. May be you can tell me more later.
>
>-TK
>
>
>Uwe Honekamp wrote:
>>
>> elouan <elouan@usa.net> wrote in
<01bdca35$b462e760$d2dafcc1@none.wonadoo.fr>...
>> > Is there any Perl Lex and Perl Yacc ??
>>
>> Have a look at the modules Parse::Lex and Parse::RecDescent which
>> can be found on any CPAN Server.
>>
>> Regards
>>
>> Uwe
>>
>> --
>>
>> Uwe Honekamp * ETAS GmbH * Borsigstr. 10 * D-70469 Stuttgart
>> uwe.honekamp@etas.de * voice: ++49/(0)711/89661-143 * fax: -107
------------------------------
Date: Sat, 22 Aug 1998 00:50:54 -0500
From: Stathy Touloumis <stathy@jaske.com>
Subject: Sending file to browser
Message-Id: <35DE5C3E.8C178901@jaske.com>
I would like to allow a user to download a file from a directory
normally not accessible by browsers. I am wondering what is the best
way to send this file to the user who is downloading it? I tried to
parse the file and print the output but the name of the file defaults to
the name of the cgi program.
Any ideas?
------------------------------
Date: 22 Aug 1998 05:53:23 GMT
From: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Sending file to browser
Message-Id: <6rlmcj$r1f$1@msunews.cl.msu.edu>
Stathy Touloumis <stathy@jaske.com> wrote:
: I would like to allow a user to download a file from a directory
: normally not accessible by browsers. I am wondering what is the best
: way to send this file to the user who is downloading it? I tried to
: parse the file and print the output but the name of the file defaults to
: the name of the cgi program.
two words. sym link
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Sat, 22 Aug 1998 01:15:55 -0500
From: Stathy Touloumis <stathy@jaske.com>
To: Dan Nguyen <nguyend7@msu.edu>
Subject: Re: Sending file to browser
Message-Id: <35DE621B.724A8D20@jaske.com>
That will still allow the user to access the file?
> two words. sym link
------------------------------
Date: Sat, 22 Aug 1998 02:21:57 -0700
From: John Callender <jbc@west.net>
Subject: testing Text::GenderFromName
Message-Id: <35DE8DB5.FB9C68DB@west.net>
At the recent Perl Conference 2.0, I heard (twice, actually) about Jon
Orwant's Text::GenderByName module, which accepts a first name and
returns a gender of male, female, or undef. It got a laugh both times it
was mentioned (in Lincoln Stein's excellent Apache tutorial, and again
as a question in Jon's riotously funny "college bowl" quiz show on
Wednesday night), but I found myself wondering how effective it might
actually be.
So I decided to do some testing.
Michael W. Shackleford has done a first-name-by-gender survey of US
Social Security card applications received in 1996 and 1997. The data
come from a 1% sample of all the applications received in that year,
with the sampling being done via the last four digits of the SSN (so the
sample is randomly distributed geographically). The data set consists of
first names of male and female applicants identified by gender; there
was no attempt to group spelling variations of the same name together,
so you get things like "Abby" and "Abbie" and so on. See:
http://www.ssa.gov/OACT/NOTES/note139/note139.html
There were 1655 female names and 1195 male names in the combined data
from the two years. I wrote a simple perl script to run each file
through Text::GenderFromName; the results were interesting:
Female names:
Total names: 1655
Believed to be male: 77 (4.7%)
Believed to be female: 1395 (84.3%)
Unknown gender: 183 (11.1%)
Male names:
Total names: 1195
Believed to be male: 157 (13.1%)
Believed to be female: 210 (17.6%)
Unknown gender: 828 (69.3%)
It occurred to me at this point that there probably were some names in
common in both lists, so I did a check, and sure enough, there were. I
extracted these to produce three new lists (deduped females, deduped
males, and the list of transgender names), and ran the script again,
giving these results:
Female deduped:
Total names: 1530
Believed to be male: 62 (4.1%)
Believed to be female: 1346 (88.0%)
Unknown gender: 122 (8.0%)
Male deduped:
Total names: 1070
Believed to be male: 142 (13.3%)
Believed to be female: 161 (15.0%)
Unknown gender: 767 (71.7%)
Transgender names:
Total names: 125
Believed to be male: 15 (12.0%)
Believed to be female: 49 (39.2%)
Unknown gender: 61 (48.8%)
Clearly, Text::GenderFromName does a whole lot better on female names
than on male names. Indeed, the module actually would have done better
on the male names if it had just guessed randomly. I'm forced to wonder
if this reflects some inherent difficulty with respect to identifying
male names, or if the original awk script's author (Scott Pakin) just
spent a whole lot more of his attention on devising rules for
identifying female names.
More details (including scripts and data files) are at
http://www.west.net/~jbc/gender/
I'd be interested in any comments on this.
--
John Callender
jbc@west.net
http://www.west.net/~jbc/
------------------------------
Date: 22 Aug 1998 04:43:31 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Turn Perl program into binary
Message-Id: <6rli9j$rmg$1@client3.news.psi.net>
Tk Soh (r28629@email.sps.mot.com) wrote on MDCCCXVI September MCMXCIII in
<URL: news:35DDFDCD.46FDFCEE@email.sps.mot.com>:
++
++ If you are in UNIX, just turn OFF everything but the x (executable)
++ permission. Then your user will be allow to run your script but not
++ reading or writing it.
++
++ That is, if you are in UNIX.
++
$ cat > test.pl
#!/usr/local/bin/perl -w
print "Yes?\n";
^D
$ chmod 111 test.pl
$ ls -l test.pl
---x--x--x 1 abigail relman 42 Aug 22 00:28 test.pl
$ ./test.pl
Can't open perl script "./test.pl": Permission denied
$
You lose.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 22 Aug 1998 04:47:05 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Turn Perl program into binary
Message-Id: <6rlig9$rmg$2@client3.news.psi.net>
Terje Kvernes (terjekv@ifi.uio.no) wrote on MDCCCXVII September MCMXCIII
in <URL: news: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>:
++ > ++
++ > ++ 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.
Yes. The entire point is that the user does *NOT* have the password,
and the plan was to keep it that way.
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: Sat, 22 Aug 1998 11:36:53 GMT
From: harry@dublin.net (Harry McGreggor)
Subject: Re: Turn Perl program into binary
Message-Id: <35deac65.22432017@news.netcom.ca>
Hi,
>If you are in UNIX, just turn OFF everything but the x (executable)
>permission. Then your user will be allow to run your script but not
>reading or writing it.
No you can't. The user needs read permissions to the script.
How can perl read the script if you don't have read permissions?
su-2.01$ ls -l perm.pl
-rwx------ 1 root bin 31 Aug 22 15:40 perm.pl
su-2.01$ perl ./perm.pl
Can't open perl script "./perm.pl": Permission denied
su-2.01$ ./perm.pl
su: ./perm.pl: Permission denied
su-2.01$ id
uid=1001(ben) gid=1001(ben) groups=1001(ben)
Cheers,
------------------------------
Date: Fri, 21 Aug 1998 23:23:46 -0600
From: Jeffery Cann <jc_cann@ix.netcom.com>
Subject: Warnings when dereferencing hashes?
Message-Id: <35DE55E2.A3DB7829@ix.netcom.com>
Hello.
I am attempting to compile this perl program without warnings. It is
actually called in the cgi form interface, but I am having perl
interpreter warnings and I don't know how to fix them -- how do I
declare the hash field 'FORM' like $jeff["FORM'} -- but the perl
interpreter complains more. I'm stumped.
Here are the warnings:
Use of uninitialized value at ./deref.pl line 12 (#1)
(W) An undefined value was used as if it were already defined. It
was
interpreted as a "" or a 0, but maybe it was a mistake. To suppress
this
warning assign an initial value to your variables.
Use of uninitialized value at ./deref.pl line 29 (#1)
Here is the script:
--------------------- start deref.pl --------------
#!/usr/bin/perl -w
use strict;
use diagnostics;
require 'cgi-lib.pl';
my %jeff;
&ReadParse(\%jeff);
print &PrintHeader();
# the NAME field is in my html form
print "Name entered: $jeff{'NAME'}\n";
print "Calling sub myone\n";
myone(\%jeff);
sub myone
{
my $r_jeff = $_[0];
print "in sub myone\n";
mytwo($r_jeff);
}
sub mytwo
{
my $r_IN = $_[0];
# Now de-reference...
my %NEW_IN = %$r_IN;
print "Dereferenced name: $NEW_IN{'NAME'}\n";
}
Thanks for any help.
Jeffery Cann
------------------------------
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 3506
**************************************