[6563] in Perl-Users-Digest
Perl-Users Digest, Issue: 188 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 27 03:08:04 1997
Date: Thu, 27 Mar 97 00:00:33 -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 Thu, 27 Mar 1997 Volume: 8 Number: 188
Today's topics:
----- LOOKING FOR THAT EXTRA CASH? ----- <earmstg@anet-stl.com>
Re: A Call for Clarity (Schwartzian Transform Considere (Eric Bohlman)
Re: diff. between 0 and "" (Dan)
Re: Directory Listing in Perl (Eric Bohlman)
Re: Email forger Works for MindSpring <kibo@dhp.com>
Re: Hanging CGI perl scripts (NT) (Eric Bohlman)
Re: printing associative arrays in order (Eric Bohlman)
Re: printing associative arrays in order (Brian L. Matthews)
processing fidonet mailpackets (Eddy Pronk)
Re: regular expression for check lower case (Eric Bohlman)
Re: regular expression for check lower case <bill@stygian.com>
Re: s/// fails because of embedded ()'s (Eric Bohlman)
Re: s/// fails because of embedded ()'s (Brian L. Matthews)
Re: Smarter indexing algorythm (Brian L. Matthews)
Symlink Directories <fadorno@mail.gte.net>
Re: term 'regular expressions' considered undesirable <ghjfghj@here.cum>
Re: Text Justification (Eric Bohlman)
Re: Text Justification <christop@ozinter.co.jp>
Re: trying to modify matt's formmail script (Eric Bohlman)
tying %HoH to DB_File? (Jonathan R. Seagrave)
Re: Unix and ease of use (WAS: Who makes more ...) (David M. Cook)
Unpacking .gz file sundance@pacbell.net
Re: Who makes more $$ - Windows vs. Unix programmers? (USUARIO)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 26 Mar 1997 23:42:23 -0600
From: "E. Armstrong" <earmstg@anet-stl.com>
Subject: ----- LOOKING FOR THAT EXTRA CASH? -----
Message-Id: <333A08BD.3353@anet-stl.com>
$$$YOU WILL NOT REGRET READING THIS$$$
Please take five minutes to read this article: it will change your life,
just like it did mine. It's true!! You can make up to or over $40,000 in
4
to 6 weeks, maybe sooner! I swear I'm not lying to you, and this is not
a scam! If you're interested read further: if not, then don't choose to
participate. However, please download and print this article and give it
to someone else who may wish to take advantage of the chance of a
lifetime.
It's a true story and it goes something like this:
A little while back, I was browsing through the newsgroups and came
across an article similar to this, that said you could make thousands of
dollars in a few weeks with only an initial investment of $5. So I
thought, "Yeah right, no way, it must be a scam." But I kept seeing the
article in many newsgroups, so I was curious. Anyway, it said to send $1
to each of the 5 (five) names and addresses listed in the article. You
then place your name and address at the bottom of the list in the fifth
position, and then post the amended article in at least 200 newsgroups
or
send mail to 200 people (there are thousands). "No catch, that was it."
Mailing 200+ people may take a good while, but if you download a nice
little mass mailer such as: Mass Mailer v1.0 coded by H and D it will
automatically get as many names as you want (up to 99,999) and send a
specified letter or text file to all of those random people. Think about
the rate of return for doing just that? :) It's very simple to obtain,
ask
around or hang out in the lobby for awhile, it's a great program.
---
So after thinking it over and talking to a few of my friends, I tried
it.
I figured what have I got to lose except 5 stamps, 5 envelopes and a
mere
$5.00. Right??
Well guess what . . . within 7 days, I started getting some responses in
the mail! I was shocked!! I still figured it would not amount to
anything,
and didn't give it another thought. But then the money kept coming in,
tripling in size and multiplying by 10 - 20 times the amount that I got
in
the first week!! In my first week I made $25. But by the end of the
second
week, I had a total of over $1000!! In the third week I had over
$10,000,
and it was still growing. This is now my forth week, it's incredible,
I've
made close to $42,000 and the mail is still pouring in. --- Let me tell
you
how this works and more importantly, WHY IT WORKS . . . If you are still
reading this then stop and PRINT a copy of this NOW, so you can get
information from it, and begin earning money today. The process is very
simple, and it consists of just 3 (three) easy steps:
$$$ STEP #1 $$$
On 5 separate pieces of paper write the following words: "PLEASE ADD ME
TO
YOUR MAILING LIST." In this way you are not just sending a dollar to
someone, you are paying for a ligitimate service. You are being added to
a
mailing list for whatever service they chose to provide you...??? BE
SURE
TO INCLUDE YOUR NAME AND COMPLETE MAILING ADDRESS since you will be
added
to their mailing list. This is all legal because you are paying for a
service. You can check title 18, section 1302 and 1342 of the US postal
and lottery laws.
NOW get five $1 or five $5 or five $10 bills and place ONE inside each
piece of paper that you just wrote on so that the bill will not be seen,
place one in all five envelopes and seal them. That is: five envelopes,
each with one piece of paper that you wrote on (be sure that you wrote
the
above phrase on the paper, this is what makes it legal), plus a $1 bill
hidden inside (this is the minimum fee for the Mailing list service). It
is a good Idea to also include the position number of the person to
facilitate their book keeping and so that they can gauge the progress of
the article. What YOU are doing is creating a mailing list for yourself,
or your business, etc... which is perfectly legal and the fee is to
cover
any cost that you incur. It's that simple.
Note: $1 is the minimum, that will insure you that they will send it to
200 people or newsgroups. However, the more you send the more people
they
will mail or post the list to. 200 people for the first dollar and 450
people for each additional dollar. So for just $25 you could have each
of
the five people sending to 2000 people or newsgroups each. That's 10,000
plus the 200+ people that you send it to. It is your decision, but the
more the better.
FYI, you are "mailing" the following five people the $1 and note but you
are "e-mailing" 200+ or posting in 200+ newsgroups this letter with your
name in position # 5:
$$$$$ 1 GREG THOMPSON
3133 Woodland Ridge Blvd.
Baton Rouge, LA 70816 USA
$$$$$ 2 LEIF SANONESS
870 E. El Camino Real #96
Mountian View. CA 94040 USA
$$$$$ 3 MICHAEL REKAS
608 Austin Lane
Herndon, VA 20170 USA
$$$$$ 4 DOUG FOGGIN
#902 - 1005 Jervis Street
Vancouver, BC V6E 3T1 CANADA
$$$$$ 5 ERIC ARMSTRONG
1868-E McKelvey Hill Dr.
Maryland Heights, MO 63043 USA
VERY IMPORTANT: When you send your letter with the $1 bill in the
envelope
DO NOT SEND A COPY OF THIS LETTER. Only send the letter with the phrase
"PLEASE ADD ME TO YOUR MAILING LIST..." etc.!!!
$$$ STEP #2 $$$
Now take the #1 name off of the above list and move the other four names
up (5 becomes 4, 4 becomes 3, etc...) and put YOUR NAME in the #5
position on the list. You can do this by simply retyping this article,
adding your name and making any other editing changes that you need to.
Don't change the article too much however so as to not change the
essence
of it's contents.
$$$ STEP #3 $$$
POST your amended article (with your name at the #5 position) to at
least
200 newsgroups or e-mail it to 200 people. Two hundred is the minimum to
make it work, but the more - the better because you will increase the
exposure of the article to alot more people. The more people that see it
means more people will choose to participate. All you need is to recieve
a
good foundation of returns.
AND THAT'S IT!!! JUST THREE EASY STEPS!!! You are now in the mail order
business and will start recieving your $1 envelopes from various people
all over the world within just a few days. REMEMBER! The more that you
post this letter with your name on it, the more the chances of receiving
a
higher return on your $5 investment in your new mail order business. You
may want to rent a P.O. Box to facilitate the high volume of mail you
are
about to recieve.
----
LET ME TELL YOU WHY THIS PROGRAM WORKS AND IT'S POTENTIAL!
Out of of every 200 postings, let's say you only recieve 5 replies,
which
is very VERY low. So you make $5 with your name in position #5. You
haven't
lost anything, have you? Now then, each person who just sent you a $1
envelope makes their minimum 200 postings (a total of 1000) with your
name
now at position #4. Using the above same reply return on their efforts,
you now recieve 50 (fifty) $1 envelopes. Now you have made $50. Your 50
new agents post their 200 each with your name at position #3 for a total
of 10,000 postings and I think you are starting to get the picture,
Right?
Now you just recieved $500 in the mail. Your name at position #2 means
500
people post their 200 postings equaling 100,000 postings for a return of
$5000. Your name at position #1 has 5000 people post their 200
postings
and before your name drops off the list you get a return of over
$50,000.
And that's if everybody down the line makes only 200 postings and only 5
responses. Remember the more you post the greater the return.
Estimates are that there are 20,000 to 50,000 new users coming online
EVERDAY!!! Remember, play FAIR and HONEST and THIS WILL WORK, I PROMISE
YOU!!! Make sure that you print off a copy of this article RIGHT NOW!!!
It could change your life. Once you begin recieving money be sure to
record (keep) every name of those that sent you an envelope. You are,
after all, compiling a mailing list of people. Keep good records, pay
your
taxes and always keep an eye on the postings to be sure that everyone is
playing fairly. You know where your name should be!
REMEMBER - HONESTY IS THE BEST POLICY. WHAT IS $5 TO YOU? IF YOU ARE
LIKE MOST PEOPLE YOU SPEND THAT MUCH ON LOTTERIES EVERY WEEK! WHY NOT
TRY
SOMETHING THAT HAS HIGH POTENTIAL FOR RETURNS. YOU DON'T NEED TO CHEAT
THIS IDEA TO MAKE MONEY. SO PLEASE, PLAY FAIR AND REAP AN HONEST REWARD
FOR
YOUR EFFORTS.
If you try to deceive people by posting the messages with your name
on the list without sending money to the five people already on the list
you will not get much.
Someone who tried it made $150 and that was after 7 - 8 weeks. Then
they sent five $1 and posted it 200 more times, people added them to
their
lists and in 4 - 5 weeks he had an honest return of $10,000. Someone
else
who had some money sent $20 to each of the five people on the list and
he
recieved over $150,000 in a period of just 3 months. The system really
works! I've already made a large sum of money! Any and everybody can
benefit from this.
That's it!!! Just follow the directions correctly and IT WILL WORK FOR
YOU TOO!!!
------------------------------
Date: Thu, 27 Mar 1997 05:18:52 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: A Call for Clarity (Schwartzian Transform Considered Scary)
Message-Id: <ebohlmanE7os3G.MvK@netcom.com>
I R A Aggie (fl_aggie@hotmail.com) wrote:
: How does that go? "A problem is hard until you do it, then its trivial."
: One just has to remember that not everyone has "done it", and that it
: may not be "trivial".
This reminds me of an old joke: an engineering professor and a math
professor are the last two patrons left in a college-town bar just before
closing. The bartender is cleaning up in the back and notices that two
sinks are overflowing because their drains are clogged, so he shuts off
the water and appeals to the two professors to help him bail out the
sinks. The two professors grab a bunch of buckets and start scooping up
the water until the sinks are dry. The next day the two professors are
again the last patrons, and again the sink drains clog up, but this time
the bartender notices it when the sinks are half-full and shuts off the
water. Again he asks the professors for help, and the engineering
professor starts bailing out one sink. The math professor goes to the
other sink, turns on the water until the sink starts overflowing and then
leaves, having transformed the problem into one that he had previously
solved.
------------------------------
Date: Thu, 27 Mar 1997 05:20:47 GMT
From: rosenthd@erols.com (Dan)
Subject: Re: diff. between 0 and ""
Message-Id: <5hd05i$2s8@boursy.news.erols.com>
I would suggest using
if (defined $val)
rather than if ($val eq "" )
If you are running with perl -w (as any good perl programmer does)
you will get an unitialized variable error when you try:
if ($val eq "")
Robert Gagnon <rgagnon@ordinox.com> wrote:
>Susan Starr wrote:
>>
>> I'm running perl 5.003 and I'm having some trouble telling if a value is
>> 0 or blank. The program I'm writing has the user enter some data and
>> then tests the data to make sure it is valid.
>>
>> Here is some code:
>>
>> if (&isbetween(0,13)) { print "true\n"; }
>> if (&isbetween(0,13,"")) { print "true\n"; }
>>
>> sub isbetween {
>> my ($low,$high,$val) = @_;
>> return ($val >= $low && $val <= $high);
>> }
>>
>> I would like both of the above cases to be false but they aren't.
>> If I add the line:
>> if ($val == "") { return 0; }
>> to the function isbetween, then, when $val is equal to 0, the function
>> returns 0; How can I fix this?
>>
>> Thanks,
>>
>> Sue
>Hello.
>You are using numeric comparison operators on empty strings, which will
>be treated
>as zero.
>If you want to compare the value as strings, use the eq, lt, etc...
>operators.\
>Bye.
>--
>Robert Gagnon | "Marketing: The Art of Using the Truth to Fool
>Sys Admin | the Consumers" | Opinions expressed are my own.
>rgagnon@ordinox.com | Tel:(514) 686-2455 Fax:(514) 686-0239
>Ordinox Network Inc., 720 Montgolfier #201, Laval (Qc) CANADA H7W 4Z2
------------------------------
Date: Thu, 27 Mar 1997 05:37:29 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Directory Listing in Perl
Message-Id: <ebohlmanE7osyH.wy@netcom.com>
Tom Phoenix (rootbeer@teleport.com) wrote:
: On 25 Mar 1997, Sriranga R. Veeraraghavan wrote:
: > for($a=0;$a<=$#files;$a++){print "$files[$a]\n";}
: Maybe you meant this? :-)
: for (@files) { print "$_\n" }
Or even
print join("\n",@files),"\n";
which to me reads like a description of the task to be performed without
having to go into much detail about how to do it.
------------------------------
Date: 27 Mar 1997 05:02:25 GMT
From: the one and only real true kibo <kibo@dhp.com>
Subject: Re: Email forger Works for MindSpring
Message-Id: <5hcv11$c59@stronghold.dhp.com>
-----BEGIN PGP SIGNED MESSAGE-----
On Wed, 26 Mar 1997 22:17:38 -0500 in article <3339E6D2.11DE@chrysler.com> posted to news.admin.censorship, Kevin Darcy <kcd@chrysler.com> wrote:
> the one and only real true kibo wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> On 26 Mar 1997 14:57:33 -0500 in article
> <5hbv3d$e6v@panix3.panix.com> posted to misc.legal, Wesley Serra
> <wserra@panix.com> wrote:
> > The Chris-Lewis-type third-party cancels do not "falsely identify
> the
> > person"; as you well know, the name of the canceller is virtually
> > plastered all over the message.
> You are lying, asshole shyster.
> Chris lewis and other net.scum put the original poster's name in
> the "Sender:" line in order to fool INN configured to verify
> cancels.
> So what? It fools INN, but it doesn't fool any (mentally-competent)
> humans, since Chris Lewis' name appears in 3 other headers in the cancel
> message (the From: line, the X-Canceled-By: and the Approved: line). It
idiot - INN doesn't look at the X-Cancelled-By: line. It's not
in RFC 1036. Chris Lewis and his cronies made it up to cover up
their fraud and forgeries.
> is not "forgery" unless there is specific intent to deceive normal
> HUMANS. Deceiving programs is not illegal -- if it were, I know a
> helluva lot of sysadmins who would be in the slammer right now :-)
Big fucking deal - lots of people know Randall Schwartz.
I am the only true <A HREF="http://www.dhp.com/~kibo">Kibo</A>.
Finger me for my PGP public key. Check out my home page for the coolest
way to vote on new newsgroup proposals or to issue Usenet cancels.
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBMzn/YKlPvImbzLKZAQFKIwQAiaPGy11GVl5VPKrO7V/UPubDarY4BVUQ
eFUPkm5WrB7SFPjoEu0dhvHYZgGgLgKdLRyZEOfMShmOYhmXhdUggzjHA8CvpPR0
8luIvFUucxwHM+ym6a6rLCGHfVbT0eRkc0ylhmRZKKpx5Earjm3nj/iTz1Z5yZbd
VPrK760qOk4=
=50Qh
-----END PGP SIGNATURE-----
------------------------------
Date: Thu, 27 Mar 1997 07:08:52 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Hanging CGI perl scripts (NT)
Message-Id: <ebohlmanE7ox6t.628@netcom.com>
Rhys Lewis (lewisrh@akcity.govt.nz) wrote:
: I am having trouble with CGI perl scripts not terminating on an
: NT server. If you let the script below run it takes around 35
: seconds to complete and the cmd.exe & perl.exe processes
: dissappear happily. If you stop loading the page before it
: finishes the perl.exe and cmd.exe live on (using up very little
: processor time but obviously not desirable) until you kill them.
: If you take out the commented line the script runs for its 35
: seconds and then dissappears, which leaves me wondering if it
: has something to do with file and process handles once the
: browser is no longer accepting input.
: open (IN, "test.txt");
: $counterf = <IN>; # this line is the problem
: close IN;
If you actually checked whether or not your open was successful:
open (IN, "test.txt") or die "Unable to open test.txt: $!\n";
You'd probably be able to find out what was happening.
------------------------------
Date: Thu, 27 Mar 1997 05:57:28 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: printing associative arrays in order
Message-Id: <ebohlmanE7otvt.1x4@netcom.com>
Ishwarya Rao (irao1@gaia.umbc.edu) wrote:
: When an associative array is printed, the elements are printed in a
: random order.
: I was wondering if there is a one line command to print the elements
: of an associative array in the order in which it was created, rather
: than in a random order.
Nope, the creation order isn't stored anywhere. You can store it
yourself, though; whenever you do something like
$hash{$key}=$value;
follow it with
push @order, $key unless grep(/$key/, @order);
Then when you want to print out the values in creation order, do something
like:
print join("\n", map($hash{$_}, @order)), "\n";
------------------------------
Date: 26 Mar 1997 22:32:20 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: printing associative arrays in order
Message-Id: <5hd49k$1pc$1@halcyon.com>
In article <ebohlmanE7otvt.1x4@netcom.com>,
Eric Bohlman <ebohlman@netcom.com> wrote:
| $hash{$key}=$value;
|follow it with
| push @order, $key unless grep(/$key/, @order);
Ack! What happens when $key contains a '.' or '[' or something? When
using a variable, unless you know it's an r.e., you really need to
escape any metacharacters: grep /\Q$key\E/, @order.
Double Ack! Why do an O(n^2) search when you can just ask the hash?
push @order, $key unless exists $hash{$key};
$hash{$key} = $value;
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: 26 Mar 97 21:16:41 GMT
From: pronk@dialis.xs4all.nl (Eddy Pronk)
Subject: processing fidonet mailpackets
Message-Id: <88d_9703270530@dialis.xs4all.nl>
Hi!
I need some perl code for processing fidonet mailpackets. I've tried the
searchengine from CPAN.
Eddy
------------------------------
Date: Thu, 27 Mar 1997 06:02:46 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: regular expression for check lower case
Message-Id: <ebohlmanE7ou4M.26K@netcom.com>
Randal Schwartz (merlyn@stonehenge.com) wrote:
: Don't use a regular expression:
: if ($thing eq lc $thing) {
: # it's OK!
: }
: This has the advantage of being locale-safe for international character
: sets.
Doesn't this suggest that we badly need two new metacharacters, one that
matches any uppercase letter in the current locale, and one that matches
any lowercase letter?
------------------------------
Date: 27 Mar 1997 07:16:57 GMT
From: "Bill Brunning" <bill@stygian.com>
Subject: Re: regular expression for check lower case
Message-Id: <01bc3a7f$28eb5420$edd823c7@stygian>
Rex Fowler <rmfowler@raptor.mtc.ti.com> wrote in article
<5h9j4d$ias@raptor.mtc.ti.com>...
> In article <5h9chb$j73@agate.berkeley.edu>,
>
> I wanted something similar to convert all names entered
> by someone to be converted to proper case. ie John Doe,
> Ronald McDonald, ..
>
> I use the folowing function, which hopefully someone will provide
> suggestions for improvement. The assumption is that if there are 2
> upper case characters, then the user probably typed it in correctly.
>
> sub namecase {
> my $n = shift;
> $_=$n;
> $cnt = tr/A-Z/a-z/;
> # leave alone if there are exactly 2 uppercase characters per name
> # this will leave LeAnne McDugal alone but correct uni-case and wildly
> # mixed-case names. Won't work on 2 letter names.
> if ($cnt ne 2) {
> $n=ucfirst(lc($n));
> }
> $n;
> }
Suggestions for improvement (as requested):
1. Run under -w and use strict.
2. Reduce redundancy.
3. Improve readability.
4. Handle two-letter names.
5. Handle adjacent caps.
Here's one way to do it:
sub NameCase {
my $name = shift;
local $_ = $name;
my $caps = tr/A-Z/a-z/;
return ucfirst($_) if
$caps != 2 or
length($name) == 2 or
$name =~ /[A-Z]{2,}?/;
return $name;
}
HTH.
Bill Brunning
bill@stygian.com
------------------------------
Date: Thu, 27 Mar 1997 06:24:55 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: s/// fails because of embedded ()'s
Message-Id: <ebohlmanE7ov5J.3u4@netcom.com>
Robert Goff (ragoff@sandia.gov) wrote:
: $index_buffer =~ s/$LINK{$url}/$LINKTITLE{$url}/s;
: The substitution in the top if condition was failing, even when I was
: sure that it shouldn't. I spent hours verifying that $LINK{$url} did
: indeed exist in $index_buffer and that the script was actually executing
: the substitution line.
: It turns out that $LINK{$url} contained embedded parens. When I escaped
: the parens, the substitution succeeded. I haven't seen anything in the
: man pages or the Camel book to explain this - can someone tell me why,
: and what else I have to escape?
: Is it because the parens are grouping operators? Will I also have to
: escape []?
Yep. Remember that the first operand to the s operator is always treated
as a regular expression, even if a variable is interpolated into it, so
you'll have to escape any regular expression metacharacters contained in
in if you want a literal match. Fortunately, you don't have to remember
which ones they are because there's a built-in facility for automatically
escaping any metacharacters: "\Q$variable\E" (you *do* need the double
quotes).
------------------------------
Date: 26 Mar 1997 22:35:02 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: s/// fails because of embedded ()'s
Message-Id: <5hd4em$218$1@halcyon.com>
In article <33393D50.C68@sandia.gov>, Robert Goff <ragoff@sandia.gov> wrote:
|It turns out that $LINK{$url} contained embedded parens. When I escaped
|the parens, the substitution succeeded. I haven't seen anything in the
|man pages or the Camel book to explain this
Are you really saying you're trying to use regular expressions without
having read perlre? There's copious discussions therein on what characters
are metacharacters, and how to escape them.
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: 26 Mar 1997 22:49:37 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: Smarter indexing algorythm
Message-Id: <5hd5a1$2ah$1@halcyon.com>
In article <david-2603971557470001@prokofiev.cnation.com>,
David Alan Pisoni <david@cnation.com> wrote:
|I recently wrote a program that takes a database of zip codes with their
|geographic coordinates and creates an index database listing each zip code
|and the six closest zip codes.
|The reason this algorythm is so slow is that for each zip code it tests
|the distance between itself and EVERY zip code in it's home state, and all
|the states bordering.
I'm not sure how you even define the distance between two zip codes,
because zip codes are areas, not points, and there may be non-contiguous
areas with the same zip code (I think). However, assuming you can solve
those minor problems, the usual method for finding things closest to
other things is to sort them by their coordinates. Then you just have to
work outwards until you find the n closest or all within a certain radius
instead of looking at everything.
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: Wed, 26 Mar 1997 22:37:12 -0800
From: Fred Adorno <fadorno@mail.gte.net>
Subject: Symlink Directories
Message-Id: <333A1598.52C3@mail.gte.net>
Can someone please show me how to symlink between two directories and
keep the link from showing the hidden files?
------------------------------
Date: 27 Mar 1997 06:57:38 GMT
From: "Dale Baley" <ghjfghj@here.cum>
Subject: Re: term 'regular expressions' considered undesirable
Message-Id: <01bc3a7c$1780bd40$899794cc@lucid.interaccess.com>
Political Correctness is everywhere! I cant even program freely anymore? :\
> In the future, whenever you have a choice, say or write 'pattern'
> or 'search pattern' or 'perl pattern' as appropriate instead of
> 'regular expression'. It will be easier for your nontechnical
> audience to understand what you mean, it will mislead fewer people,
> and you even have to type fewer characters!
------------------------------
Date: Thu, 27 Mar 1997 06:32:48 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Text Justification
Message-Id: <ebohlmanE7ovIo.4B8@netcom.com>
Tom Christiansen (tchrist@mox.perl.com) wrote:
: In comp.lang.perl.misc,
: mrchristopher@inorbit.com writes:
: :I came across a script on the web a few months ago for text
: :justification which I have since lost track of. I never tried it but it
: :appeared you fed it raw ascii and it spat out a nice text block with
: :lines split and spaces inserted in the right places so text would appear
: :left and right justified when put between >pre< tags (sic).
: Like the entry in the FAQ?
: Q. How do I reformat a paragraph?
: A. Use Text::Wrap (part of the standard perl distribution):
: use Text::Wrap;
: print wrap("\t", ' ', @paragraphs);
Text::Wrap provides filling (ragged right margin), not justification (even
left and right margins). IMHO, justified text in a fixed-width font on a
screen looks absolutely awful and is harder to read then filled text,
especially when the justification is achieved entirely by space-insertion
without hyphenation.
------------------------------
Date: Thu, 27 Mar 1997 16:15:57 +0900
From: "christop@ozinter.co.jp" <christop@ozinter.co.jp>
Subject: Re: Text Justification
Message-Id: <333A1EAD.690A@ozinter.co.jp>
Ta.. thought as much. Space insertion is okay I've found as long as
you're prepared to play around a bit changing the standard length of the
line to avoid *huge* white spaces. That suggests that the "human
element" of thought involved in this would push the script past quick
and dirty I suppose.
BUT, not to enter into a discussion here on what looks and what doesn't
(heaven forbid...) but just to say it will be useful for something I'm
doing so if the author of the script is around..
Cheers
Christopher
Eric Bohlman wrote:
>
> Text::Wrap provides filling (ragged right margin), not justification (even
> left and right margins). IMHO, justified text in a fixed-width font on a
> screen looks absolutely awful and is harder to read then filled text,
> especially when the justification is achieved entirely by space-insertion
> without hyphenation.
------------------------------
Date: Thu, 27 Mar 1997 06:52:05 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: trying to modify matt's formmail script
Message-Id: <ebohlmanE7owEt.58v@netcom.com>
Anthony Mulligan (avm@best.com) wrote:
: Hi, I am using Matt's exellent formmail script, which parses the contents
: of a form which mails a designated recipient the contents.The script also
: returns a mirror of the form submission to the browser what I want to do
: is change the contents of the returned html document to simply say
: thankyou and not list the items of the form submission while unchanging
: the contents emailed to the designated recipient.
[snip]
Tell you what: I'll show you this one time, but you've gotta promise me
that you're going to get a hold of either the Camel book or the Llama book
(see the FAQ for more details on them) and read enough of them that you
can start to understand what the code in a script actually does.
Modifying existing code rather than writing new code from scratch is a
great idea (in fact, it's over 70% of what a professional programmer
does), but you really need to understand the stuff you're modifying;
otherwise it becomes an exercise in banging your head against the wall
(not Larry :-) ).
Take out this:
: print "Thank you for taking the time to fill out my feedback form. ";
: print "Below is what you submitted to $FORM{'recipient'} on ";
: print "$date<hr>\n";
and this:
: unless ($FORM{'redirect'}) {
: if ($value ne "") {
: print "$name = $value<hr>\n";
: }
: }
------------------------------
Date: 27 Mar 1997 06:04:15 GMT
From: jrs@abiogenesis.com (Jonathan R. Seagrave)
Subject: tying %HoH to DB_File?
Message-Id: <jrs-1401040859560001@dialup12.nas.com>
#!/usr/bin/perl -w
#
# Hi. I'm having a heck of a time trying to tie a
# Hash of a Hash to a DB_File (or any of the DB files
# for that matter.)
#
# I've spent a bunch of time just experimenting with
# different ways to do this and I'm at wit's end.
#
# Here's a bit of code that I've written to highlight
# my confusion. I've commented out the parts that don't
# do what I'd like them to. Any helpful hints will be
# greatly appreciated. Heck, even outright criticisms
# would be welcome.
#
# Thanks a lot. Jonathan.
#
# --
# jrs@abiogenesis.com
# pgp key available at <http://www.abiogenesis.com/jrs>
#
#
use DB_File;
use Fcntl;
use strict;
# here's a hash of a hash to get things started...
my %HoH;
%HoH = (
'camel' => {
'title' => 'Programming Perl',
'color' => 'blue',
},
'llama' => {
'title' => 'Learning Perl',
'author' => 'Randal L. Schwartz',
},
);
my ($beastie, $info);
my ($key, $value);
my %db;
tie(%db, 'DB_File', 'db', O_RDWR | O_CREAT, 0644)
or die "Problem tying db: $!";
# print %HoH -- at least this part works
print "\n\%HoH\n";
while (($beastie, $info) = each %HoH) {
print $beastie, " => ", $info, "\n";
while (($key, $value) = each %$info) {
print " ", $key, " => ", $value, "\n";
}
}
# print %db -- let's see what we're working with
# this will be blank since I can't get %HoH into %db
# but assuming that I could...
print "\n\%db:\n";
while (($beastie, $info) = each %db) {
print $beastie, " => ", $info, "\n";
# I'm not at wit's end, but I can see it from here.
# using %$info doesn't have the effect I'm looking for.
# any ideas?
# while (($key, $value) = each %$info) {
# print " ", $key, " => ", $value, "\n";
# }
}
# put %HoH into %db
# this gets the 'camel' and the 'llama' but seems to
# miss the rest of %HoH
%db = %HoH;
# I've tried to put the whole thing in a loop and put
# 'title' => 'Programming Perl', 'color' => 'blue'...
# and such right into %db but I haven't figured out how
# to do this either... sigh.
while (($beastie, $info) = each %HoH) {
while (($key, $value) = each %$info) {
# seems to be the same problem as wit's end above
# $db{$beastie}{$key} = $value;
}
}
untie %db;
__END__
------------------------------
Date: 27 Mar 1997 04:10:53 GMT
From: dmcook@cts.com (David M. Cook)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <slrn5jjsmb.sgr.dmcook@mozart.cts.com>
>Peter Seebach <seebs@solutions.solon.com> wrote
[...]
>> Linux developers can release something they know to be buggy, and have
>> thousands of people help them work out the bugs.
On 25 Mar 1997 21:43:10 GMT, Tim Behrendsen <tim@a-sis.com> wrote:
>This is an advantage?
Yes, it is, if you need the features of the latest development version
*now*.
Linux has separate stable and development source trees. Peter was
speaking of the development tree. Most poeple run a kernel compiled from
the stable source tree.
Dave Cook
------------------------------
Date: Wed, 26 Mar 1997 23:07:52 -0800
From: sundance@pacbell.net
Subject: Unpacking .gz file
Message-Id: <333A1CC7.29E@pacbell.net>
Does anybody here know how to unpack a .gz file under UNIX?
Thanks.
- AR
------------------------------
Date: Tue, 25 Mar 97 23:18:39 GMT
From: VOCE@fortalnet.com.br (USUARIO)
Subject: Re: Who makes more $$ - Windows vs. Unix programmers?
Message-Id: <5h9m7n$80e@beta.pucpr.br>
In article <1387.7010T977T2070@canit.se>, Iggy Drougge <optimus@canit.se> wrote:
>John Lockwood (johnl@calweb.com) skrev:
>>"Terje A. Bergesen" <terjeber@eunet.spm-protect.no> wrote:
>
>>>> Unix appeals more to me and is more advanced technically, but I am
>>>> afraid that it is losing the market share to Windows 95.
>
>>Unix is more advanced technically? That's interesting. The last time
>>I installed a modem on Windows NT the OS found it for me. The last
>>time I tried it on Unix I read about the nine files one had to edit,
>>then gave up. It seems to me that Unix is losing market share
>>precisely because end users never make the programmer's mistake of
>>confusing technical advancement with obtuseness.
>
>Why would your computer detect a modem for you? Do you mean it sent out "AT" on
>the serial port and listened for "OK", or what? When I use modems, I just plug
>them in into the appropriate sockets.
>Granted, UNIX can be quite comlicated, but it still has the edge over NT in
>really power-demanding niches.
>
>--
> __/\________________ __ ______ _____________________________
> \/ /_ /\__ /\_ _// // //\ /\ / ____________________________\
> / / / / __/ / / / / // / / // / / // / __ __
> / /_/ / / __/ / / / // / / // /_/ // / alias | | _ | _ |__|
> /_____/ /_/ /_/ /_//_/\/_/ \_____\\ \ | |__| |__| .__|
>________________________________________\ \ D r o u g g e
>\_________________________________________/
>
Yes, but, how much is the kilo?
------------------------------
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 188
*************************************