[13401] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 810 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 15 20:17:24 1999

Date: Wed, 15 Sep 1999 17:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 15 Sep 1999     Volume: 9 Number: 810

Today's topics:
        better soundex/metaphone? <dheera@usa.net>
    Re: better soundex/metaphone? <cassell@mail.cor.epa.gov>
    Re: ceiling a decimal number <agray@infoscience.otago.ac.nz>
    Re: CGI cannot open relative path (Eric Bohlman)
    Re: CGI cannot open relative path (Kragen Sitaker)
    Re: CGI in PERL (Eric Bohlman)
    Re: Closing a pipeline before the command is done (Charles DeRykus)
    Re: cookbook: nonforker <rick.delaney@home.com>
    Re: Could someone break this down for me? (Martien Verbruggen)
    Re: Help! Need to check <cassell@mail.cor.epa.gov>
    Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People <cassell@mail.cor.epa.gov>
    Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People harad@my-deja.com
    Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People <cassell@mail.cor.epa.gov>
    Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People <cassell@mail.cor.epa.gov>
    Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People <cassell@mail.cor.epa.gov>
    Re: How do I delete apostraphe from a string? <cassell@mail.cor.epa.gov>
    Re: is this object a child of this class? <mike@yawp.com>
    Re: libwww-perl <cassell@mail.cor.epa.gov>
        need to write www search engine (Roger Jacques)
    Re: need to write www search engine (Abigail)
    Re: Newbe question on Substitution (Martien Verbruggen)
    Re: newbie can't figure out a RE (Larry Rosler)
    Re: newbie can't figure out a RE (Eric Bohlman)
    Re: newbie can't figure out a RE <cassell@mail.cor.epa.gov>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 15 Sep 1999 22:14:47 GMT
From: Dheera <dheera@usa.net>
Subject: better soundex/metaphone?
Message-Id: <7rp5oc$522$1@nnrp1.deja.com>

Hi,
I'm trying to create a similar-word matching subroutine, but got a tiny
problem:
-Soundex does not have enough codes; it has 26*6*6*6 possible codes,
which isn't many if you consider the entire dictionary; often two long
words will be incorrectly matched (i.e. extravagantly,extraneously).
-Metaphone is better, but however, I would like it to cut out the
endings/suffixes too.

Here's what I want to do:
walk,walking,walked should have exactly the same code; it should cut
out any suffixes or endings such as ing,ed,er, etc. After this I could
pipe it into metaphone or whatever.

Any modules available for this, or has any prewritten code been done,
rather than having to brute-forcedly write dozens of regular
expressions to chop endings off?

Thanks,
Dheera
dheera@usa.net



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 15 Sep 1999 17:04:04 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: better soundex/metaphone?
Message-Id: <37E033F4.66B01DF0@mail.cor.epa.gov>

Dheera wrote:
> 
> Hi,
> I'm trying to create a similar-word matching subroutine, but got a tiny
> problem:
> -Soundex does not have enough codes; it has 26*6*6*6 possible codes,

Actually, a significantly smaller number than that comprise
the actual output space.

But that's Knuth's algorithm.  The original soundex algorithm
as patented by Odell and Russel [1918 and 1922, if you care]
didn't truncate down to four characters, or pad with zeroes on
the right to get four characters.  You could always borrow the
Perl code in the Text::Soundex module and make the appropriate
changes for your own work.

> which isn't many if you consider the entire dictionary; often two long
> words will be incorrectly matched (i.e. extravagantly,extraneously).
> -Metaphone is better, but however, I would like it to cut out the
> endings/suffixes too.
> 
> Here's what I want to do:
> walk,walking,walked should have exactly the same code; it should cut
> out any suffixes or endings such as ing,ed,er, etc. After this I could
> pipe it into metaphone or whatever.

It will be more complex than this.  Consider whether you want
to then catch singular vs plural on your nouns.  Then make sure
you can handle:

cherub vs cherubim
ox vs oxen
genus vs genera
octopus vs octopi
index vs indices
phenomenon vs phenomena
formula vs formulas vs formulae
 
> Any modules available for this, or has any prewritten code been done,
> rather than having to brute-forcedly write dozens of regular
> expressions to chop endings off?

The Lingua::EN::Inflect module will do at least some of this.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 16 Sep 1999 11:22:58 +1200
From: Andrew Gray <agray@infoscience.otago.ac.nz>
Subject: Re: ceiling a decimal number
Message-Id: <u1zbzahf1.fsf@infoscience.otago.ac.nz>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
> Andrew Gray  <agray@infoscience.otago.ac.nz> wrote in comp.lang.perl.misc:
<SNIP correct answer>
> So far so good.
<SNIP answer to a rather different question>
> Please, when you presume to answer questions, be sure you know what
> you are talking about.

My apologies to the original poster (and anyone else).  I started
answering one question and somehow finished off answering another.
Now that _is_ a short attention span.

Cheers,
Andrew


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

Date: 15 Sep 1999 22:18:33 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: CGI cannot open relative path
Message-Id: <7rp5vp$9dj@dfw-ixnews8.ix.netcom.com>

Kragen Sitaker (kragen@dnaco.net) wrote:
: You'll probably need to chdir() to get to the right place.  (If I
: understand David Cassell -- that may not be enough for some reason.)
: That means you'll have to modify your CGI scripts anyway, even if only
: one line.
: 
: You could, of course, say
: 
: my $rootdir = "/fubbledy/wubbledy/gubbledy";
: open CONFIG, "<$rootdir/$configname" or die "Couldn't open $rootdir/$configname: $!\n";
: open BLURBLE, "<$rootdir/$blurble" or die "Couldn't open $rootdir/$blurble: $!\n";
: 
: etc.  Then you just have to change $rootdir to move the script.  Same
: as chdir, but guaranteed to work.

Even better: make $rootdir (which might just be the name of the directory 
to chdir() to) a global variable (use vars '$rootdir'), assign it in a 
file (e.g. rootdir.pl) that does nothing but assign it, and then require 
that file in each script.  Now any group of scripts that share the same 
root can be moved with only *one* change in one place.



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

Date: Wed, 15 Sep 1999 23:51:51 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: CGI cannot open relative path
Message-Id: <riWD3.13661$N77.990311@typ11.nn.bcandid.com>

In article <7rp5vp$9dj@dfw-ixnews8.ix.netcom.com>,
Eric Bohlman <ebohlman@netcom.com> wrote:
>Even better: make $rootdir (which might just be the name of the directory 
>to chdir() to) a global variable (use vars '$rootdir'), assign it in a 
>file (e.g. rootdir.pl) that does nothing but assign it, and then require 
>that file in each script.  Now any group of scripts that share the same 
>root can be moved with only *one* change in one place.

How do you require it?  Either using a relative pathname (which,
according to the original poster, doesn't work to open files, so it
probably won't work to require them either) or using an absolute
pathname.  Which will have to be changed.  In every file that requires
rootdir.pl.

I hate bootstrapping.
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Tue Sep 14 1999
55 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 15 Sep 1999 22:54:11 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: CGI in PERL
Message-Id: <7rp82j$9dj@dfw-ixnews8.ix.netcom.com>

Samay (samay1NOciSPAM@hotmail.com) wrote:
: BASIC => Beginners All-purpose Symbolic Insturction Code

Works even better with a good typing insturctor :)

Then there was JOVIAL--Jules' Own Version of the International Algebraic 
Language--Gerald Weinberg described attaching one's own name to a program 
as an "abominable practice" (wonder what he thinks of awk?).  IAL was an 
early name for ALGOL, which stood for ALGOrithmic Language, a rather 
presumptuous title.  The British tried to create CPL--Combined 
Programming Language--as an answer to PL/I or Algol 68, but the goal 
proved too ambitious and eventually Martin Richards implemented the Basic 
Combined Programming Language, BCPL, one of whose descendants lost the 
last 3 letters of its acronym and became just B, whose child in turn 
was C, which begat C++.  LISP of course stands for LISt Processor, and 
SNOBOL stands for StriNg Oriented something something Language.


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

Date: Wed, 15 Sep 1999 22:28:06 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Closing a pipeline before the command is done
Message-Id: <FI4H2u.Gpr@news.boeing.com>

In article <7rmop3$s46@titan.imsi.com>, Larry Martell <larrym@imsi.com> wrote:
>I have a script that opens a pipeline, and then when it sees a specific string
>it's done with the output of that command. It does some processing, and
>then issues another command. When it see the string that signals it's done
>the command is not completed, but I don't care about the rest of the output.
>
>Initially I issued a close(PIPE) when I saw the string, but that hung. I
>then captured the pid of the command and sent it a SIGKILL when I was done.
>That worked as far as my script was concerned, but when it exited I found that
>I had all these invocations of the command still hanging around.  (It issues
>many of them.)
>
>I found that 2 processes actually get started, and I only get back the pid of 
>the parent. I kill that, but the child stays around forever.
>
>For example, if I issue the statement:
>
>$pid = open(TICK, "mycmd |");
>
>and I do a ps I see:
>
>larrym    3462  0.0  1.3 1540  744 p0 S    19:36   0:00 mycmd
>larrym    3461  0.0  0.0   28    0 p0 IW   19:36   0:00 sh -c mycmd
>
>The pid I get back is 3461, which does go away when I send the kill, but
>3462 does not. As I said, even after the script exits, 3462 is still around.
>
>Is there a clean way I get get rid of these processes? I can't really do a
>ps and grep for them because there may be other invocations running that are
>not mine that I don't want to kill.
>

One possibility, although not portable, is a negative 
signal to kill process groups. See perldoc -f signal.

Probably a better way is to let the piped program overlay 
the shell Perl launches:

  $pid = open(TICK, "exec mycmd |");


hth,
--
Charles DeRykus


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

Date: Wed, 15 Sep 1999 23:38:42 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: cookbook: nonforker
Message-Id: <37E02DF9.B925A133@home.com>

[posted & mailed]
[please don't stealth cc me]

Benjamin Schweizer wrote:
> 
> +-->Rick Delaney <rick.delaney@home.com>:
> |
> | If you want that method then you should upgrade your version of
> | IO::Select to the one that has that method.  Better yet, upgrade 
> | your perl since this is a standard module.
> 
> Are you sure? My distribution is only a few months old.
> Perl is relase 5.005_2 from May 1999.
> Which release do I need?

I'm not sure since I have 5.005_03, but now I'm thinking your problem
must be something else.

Of course, it's very simple to find out if your version supports that
method--read the docs.

perldoc IO::Select
 ...
       has_exception ( [ TIMEOUT ] )
           Same as can_read except check for handles that have an
           exception condition, for example pending out-of-band
           data.
 ...

If your documentation differs then I think you need an upgrade.  If it
doesn't then I suggest you read the error message again.

If you don't know what the error message means then you can look it up
in perldiag.  If you still don't understand it then post the actual
message and a description of what you don't understand about it.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Wed, 15 Sep 1999 23:07:15 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Could someone break this down for me?
Message-Id: <DEVD3.39$E%1.3497@nsw.nnrp.telstra.net>

In article <x3yso4gdk8e.fsf@tigre.matrox.com>,
	Ala Qumsieh <aqumsieh@matrox.com> writes:
> harris_m@my-deja.com writes:

>> string has to be between two forward slashes like follows- / whatever /
> 
> which makes it a regular expression.

And it doesn't even _have_ to be between forward slashes. Any quoting
will do. It will be seen as a regexp anyway. Using quoting that makes
it clear that it is a regexp may be considered good coding practice :)

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | In the fight between you and the world,
Commercial Dynamics Pty. Ltd.       | back the world - Franz Kafka
NSW, Australia                      | 


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

Date: Wed, 15 Sep 1999 16:20:44 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Help! Need to check
Message-Id: <37E029CC.B0D92272@mail.cor.epa.gov>

Larry Rosler wrote:
> In article <37DEE281.12239079@mail.cor.epa.gov> on Tue, 14 Sep 1999
> 17:04:17 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
> > tram@olympic.seas.ucla.edu wrote:
[snip]
> > >   push(@new, splice(@old, rand @old, 1));
[snip]
> > Sub-optimal, as already discussed at length in this thread.
> > And you forgot to stick an int() in front of your rand() .

> That doesn't matter.  Whenever a built-in function expects an integer
> argument such as an array index or a string offset, perl converts
> implicitly to integer.

D'OH!  Vacation-head, I guess.  Sorry.
 
> > > for ($i=1; $i<7; $i++)
[snip]
> > Suboptimal way to snatch 6 elements from @new .  And you
> > failed to start at 0 again.
> 
> As they are random elements, it hardly matters which six are chosen.

Technically correct, as always.  But the point with which I was
concerned was the poster's 'apparent' use of arrays starting
with 1 instead of 0, which would be A Bad Thing for naive
lurkers and future archive-readers to latch onto.

I'm surprised you didn't focus on the temporal cost of extending 
the poster's technique to much larger datasets, oh Master
Benchmarker.  :-)

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 15 Sep 1999 16:39:32 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People
Message-Id: <37E02E34.60BD01DD@mail.cor.epa.gov>

[BTW, what *is* the appropriate collective noun for
Perl programmers?  A link?  A hash?  An array?  A class?
A study?  Or perhaps a 'kill' of Perlites, as an analog
of 'a murder of crows'? ]

harad@my-deja.com wrote:
> 
> GetRelevant is a *HOT* venture funded startup

We usually only see the capital word 'hot' surrounded
by asterisks in slightly more risque spams to this ng.

> aiming to be the leading aggregator and
> distributor of promotional offers.

Like this one?  Well, you're making friends reeeeeeal
fast, pal.

Surely you have enough 'tremendous entrepreneurial spirit 
and drive' to find the right place to post job offers.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 15 Sep 1999 23:33:16 GMT
From: harad@my-deja.com
Subject: Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People
Message-Id: <7rpabs$8hd$1@nnrp1.deja.com>



> Who's on your All Star team?
> --
> <kragen@pobox.com>       Kragen Sitaker

Our co-heads of technology are Mark Steckel (VP, Product Development)
who's been CTO at a number of startups and Michael Johnson (VP, Network
Engineering) who was lead engineer at Earthlink and Ziff-Davis.  Both
have all most two decades of experience!  Our technology advisors
include Rich White, who founded Best Internet and Servon (a new ISP)
and Serge Wilson, CEO of Freemerchant.com and a major networking
consultant for more than 10 years.

They are all great to work with, love to teach, and are spearheading
the development of some great technology for a very hot product.  Send
us your resume!


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 15 Sep 1999 16:40:31 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People
Message-Id: <37E02E6F.8069EA97@mail.cor.epa.gov>

Kragen Sitaker wrote:
> 
> In article <7rolu9$ol7$1@nnrp1.deja.com>,  <harad@my-deja.com> wrote:
> >great new twist on a 100 year old business, and
> >are seeking to add to our All Star team!
> 
> Who's on your All Star team?

Well, center field is of course Ken Griffey Jr.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 15 Sep 1999 16:44:32 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People
Message-Id: <37E02F60.E389FE29@mail.cor.epa.gov>

Jonathan Stowe wrote:
> 
> On Wed, 15 Sep 1999 18:11:43 GMT Kragen Sitaker wrote:
> > In article <7rolu9$ol7$1@nnrp1.deja.com>,  <harad@my-deja.com> wrote:
> >>great new twist on a 100 year old business, and
> >>are seeking to add to our All Star team!
> >
> > Who's on your All Star team?
> 
> I'd go for it if they had:
> 
>   Atom Ant

Yes!

>   Secret Squirrel

Yes!

>   Hong Kong Phooey

Well, okay...

>   Scooby Doo

"Hated himmmm!"

>   Dick Dastardly

Always makes unforced errors in end-of-game situations.

>   Mutley

Hhhhh-hhhhh-hhhhhh!

I want the PowerPuff Girls.  They're great at the long ball.
Although the commissioner is talking about outlawing Element X...

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 15 Sep 1999 16:46:45 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Hot, Fun S.F Startup Seeks a Gaggle of Perl People
Message-Id: <37E02FE5.B1902A72@mail.cor.epa.gov>

Randal L. Schwartz wrote:
> >>>>> "harad" == harad  <harad@my-deja.com> writes:
[snip]
> harad> Sent via Deja.com http://www.deja.com/
> harad> Share what you know. Learn what you don't.
>        B**ls**t when you're not sure.  Posture when you don't care.

Share what you don't know.  Unlearn what's correct.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 15 Sep 1999 16:48:08 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How do I delete apostraphe from a string?
Message-Id: <37E03038.9855C88F@mail.cor.epa.gov>

Kragen Sitaker wrote:
[snip]
> On the other hand, you can't delete things with regular expressions.
                            ^^
A tiny typo, as shown by Kragen's next line:
 
> If you want to delete the first apostrophe, you can s/'//.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 15 Sep 1999 17:42:03 -0500
From: Mike Stone <mike@yawp.com>
Subject: Re: is this object a child of this class?
Message-Id: <Pine.NEB.3.96.990915165549.14715B-100000@www.yawp.com>



> >> 		my $isa  = (grep {/$type/} @ISA) ? 1 : 0;
> >
> >...but also incorrect! Unless you think Tonya ISA Tony....
> 
> Also returns false negatives; if X inherits from W, and W inherits from
> Andrew, then X isa Andrew.  But this method doesn't work in that case.
> Also, it doesn't work for isa{'HASH'}.


oy.. not my day, is it?   it's a good thing i never check heirarchies that
way, or i'd be completely out of luck. ;-)

again, switching on classname is generally a weak solution.   it's far
better to define your class interfaces in a way that makes such switching
unnecessary.



as long as we're talking inheritance, anybody wanna warm up the old
flamewar about aggregation v. composition?

    spot IS-A canis-tutti-frutti      # i.e.: mutt
    canis-tutti-frutti IS-A species

    therefore, what's the truth value of 'spot IS-A species'? 

the trivial solution of eliminating the IS-A relationship entirely, and
only using HAS-A, isn't much better:

    spot HAS-A tail (waggly)
    spot HAS-A species (canis-tutti-frutti)

but while you can have a dog without a tail, you can't have a dog without
a species.

;-)


--
mike





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

Date: Wed, 15 Sep 1999 16:32:16 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: libwww-perl
Message-Id: <37E02C80.F87E9ABF@mail.cor.epa.gov>

Michael de Beer wrote:
> 
> perldoc -q module
> 
> This has some helpful answers.
> The stuff on 'make' is only for unix computers.
> On Windows (I think) it is a little different.

Although it is reasonably close, given that you use the
Microsoft nmake program you can get from their website for
free.

The key consideration when on win32 is that some of the
modules which, when snagged off CPAN need to be compile
and/or make'd, are already prepped for you and lying at
ActiveState's repository needing only a quick use of
ppm.  Always check whether the work has been done first,
just to save yourself the headache.

Michael could have told you this too.  He probably just
didn't have the time.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 15 Sep 1999 22:58:20 GMT
From: channel@sunsite.unc.edu (Roger Jacques)
Subject: need to write www search engine
Message-Id: <7rp8ac$3ou$1@fddinewz.oit.unc.edu>

I want to write a robot program that will search all www sites by 
domain type and return the <title>.

For example I want to pull into a two column database the <title>s
and URL's of all .gov sites.

I have extenseive SQL, UNIX and Perl experience and am becoming familiar
with PHP over mySQL.

But I've never written programs the comprehensively search a specified
range of web sites and retrieve specific information.

I would appreciate any help that would get me started.

One question:  Do all .gov sites have a specified range in one of the
dotted decimal quadrants: xxxx.xxxx.xx.xxx, and which is it, or is there
a database where I can find what domain types use what IP numbers?

In addition to replying to this listing, please also email your response
to:
   channel@metalab.unc.edu

Thank you for your pointers.

Roger Jacques








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

Date: 15 Sep 1999 18:52:23 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: need to write www search engine
Message-Id: <slrn7u0ceh.i4j.abigail@alexandra.delanet.com>

Roger Jacques (channel@sunsite.unc.edu) wrote on MMCCVI September
MCMXCIII in <URL:news:7rp8ac$3ou$1@fddinewz.oit.unc.edu>:
== I want to write a robot program that will search all www sites by 
== domain type and return the <title>.

All of them? That's a lot....

== For example I want to pull into a two column database the <title>s
== and URL's of all .gov sites.
== 
== I have extenseive SQL, UNIX and Perl experience and am becoming familiar
== with PHP over mySQL.
== 
== But I've never written programs the comprehensively search a specified
== range of web sites and retrieve specific information.

Strange. You would think someone with extensive Unix and Perl knowledge
should at least know where to start, and certainly would not ask the
question below in this group.

== I would appreciate any help that would get me started.

You would use the LWP modules.

== One question:  Do all .gov sites have a specified range in one of the
== dotted decimal quadrants: xxxx.xxxx.xx.xxx, and which is it, or is there
== a database where I can find what domain types use what IP numbers?

That's not a Perl question. (Extensive Unix knowledge, but you don't know
the simplest thing about DNS?)

== In addition to replying to this listing, please also email your response
== to:
==    channel@metalab.unc.edu

listing? What is a listing in this context?


Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Wed, 15 Sep 1999 23:24:01 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Newbe question on Substitution
Message-Id: <lUVD3.48$E%1.3497@nsw.nnrp.telstra.net>

In article <37DFBC57.A74E0002@ncgr.org>,
	Wen Huang <wih@ncgr.org> writes:
> oops! I totally misread your question.  Too little sleep can do that =)  Sorry
> about that...

Heh. I suggest you get some sleep immediately then, because:

1) I did not ask the question. I just responded to it.
2) You seem to have lost the ability to put your response _after_ the
   post you quote.
3) You seem to be unable to find your delete key to trim the number of
   quoted lines to a reasonable number.
4) Your newsreader also seems to need sleep, since it included my
   signature in the quote.

-) All in all you added some 55 quoted lines which you never respond
   to directly, and you add them after your response. You can do better
   than that next time, I hope.

I hope you sleep well, and will feel better in the morning :)

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: Wed, 15 Sep 1999 15:33:25 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie can't figure out a RE
Message-Id: <MPG.1249be8e402e6f70989f7a@nntp.hpl.hp.com>

In article <37E0180C.46822FF1@home.com> on Wed, 15 Sep 1999 22:04:56 
GMT, Dustin Aleksiuk <daleksiuk@home.com> says...
> I'm brand new to perl (as of yesterday).  I'm trying to figure out a way
> to index words in a textfile.  It's working fine, but I need to get rid
> of all punctuation except for apostrophes.  I did this to lowercase
> everything and then get rid of all non-alphabet characters:
> 
>    $aWord =~ tr/A-Z/a-z/;
>    $aWord =~ tr/a-z//cd;
> 
> It works fine, but words like don't come out as dont.  I'm looking for a
> way to say, 'get rid of all punctuation BUT apostrophes.

     $aWord =~ tr/a-z'//cd;

:-)

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


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

Date: 15 Sep 1999 23:16:34 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: newbie can't figure out a RE
Message-Id: <7rp9ci$9dj@dfw-ixnews8.ix.netcom.com>

Dustin Aleksiuk (daleksiuk@home.com) wrote:
: I'm brand new to perl (as of yesterday).  I'm trying to figure out a way
: to index words in a textfile.  It's working fine, but I need to get rid
: of all punctuation except for apostrophes.  I did this to lowercase
: everything and then get rid of all non-alphabet characters:
: 
:    $aWord =~ tr/A-Z/a-z/;
:    $aWord =~ tr/a-z//cd;
: 
: It works fine, but words like don't come out as dont.  I'm looking for a
: way to say, 'get rid of all punctuation BUT apostrophes.

Well, your second statement says "get rid of everything but the letters a 
through z."  What you plainly want it to say is "get rid of everything 
but apostrophes and the letters a through z."  Believe it or not, the way 
you do that is to put in apostrophe in the same place you're putting 
a-z.  If you haven't already smacked your head and said "duh!", take a 
look at the documentation for tr///.



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

Date: Wed, 15 Sep 1999 16:53:02 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: newbie can't figure out a RE
Message-Id: <37E0315E.108106CF@mail.cor.epa.gov>

Eric Bohlman wrote:
> 
> Dustin Aleksiuk (daleksiuk@home.com) wrote:
> : I'm brand new to perl (as of yesterday).  I'm trying to figure out a way
> : to index words in a textfile.  It's working fine, but I need to get rid
> : of all punctuation except for apostrophes.  I did this to lowercase
> : everything and then get rid of all non-alphabet characters:
> :
> :    $aWord =~ tr/A-Z/a-z/;
> :    $aWord =~ tr/a-z//cd;
> :
> : It works fine, but words like don't come out as dont.  I'm looking for a
> : way to say, 'get rid of all punctuation BUT apostrophes.
> 
> Well, your second statement says "get rid of everything but the letters a
> through z."  What you plainly want it to say is "get rid of everything
> but apostrophes and the letters a through z."  Believe it or not, the way
> you do that is to put in apostrophe in the same place you're putting
> a-z.  If you haven't already smacked your head and said "duh!", take a
> look at the documentation for tr///.

True.  But if he also has single quotes in his text file,
he'll still have them in there after this.  He'll need a regex to
keep the single quotes bracketed by letters while canning
those that don't have a letter on both sides.  tr/// won't do
that for him.  But you know that already.

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 810
*************************************


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