[9914] in Perl-Users-Digest
Perl-Users Digest, Issue: 3507 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 22 11:00:56 1998
Date: Sat, 22 Aug 98 08:00:25 -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: 3507
Today's topics:
Re: array of alphabet (Matthew Bafford)
Re: COBOL and Perl (Georg Bauer)
Re: Compile perl scripts into an executable? <tchrist@mox.perl.com>
Re: Compile perl scripts into an executable? (David Hawker)
Re: Compile perl scripts into an executable? <sneaker@sneex.fccj.org>
Getting dialup dynamic IP (David Hawker)
Re: need perl cgi help... <.>
Re: Period.pm or any other time module <burchd@erols.com>
Perl FAR version 1.1.1 MAKE SURE YOU READ THIS BEFORE P no.unsoliciteds@dead.end.com
Re: Perl FAR version 1.1.1 MAKE SURE YOU READ THIS BEFO <sneaker@sneex.fccj.org>
Re: Perl FAR version 1.1.1 MAKE SURE YOU READ THIS BEFO <flavell@mail.cern.ch>
Re: Random Number <ljz@asfast.com>
Warez, Hack stuff, at BLaZTeRZ...http://www.nt.person.d erasia@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 22 Aug 1998 12:17:41 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: array of alphabet
Message-Id: <MPG.104877a8bb5f1198969d@news.scescape.net>
In article <35DC30B6.2C72@exodus.wvnet.edu> on Thu, 20 Aug 1998
10:19:11 -0400, Dave Watson (a) felt the following information to
be of use:
> 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.
Oh there is, but I bet you coulda typed them faster than you
typed this message... ;-)
Let's see:
@Capital = 'A' .. 'Z';
@LowerCase = 'a' .. 'z';
Also, look up the .. (range or flip flop) operator in perlop.
perldoc perlop
man perlop
Hope this helps!
--Matthew
------------------------------
Date: Sat, 22 Aug 1998 10:42:57 GMT
From: gb@hugo.westfalen.de (Georg Bauer)
Subject: Re: COBOL and Perl
Message-Id: <gb-2208981242570001@hugo.westfalen.de>
In article <6rldhj$na5@lotho.delphi.com>, paulr@bix.com (paulr) wrote:
>PERL does not have the built in database capabilities that
>COBOL has, so you will find it more difficult to do the
DBD and DBI give you far superior database capabilities than Cobol has
built in (except if you count embedded SQL as builtin). Business-Math is
another thing - I think there is something like scaled fixnumber
arithmatic in the form of the bigint libraries for Perl (scaled fixnumber
arithmetic is what is actually behind the Business-Math), but that isn't
very efficient (it has different goals, bigint's are for real big numbers
(like in cryptographic algorithms), not for your everyday math).
Screen-handling: I would take Perl/TK or any of the other GUI interfaces
for Perl. No, I don't think that there is anything I couldn't do with Perl
I do now with Cobol. The main reason for me still using Cobol is that
there is this large monstrous application that I have to maintain ... (and
that I won't like to do something in the range (size-wise) of said
application in Perl before the bytecode-compiler is available - loading
several MB of _modules_ might take it's time, even if you don't have to
compile them at load-time ;-) ).
bye, Georg
--
http://www.westfalen.de/hugo/
------------------------------
Date: 22 Aug 1998 13:44:51 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Compile perl scripts into an executable?
Message-Id: <6rmi0j$7bn$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
harry@dublin.net (Harry McGreggor) writes:
:I have a few perl scripts I have written which I don't want people to
:"rip" off.
I really don't understand this sentiment. The best way to
avoid being ripped off is to give it all away.
--tom
--
The X server has to be the biggest program I've ever seen that doesn't
do anything for you. --Ken Thompson
------------------------------
Date: Sat, 22 Aug 1998 13:49:30 GMT
From: dhawker@removethis.bigfoot.com (David Hawker)
Subject: Re: Compile perl scripts into an executable?
Message-Id: <35e8cc05.10690412@news.cableol.net>
On Sat, 22 Aug 1998 01:53:41 -0400, "Hairong Li" <hairong@pilot.msu.edu>
felt the need to post:
>
>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.
Because it's only you who's running them?
Perl scripts run from the web or by other users need the read and execute
bits enabled for 'group' and/or 'other'
>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.
>>
>
--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org
------------------------------
Date: Sat, 22 Aug 1998 10:01:44 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Compile perl scripts into an executable?
Message-Id: <35DECF48.BA938F36@sneex.fccj.org>
Tom Christiansen wrote:
>
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> harry@dublin.net (Harry McGreggor) writes:
> :I have a few perl scripts I have written which I don't want people to
> :"rip" off.
>
> I really don't understand this sentiment. The best way to
> avoid being ripped off is to give it all away.
>
> --tom
> --
> The X server has to be the biggest program I've ever seen that doesn't
> do anything for you. --Ken Thompson
Hear Hear!
PS - I disagree with Ken Thompson.
-Sneex-
__________________________________________________________________
Bill Jones | FCCJ Webmaster | Murphy's Law of Research:
Enough research will tend to support your theory.
------------------------------
Date: Sat, 22 Aug 1998 14:24:47 GMT
From: dhawker@bigfoot.com (David Hawker)
Subject: Getting dialup dynamic IP
Message-Id: <35eace84.11329790@news.cableol.net>
Is there any way I can get my perl script to automatically obtain my
dynamic IP address whenever I dialup? Perhaps a winsock call? I'm running
Windows 95 and perl 5.004_02 for DOS.
Currently I'm using a cgi script to send me the $ENV{REMOTE_HOST} data
which I then paste into the local perl script as my hostname.
--
dhawker@bigfoot.com | ICQ 7222349
http://dhawker.home.ml.org
------------------------------
Date: Sat, 22 Aug 1998 10:16:03 -0400
From: <.>
Subject: Re: need perl cgi help...
Message-Id: <6rmjue$cun@woody.wcnet.org>
thanks a lot dav
alan
Dav Amann wrote in message <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 10:37:42 -0400
From: David Burch <burchd@erols.com>
Subject: Re: Period.pm or any other time module
Message-Id: <35DED7B6.EBF7628A@erols.com>
Check out DateCalc and DateManip.
David Burch
Anthony Lee-Masis wrote:
> Thanks all for your suggestions !! I will give it a shot : )
>
> Jim Woodgate wrote:
>
> > Anthony Lee-Masis <anthony@nc.com> writes:
> > > I have a problem i hope you can help with. I need to somehow find out if
> > > a certain day falls within a period of a week or 2 weeks.
> > >
> > > Example given the range 7/2/98 - 7/19/98
> > > Now given the date 7/14/98 , does this date fall within the range. I
> > > need to find out how to do that. I poked around CPAN and found a module
> > > called Period.pm and have tried to implement that. The closest i could
> >
> > Using Time::Local, you could compute time for each date, then simply
> > compare the time values. (I didn't check Time::Local very closely,
> > but I'm guessing you have to subtract one from the month)
> >
> > use Time::Local;
> >
> > my $start_period = timelocal (0, 0, 0, 2, 6, 98);
> > my $stop_period = timelocal (0, 0, 0, 19, 6, 98);
> >
> > my $check_date = timelocal (0, 0, 0, 14, 6, 98);
> >
> > if ( $check_date >= $start_period &&
> > $check_date <= $stop_period ) {
> > # insert code here...
> > }
> >
> > --
> > Jim Woodgate
> > Tivoli Systems
> > E-Mail: jdw@dev.tivoli.com
> >
>
> ------------------------------------------------------------------------
>
> Anthony Lee-Masis <anthony@nc.com>
> Technical Support Engineer
> Network Computer Inc.
>
> Anthony Lee-Masis
> Technical Support Engineer <anthony@nc.com>
> Network Computer Inc. HTML Mail
> Redwood Shores Netscape Conference Address
> CA Netscape Conference DLS Server
> 94065
> USA
> Additional Information:
> Last Name Lee-Masis
> First Name Anthony
> Version 2.1
------------------------------
Date: Sat, 22 Aug 1998 20:43:44 +0900
From: no.unsoliciteds@dead.end.com
Subject: Perl FAR version 1.1.1 MAKE SURE YOU READ THIS BEFORE POSTING
Message-Id: <35DEAEF2.68A0ACAD@dead.end.com>
Perl FAR 1: Frequently Abusive Replies 1
[1] Why aren't I a nice person when I reply "Are you blind, or just plain
stupid?" to somebody who hasn't got the minimal idea of what programming is about.
There are is one factor that you should always bear in mind:
*The documentation is crystal clear to you because you wrote it or were
involved with writing it.
Without the benefit of hindsight the documentation isn't always apparently
fitting to every situation. It is for this reason books didn't, and computers
don't, replace human instructors. Humans can be more flexible at explaining
situations than the LITERAL STRINGS contained in books and the LIMITED
VARIABLE input that computers can supply.
[2] But if some piddly little web user posts asking for a free perl
script......
There is a standard function call built into the HUMAN OS called IGNORE().
This can be defined in terms of the negation of THINKING ABOUT() - the
algorithm !THINKING ABOUT() = IGNORE() will equate true, (except in C where
it'll equate as 1). For variants see also the PIG HEADED() and BLINKERED
VISION() man pages.
[3] But Use Net didn't use to be like this... once people were competent, they came
from universities and had degrees.......
The meteoric spread of the web has obviously had far reaching effects. On the
pro side, Perl as a language has a much wider audience of potential and
established programmers, thereby allowing you to feel more important about
what you do. The price of this though is having to see the Subject lines like
"HELP NEWBIE" or "COUNTER WANTED FAST" when you connect up to the news group,
however careful application of the IGNORE function, maybe with a few choice
REGEX or SUBSTRING matches, can reduce the levels of stress that any self
respecting guru must cultivate
[4] I still don't get it - why do I have to be nice to idiots who just want to
waste my precious time
By not being polite you tend to parse input through the HATRED() subroutine.
The more consistently and intentionally you aren't polite and respectful of
your fellows the more the parsed HATRED output generated by you is saved in a
temporary sys file called RANCOUR. The larger the RANCOUR.temp file is the
longer it takes you to get out of the ANTAGONISTIC LOOP where your every
action is simply piped to RANCOUR.temp without being parsed and you find your
own HATRED subroutine being flooded with impolite or just downright abusive
INPUT. This in turn causes your OUTPUT to be filled with with line noise like
"You are too an ignoramus" rather than more meaningful data (this is sometimes
referred to as a DENIAL OF SERVICE attack).
It is possible to deal with the data flow differently, buy piping the input
through the PATIENCE buffer, this has the effect of redirecting the data flow
to a NULL"" string.
[5] Can't I just get away with making some snide but vague remark, just for
the sake of defending the purity of programming?
You can try this but remember the effects of the RANCOUR.temp file are
cumulative, so you may find yourself dealing with several ANTAGONISTIC piped
data flow inputs when you least expect it.
[6] What's the most offensive thing I can say?
If you become the centre of an off topic thread, which constantly argues back
and forth about your right to free speech and expression, you can be pretty
sure you said something (unintentionally of course) that was offensive. If you
find yourself being cited in several of these kinds of threads at the same
time, then you can almost certainly cut and paste from the original the others
will be quoting you from, directly into the next email you want use as a
follow up to a flaming.
[7] How should I react when people get annoyed at something I've said
Well the usual approach is to start with some petty name calling, then call
for a crusade against those that wish to denigrate the revered tradition of
Use Net nettiquette (your version of the tradition of course), hoping that
enough people will fail to understand what started the whole thing and put
pressure on your attacker (hopefully they'll force your antagonist into
silence for you - the Web is a democracy right?). Another favourite tactic is
to threaten first to contact the user's ISP to tell them what a beast their
subscriber is, and then follow up with a threat of legal action in the event
your antagonist(s) don't comply with some arbitrary rule you made up to
justify contacting their ISP and threatening legal action in the first place.
[8] Why can't people just understand I'm right
This has something to do with the variable $REALITY. The value of the variable
$REALITY you use to filter data IMPUT contains the substring "I'm right", if
you decide to adopt the STRICT pragma you'll be forced to declare this
variable as MY $REALITY as it's a local variable and not a global. If we
analyse the value of the global variable $REALITY, we find that it contains a
heap of mostly meaningless data, with no order what so ever. It is also
infinitely large so only a tiny fraction of it's data will fit into the memory
allocated to the local MY $REALITY variable in the event you should want to
DIFF the two variables.
------------------------------
Date: Sat, 22 Aug 1998 08:47:21 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Perl FAR version 1.1.1 MAKE SURE YOU READ THIS BEFORE POSTING
Message-Id: <35DEBDD9.7FC80848@sneex.fccj.org>
no.unsoliciteds@dead.end.com wrote:
>
> [6] What's the most offensive thing I can say?
>
You forgot one:
In the time it took you to write this you could have
actually read the docs, practiced some example code,
and obtained something useful - thus asking one
less FAQ, documented example, or other trivial, painfully
obvious coding question - that was probably off topic
anyways. But instead you choose to waste more newbies
valuable reading time.
HTOY [Hope this offends you];
-Sneex-
__________________________________________________________________
Bill Jones | FCCJ Webmaster | Murphy's Law of Research:
Enough research will tend to support your theory.
------------------------------
Date: Sat, 22 Aug 1998 15:10:04 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Perl FAR version 1.1.1 MAKE SURE YOU READ THIS BEFORE POSTING
Message-Id: <Pine.HPP.3.95a.980822150252.24498B-100000@hpplus01.cern.ch>
On Sat, 22 Aug 1998 no.unsoliciteds@dead.end.com caused the following to
appear:
| [The following text is in the "x-user-defined" character set]
Gosh, how can I possibly read this? Maybe it's EBCDIC, or 5-hole telex
code or something.
> Without the benefit of hindsight the documentation isn't always apparently
> fitting to every situation.
Right: so let them tell the assembled usenet multitudes, in effect "I
didn't even bother to read the carefully prepared documentation, because
I didn't expect to understand it. So now will some J.Random Usenaut
please read it for me". That's rude, with or without the "please".
> It is for this reason books didn't, and computers
> don't, replace human instructors. Humans can be more flexible at explaining
> situations than the LITERAL STRINGS contained in books and the LIMITED
> VARIABLE input that computers can supply.
Right, but a good instructor starts with "tell me where you've got to so
far", and when they say "nowhere", s/he would say OK, try the beginner's
class, and come back when you're ready.
------------------------------
Date: 22 Aug 1998 09:31:21 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Random Number
Message-Id: <ltu335gn2u.fsf@asfast.com>
abigail@fnx.com (Abigail) writes:
> Darren Ferguson (Darren@introdesign.com) wrote on MDCCCXII September
> MCMXCIII in <URL: news:35d8473c.2260737@news.demon.co.uk>:
> ++ Is there a random number command for Perl or in fact a routine.
>
>
> Is there something wrong with your eyes?
> How hard is it to grep for 'random' in the documentation?
Here we go again ...
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: Sat, 22 Aug 1998 10:55:01 GMT
From: erasia@my-dejanews.com
Subject: Warez, Hack stuff, at BLaZTeRZ...http://www.nt.person.dk/mirror/
Message-Id: <6rm825$46t$1@nnrp1.dejanews.com>
Hi there!
Want to try the best warez site, plus HACK site, come here!
http://www.nt.person.dk !
Hacks, cracks, serials!
CYA
BLaZTeRZ
The best site!!!!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
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 3507
**************************************