[16546] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3958 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 9 03:05:26 2000

Date: Wed, 9 Aug 2000 00:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <965804711-v9-i3958@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 9 Aug 2000     Volume: 9 Number: 3958

Today's topics:
    Re: Chess Game (Deep Blue) in Perl? <as@if.com>
        Convert URLs to links <fm@via-rs.net>
    Re: Converting from US dates/numbers to European dates/ (Logan Shaw)
    Re: Converting from US dates/numbers to European dates/ <godzilla@stomp.stomp.tokyo>
    Re: Converting from US dates/numbers to European dates/ (Logan Shaw)
        debug: How to go up-stack from breakpoint (David Combs)
    Re: debug: How to go up-stack from breakpoint (Ilya Zakharevich)
    Re: Difference between a .cgi file and a .pl file? (Abigail)
    Re: Expert advise needed (Logan Shaw)
    Re: Expert advise needed (Abigail)
    Re: Expert advise needed (Logan Shaw)
    Re: find the number of characters in a string (Craig Berry)
    Re: find the number of characters in a string <godzilla@stomp.stomp.tokyo>
        GREP - type of script... <ultraserverNOulSPAM@hotmail.com.invalid>
        how to USE perl 5.6's assert.pl? (David Combs)
    Re: Howto find module informations in perldoc (Logan Shaw)
        Mailform <unartic@cistron.nl>
        non-blocking TCP connect()? (Logan Shaw)
    Re: Parsing name list -- Help! <jeff@yoak.com>
    Re: perl sql (delimited) (Logan Shaw)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 09 Aug 2000 05:39:57 GMT
From: "Kermit" <as@if.com>
Subject: Re: Chess Game (Deep Blue) in Perl?
Message-Id: <N86k5.118550$1h3.1893424@news20.bellglobal.com>

Gee,

You guys are really encouraging towards people wanting to try something that
they don't have any experience in.  I guess you people aren't challenged by
anything new anymore, must be nice to be so knowledgeable.

Sorry I asked.



Also, you can find more information about the module that doesn't exist at
the following link and no it doesn't come with Perl, but you already knew
that.  ;)
http://rpmfind.net/linux/RPM/CPAN/1/src/CPAN_rev.2/alpha/perl-Games-Chess-0.
002-2.alpha.html

> What chess module? There's no chess module coming with Perl.
>
> As for setting up tables, well, making a chess program is largely indepent
> of the language used. Perhaps 5% is language dependent, probably less.
> If you have to ask such questions, perhaps you should reconsider.
>
>
> Abigail
> --
> # Perl 5.6.0 broke this.
>
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)(
(.)
> (.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of
Hanoi




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

Date: Wed, 9 Aug 2000 02:23:58 -0300
From: "Fernando" <fm@via-rs.net>
Subject: Convert URLs to links
Message-Id: <8mqqn3$1qf2$1@phi.procergs.com.br>

I want to write a regular expression that search if the user supplied a
url(http://anything.net or www.anything.com for example) in a texarea form
and convert it to a link.

I tried the following:

$string =~ s/(http:\/\/.+|www\..+)/<a href=$1>$1<\/a>/g;

Well, of course it failed, but if I substitute the "." for a "\w" it'll
still not do the right job.







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

Date: 8 Aug 2000 23:23:23 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <8mqmbr$beq$1@provolone.cs.utexas.edu>

In article <39907571.84C66663@stomp.stomp.tokyo>,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>Logan Shaw wrote:
>> Godzilla!
>> >So, you are stating a computer CPU / math co-processor recognizes
>> >a comma as a decimal point
> 
>> Generally, CPU's and math co-processors don't use decimal points
>> at all;
> 
>So, enter this simple addition into your computer, favorite
>calculator or my preference, a sliderule, without decimal points,
>
>2.2 + 2.2
>
>otherwords, without decimal points,
>
>22 + 22 
>
>and tell me what you get for a sum.

What does that have to do with what a *CPU* or *math co-processor*
recognize?  That is what you were talking about, after all.  Decimal
points have to do with what software recognizes and converts, not what
CPU's deal with.  Most CPUs these days seem to use either integers (no
decimal point) or IEEE floating point (also no decimal point).

  - Logan


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

Date: Tue, 08 Aug 2000 23:07:38 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <3990F52A.6CC3715@stomp.stomp.tokyo>

Logan Shaw wrote:
> 
> In article <39907571.84C66663@stomp.stomp.tokyo>,
> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> >Logan Shaw wrote:
> >> Godzilla!

> >> >So, you are stating a computer CPU / math co-processor recognizes
> >> >a comma as a decimal point

> >> Generally, CPU's and math co-processors don't use decimal points
> >> at all;

> >So, enter this simple addition into your computer, favorite
> >calculator or my preference, a sliderule, without decimal points,

> >2.2 + 2.2

> >otherwords, without decimal points,

> >22 + 22

> >and tell me what you get for a sum.
 
> What does that have to do with what a *CPU* or *math co-processor*
> recognize?  That is what you were talking about, after all.  Decimal
> points have to do with what software recognizes and converts, not what
> CPU's deal with.  Most CPUs these days seem to use either integers (no
> decimal point) or IEEE floating point (also no decimal point).

This classic logical fallacy of Begging The Issue, is a trap
almost all here fall into. This annoys me. There is no excuse
for this type of ignorance save for an excuse of malice intent
which reigns within this newsgroup. This annoys me as teacher
to realize there are so many lacking a decent education, 
especially in communicative skills and, diplomacy. Hatred
is not my bag no more than weenie wagging is.

"I'll paint any car, any color, for nineteen-ninety-five."

A famous but antiquated slogan of Earl Schieb, King of
Repaints, albeit horrible quality.

Drive a blue Chevrolet into his shop, magic things happen
within his shop and, out the other end, comes a bright
shiny red Chevrolet. However, it is still, a Chevrolet.

Enter decimal numbers into a computer for mathematical
manipulation, magic things happen inside and, out the
other end comes different decimal numbers. However, 
they are still decimal numbers.

Decimal points are registered, relative positions noted
and pass through a system, quite handsomely, although a
different color as final product. They do not vanish, 
then suddenly reappear in the correct position as you boys
are trying to claim. Input decimal positions rule what
happens internally, regardless if those decimal points
are represented by floating points, sinking commas or
flying exclamation marks. You boys are producing a scam
paint job worse than Earl's, and worth even less.

This lame brain mule manure you boys have slung around
to afford yourselves a chance to weenie wag, is just that,
mule manure. Decimal numbers in, decimal numbers out.
Beg the Issue all you want with machine language gobbly
gookster gibberish, it still comes down to mule manure
weenie wagging by a bunch of ill-educated immature boys.

DIDO, decimal in, decimal out. However, with you boys
our classic GIGO rule well applies.

Clearly those of you boys involved in this mule manure
today, don't have a slightest concept of symbolic
representation, whether it is gobbly gook geekster
gibberish, a person here pretending to be literally
hundreds of different people, or my right hand fat
middle finger.

Godzilla!


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

Date: 9 Aug 2000 01:54:16 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Converting from US dates/numbers to European dates/numbers
Message-Id: <8mqv6o$c5n$1@provolone.cs.utexas.edu>

In article <3990F52A.6CC3715@stomp.stomp.tokyo>,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>Logan Shaw wrote:
>> 
>> In article <39907571.84C66663@stomp.stomp.tokyo>,
>> Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
>> >Logan Shaw wrote:
>> >> Godzilla!
>
>> >> >So, you are stating a computer CPU / math co-processor recognizes
>> >> >a comma as a decimal point
>
>> >> Generally, CPU's and math co-processors don't use decimal points
>> >> at all;
>
>> >So, enter this simple addition into your computer, favorite
>> >calculator or my preference, a sliderule, without decimal points,
>
>> >2.2 + 2.2
>
>> >otherwords, without decimal points,
>
>> >22 + 22
>
>> >and tell me what you get for a sum.
> 
>> What does that have to do with what a *CPU* or *math co-processor*
>> recognize?  That is what you were talking about, after all.  Decimal
>> points have to do with what software recognizes and converts, not what
>> CPU's deal with.  Most CPUs these days seem to use either integers (no
>> decimal point) or IEEE floating point (also no decimal point).
>
>This classic logical fallacy of Begging The Issue, is a trap
>almost all here fall into. This annoys me.

Not nearly as much as it annoys me that you've done the following
things:

1.  Brought up the question of whether "a computer CPU / math co-processor
    recognizes a comma as a decimal point".
2.  Ignored my comments when I explained that they don't.
3.  Changed the subject to what users enter into the user interface
	(which has nothing to do with what the CPU or co-processor
	sees as a number).
4.  Accused me of begging the question since this didn't result in
	my agreeing with you.

Seems to me you've fallen into the logical fallacy of Making Numerous
Unrelated Statements and Believing This Somehow Supports Your
Position.

Anyway, for the zillionth time, floating point numbers are internally
represented as an INTEGER mantissa and an INTEGER exponent.  Since the
original discussion was about WHAT CHARACTER is used to represent the
decimal point, and since in IEEE floating point (and other similar
formats) there is in fact NO CHARACTER used to represent the decimal
point (since there is no decimal point), I think we can safely say that
in the context of this discussion, there is no decimal point.

Your statements about what the user interface might do are irrelevant
to the question originally posed, which is whether CPUs and math
co-processors use a certain character to represent the decimal point.

To make this even clearer, I'll explain a little bit about IEEE
floating point.  First of all, in (decimal) scientific notation, each
number is written as a mantissa and an exponent, and the mantissa is a
number with exactly one non-zero digit to the left of the decimal
point.  IEEE floating point uses a similar scheme.  However, it is of
course in binary, so the non-zero digit to the left of the point would
always be a 1, since that's the only other option.  Thus, both the 1
and the point to its right are only implied; neither is stored in the
word because it would be a waste of space.

Thus, there is no decimal point, nor is there any binary analog to a
decimal point.

All of this serves to illustrate the point that there are more ways to
store and represent fractional numbers than to use decimal numbers with
decimal points.

For instance, to address the comment you made earlier, I could easily
enter the expression "2.2 + 2.2" into my computer without using a
decimal point.  I'd just type this:

	(2 + 2/10) + (2 + 2/10)

Or even this:

	(22/10) + (22/10)

Just what kind of a response I got would depend on my software.  It is
important to note that it would NOT be determined entirely by my CPU.

The result of this computation might be that "4.4" would appear on my
screen, or it might be that "44/10" would appear on the screen or even
"22/5".  Or maybe the result would be in IEEE floating point.  Or,
perhaps the printer would spit out a picture of a number line with an
arrow pointing at the appropriate spot.

  - Logan


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

Date: 9 Aug 2000 04:55:09 GMT
From: dkcombs@netcom.com (David Combs)
Subject: debug: How to go up-stack from breakpoint
Message-Id: <8mqo7d$t52$1@slb0.atl.mindspring.net>


How to go up-stack from a breakpoint, getting into the
(suspended) context of "this function's" caller, or that
caller's caller, etc, etc, and be able to snoop around at that
level, looking at the current value of that level's variables,
etc.

The debugger for the programming-language I use, Mainsail, has
a command "n" that allows exactly that -- when in the Mainsail
debugger, each additional "n" takes you one frame more up the
call-stack (assumption here being that that the stacks grows
"upwards"), and it puts you right there, in THAT "upper"
frame's context, and from which where you can examine
variables, or even execute statements FROM that context.

(For editing purpose (using the Mainsail editor) you're also
placed at the source-line at that point of call.)

(And, even works from in the middle of an exception, or via a
different command, the exception context can be made
invisible).

(Pretty neat debugger; because, I guess, of the bright people
who wrote the thing.  They sure did it "right".)

---

Having operated like this since 1982, I now have NO CONCEPT of
how to successfully debug WITHOUT such a facility.

I mean, I set a breakpoint way down in some function, start-up
the program, and soon end up at that breakpoint -- how in the
world to see the context of up where you were called from,
being able to snoop around "up" there.

(Sure, I can type in "T", but (I believe, until you tell me the
secret) that it's limited to only SHOWING me the call-stack,
but I can't USE that stack to change my debugging context.)

So I'm thinking that there simply MUST be a way in the perl
debugger to do this -- ESPECIALLY since perl executes via an
INTERPRETER!  (Not that I'm someone who could implement it, it
just can't be that difficult.)

But I can't find any doc on such a command, either in PP3, the
debugger's "h(elp)", or anywhere else.



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

Date: 9 Aug 2000 05:27:19 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: debug: How to go up-stack from breakpoint
Message-Id: <8mqq3n$h2n$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to David Combs
<dkcombs@netcom.com>],
who wrote in article <8mqo7d$t52$1@slb0.atl.mindspring.net>:
> 
> How to go up-stack from a breakpoint, getting into the
> (suspended) context of "this function's" caller, or that
> caller's caller, etc, etc, and be able to snoop around at that
> level, looking at the current value of that level's variables,
> etc.

Nohow.  While it would not be *very* hard to get to the lexicals at
the specified scope, there is very little hope that one can get to
shadowed values of local()ized variables.  And without this "uplevel"
is kinda useless.

Ilya


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

Date: 09 Aug 2000 05:36:08 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Difference between a .cgi file and a .pl file?
Message-Id: <slrn8p1rdi.cro.abigail@alexandra.foad.org>

Tim Hammerquist (tim@degree.ath.cx) wrote on MMDXXXV September MCMXCIII
in <URL:news:slrn8p1c27.u2.tim@degree.ath.cx>:
:: On 07 Aug 2000 15:33:34 GMT, Abigail <abigail@foad.org> wrote:
:: > Tim Hammerquist wrote:
:: > [] This is correct for the most part.  However, .pl (by def) implies that
:: > [] it's a perl script, perl library, or something written in Polish.  =)
:: > 
:: > By whose definition?
:: 
:: The perl docs mentioned that .pl was an old extension for perl
:: "libraries," such as cgi-lib.pl, which isn't an independent script, but
:: a "library" of functions, etc.
:: 
:: ActivePerl for Win32, which operates far too much by file extension,
:: maps .pl to perl.exe by default.
:: 
:: As for Polish, check your locale dir(s) on *nix systems.
:: 
:: Maybe I should have clarified: .pl IMPLIES perl script by CONVENTION.
:: It doesn't mean I agree or endorse this practice.

There is a world of difference between 'convention' and 'by definition'.


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: 8 Aug 2000 23:32:49 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Expert advise needed
Message-Id: <8mqmth$bgv$1@provolone.cs.utexas.edu>

In article <slrn8p18vc.cro.abigail@alexandra.foad.org>,
Abigail <abigail@foad.org> wrote:
>Logan Shaw (logan@cs.utexas.edu) wrote on MMDXXXIV September MCMXCIII in
><URL:news:8mpr9e$a4j$1@provolone.cs.utexas.edu>:
>[] In article <slrn8p06h1.st1.abigail@alexandra.foad.org>,
>[] Abigail <abigail@foad.org> wrote:
>[] >Ask your boss whether he's a criminal himself, who illegally copies
>[] >books, CDs and dollar bills. If he isn't, ask him why he assumes your
>[] >customers are.
>[] 
>[] All it takes is for one customer to illegally copy the source code for
>[] there to be a problem.
>
>Same for books, CDs, movies, etc.

Books, CDs, and movies don't usually cost thousands of dollars, and it
usually isn't as easy to copy one as just typing "cp" or dragging an
icon from one place to another.

So you're right in that some of the principles are the same, but the
numbers (i.e. cost-benefit ratio for copying) are different.

  - Logan


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

Date: 09 Aug 2000 05:37:08 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Expert advise needed
Message-Id: <slrn8p1rfe.cro.abigail@alexandra.foad.org>

Logan Shaw (logan@cs.utexas.edu) wrote on MMDXXXV September MCMXCIII in
<URL:news:8mqmth$bgv$1@provolone.cs.utexas.edu>:
][ In article <slrn8p18vc.cro.abigail@alexandra.foad.org>,
][ Abigail <abigail@foad.org> wrote:
][ >Logan Shaw (logan@cs.utexas.edu) wrote on MMDXXXIV September MCMXCIII in
][ ><URL:news:8mpr9e$a4j$1@provolone.cs.utexas.edu>:
][ >[] In article <slrn8p06h1.st1.abigail@alexandra.foad.org>,
][ >[] Abigail <abigail@foad.org> wrote:
][ >[] >Ask your boss whether he's a criminal himself, who illegally copies
][ >[] >books, CDs and dollar bills. If he isn't, ask him why he assumes your
][ >[] >customers are.
][ >[] 
][ >[] All it takes is for one customer to illegally copy the source code for
][ >[] there to be a problem.
][ >
][ >Same for books, CDs, movies, etc.
][ 
][ Books, CDs, and movies don't usually cost thousands of dollars, and it
][ usually isn't as easy to copy one as just typing "cp" or dragging an
][ icon from one place to another.

I guess you've never heard of Napstar....



Abigail
-- 
BEGIN {$^H {q} = sub {pop and pop and print pop}; $^H = 2**4.2**12}
"Just "; "another "; "Perl "; "Hacker\n";


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

Date: 9 Aug 2000 00:56:27 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Expert advise needed
Message-Id: <8mqrqb$bu6$1@provolone.cs.utexas.edu>

[ copying source code ]

In article <slrn8p1rfe.cro.abigail@alexandra.foad.org>,
Abigail <abigail@foad.org> wrote:
>Logan Shaw (logan@cs.utexas.edu) wrote on MMDXXXV September MCMXCIII in
><URL:news:8mqmth$bgv$1@provolone.cs.utexas.edu>:
>][ Books, CDs, and movies don't usually cost thousands of dollars, and it
>][ usually isn't as easy to copy one as just typing "cp" or dragging an
>][ icon from one place to another.
>
>I guess you've never heard of Napstar....

Napster makes it easier, but still not that easy since you have to deal
with slow servers and hmm... what else... oh yeah, the fact that there
hasn't really ever been anything I'd want to download, even for free.

Also, despite the fact that it takes 1-5 minutes to download something
from Napster, the value of what you download is something on the order
maybe $1 (since it's mp3, which sounds bad).  Meanwhile, you can copy a
bunch of perl source code in much less than 1 minute, and its value (if
it's a complete e-commerce solution) could be something in the
thousands of dollars or more.

So, once again, it's not terribly difficult to copy songs in mp3
format, but the decision to copy is going to be based on how much
effort it takes and what the payoff is.  The ratio is significantly
different for software than it is for music.

Furthermore, Napster is evidence that there is reason to suspect people
will copy things illegally.

  - Logan


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

Date: Wed, 09 Aug 2000 04:31:48 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: find the number of characters in a string
Message-Id: <sp1nlkt363a63@corp.supernews.com>

Godzilla! (godzilla@stomp.stomp.tokyo) wrote:
: > To count the number of letter characters, respecting the 
: > current locale, I would use s/([^\W\d_])/$1/g in scalar context.
: 
: Would this work for Arabic and Eastern Bloc Cyrillic alphabet
: along with Asian calligraphy?

If there are locales and character encodings for these, yes, it would.
That's the whole beauty of it.

: I am being silly Mr. Berry. However this does remind me of an
: incident during which numerous experts here took turns yelling
: at me for addressing a transliteration question out of England
: and not accounting for locale languages but rather an English
: alphabet, although the question applied to England.

Murphy tells us that just as soon as you finish off your magnum opus
program which is utterly guaranteed to be run only in England, your boss
will tell you it needs to be run in Japan.  Best to program defensively,
when it's reasonably easy to do so.

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Turning and turning in the widening gyre
   |   The falcon cannot hear the falconer." - Yeats, "The Second Coming"


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

Date: Tue, 08 Aug 2000 22:20:55 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: find the number of characters in a string
Message-Id: <3990EA37.A95417D8@stomp.stomp.tokyo>

Craig Berry wrote:
 
> Godzilla! (godzilla@stomp.stomp.tokyo) wrote:

> : > To count the number of letter characters, respecting the
> : > current locale, I would use s/([^\W\d_])/$1/g in scalar context.

> : Would this work for Arabic and Eastern Bloc Cyrillic alphabet
> : along with Asian calligraphy?
 
> If there are locales and character encodings for these, yes, it would.
> That's the whole beauty of it.
 
> : I am being silly Mr. Berry.
 
> Murphy tells us that just as soon as you finish off your magnum opus
> program which is utterly guaranteed to be run only in England, your boss
> will tell you it needs to be run in Japan.  Best to program defensively,
> when it's reasonably easy to do so.

More than just defensively, Mr. Berry. Program for reality.

Over the years, Mr. Berry, literally thousands of kids passed through
my Mother Hen clutch. These kids are from all over our world. Most
are typical, some disabled in different ways, a few, well, tragic
circumstances often bringing me to tears in privacy. 

Many summers, I spent teaching English as a second language. Quite
the challenge having kids from Asia, from the Mid-East, Latin
America, even a few from Eastern Bloc countries. Communicating
with such a wide range of native tongues, taught me more than
I believe I taught these kids. In a final analysis, my teaching
method came down to pictures and hands-on objects. Fun at times.
I always encouraged a Ethnic Cookout Day. Parents helped, students
brought in or cooked foods in our Home Ec class, dishes of their
home country. Rather challenging to keep from passing gas during
those days, to smile and say, "This is delicious! Would you
excuse me for a moment while I suck on a fire extinquisher?"

Anyhow, one of my most interesting learning lessons, for myself,
came from a young Saudi boy. He gave me one of his science books
and explained, with his fingers and gestures, relative to our 
English books, the first page is the last page, start reading 
at the bottom right hand corner of each page, moving left and 
upward; simply backwards for us.

You know what field is lacking the most in good programming?
Education. There a lot of good programs out there, but most
are very simple programs designed to create a quiz, keep
attendance records, generate graphics for ditto head teachers.

Years back while I struggled to solve a spat between two boys,
one speaking Vietnamese, the other Arabic, myself, deliberately
speaking Choctaw, like who would notice? Well, I had a thought
which came about often, "What I would give for a Star Trek 
Universal Translator."

With your diplomatic tact and pleasant demeanor, Mr. Berry,
you would be a shoe-in for writing programs to assist kids
break through language barriers, which are a great obstacle
to many notions, such as good health and peace, worldwide.

My personal notion is almost all unpleasant events of 
history, plagues, wars, famine, these types of events,
are in a great part, contributable to poor communication
due to language barriers, whether these barriers are simple
illiteracy or different tongues. Shows up here at times, yes?

Perhaps a day will come, you will consider making a great
contribution to our world by producing programs which will
allow parents, teachers and kids, all peoples, to really 
talk to each other, regardless of native tongue. Who knows?
You might lay the foundation for a Star Trek Universal
Translator, with a feminine voice, naturally.

Arabic, I believe, would be a good challenge for your skills.
Choctaw, I don't think so. Last Choctaw dictionary was printed
in 1909 and resides within our Smithsonian Institute. I am 
blessed to own a copy of this dictionary.

You are quite correct. There is no way of knowing what will
come your way in needs of programming. Defensive programming,
like defensive driving, is most intelligent.

This explains my five-hundred horsepower Corvette Mako Shark.
Quite defensive, yes.


Godzilla!


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

Date: Tue, 08 Aug 2000 23:29:55 -0700
From: Scott Barlow <ultraserverNOulSPAM@hotmail.com.invalid>
Subject: GREP - type of script...
Message-Id: <2107d358.62c511bd@usw-ex0108-062.remarq.com>

Hello,

I'm looking to write a perl script that will take a flat
file that contains variable X and Y, and change either X or
Y (user choice) with a new user-input variable.

Kind of like a search and replace - but I'd like to do it
specifically with perl.

Has anyone already done this, and know where I might be
able to get it instead of writing one from scratch?

Regards,

Scott


* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


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

Date: 9 Aug 2000 04:55:12 GMT
From: dkcombs@netcom.com (David Combs)
Subject: how to USE perl 5.6's assert.pl?
Message-Id: <8mqo7g$hb2$1@slb0.atl.mindspring.net>


perl-5.6.0/lib/5.6.0/assert.pl

-------- Here's the contents of that file:
# assert.pl
# tchrist@convex.com (Tom Christiansen)
#
# Usage:
#
#     &assert('@x > @y');
#     &assert(' > 10', , , @various_info);
#
# That is, if the first expression evals false, we blow up.  The
# rest of the args, if any, are nice to know because they will
# be printed out by &panic, which is just the stack-backtrace
# routine shamelessly borrowed from the perl debugger.

sub assert {
    &panic("ASSERTION BOTCHED: [$[]",) unless eval [$[];
}

sub panic {
    package DB;

    select(STDERR);

    print "\npanic: @_\n";

    exit 1 if $] <= 4.003;  # caller broken

    # stack traceback gratefully borrowed from perl debugger

    local ;
    my ;
    my (,,,,,,@a,@frames);
    for ( = 0; (,,,,,) = caller(); ++) {
	@a = @args;
	for (@a) {
	    if (/^StB\000/ && length() == length({'_main'})) {
		 = sprintf("%s",);
	    }
	    else {
		s/'/\'/g;
		s/([^\0]*)/''/ unless /^-?[\d.]+$/;
		s/([\200-\377])/sprintf("M-%c",ord()&0177)/eg;
		s/([\0-\37\177])/sprintf("^%c",ord()^64)/eg;
	    }
	}
	 =  ? '@ = ' : '$ = ';
	 =  ? '(' . join(', ', @a) . ')' : '';
	push(@frames, "& from file  line \n");
    }
    for (=0;  <= 0frames; ++) {
	print [];
    }
    exit 1;
}

1;
-------- END OF "Here's the contents of that file".

Noticing the "1;" return-val at the end, and even though
the assert.pl file-NAME did NOT end in .pm, NOR was the
first char capitalized "Assert.pm",
I therefore tried a "use assert;", and got this error:

341 ==/myexternals/home/dkc==> perl -w test-18may00.pl
----------- Now testing jobNum = 11
Undefined subroutine &main::assert called at test-18may00.pl line 402.
342 ==/myexternals/home/dkc==> !perl
perl -w test-18may00.pl
Can't locate assert.pm in @INC (@INC contains: /usr/local-perl-5.6.0/lib/5.6.0/sun4-solaris /usr/local-perl-5.6.0/lib/5.6.0 /usr/local-perl-5.6.0/lib/site_perl/5.6.0/sun4-solaris /usr/local-perl-5.6.0/lib/site_perl/5.6.0 /usr/local-perl-5.6.0/lib/site_perl .) at test-18may00.pl line 402.
BEGIN failed--compilation aborted at test-18may00.pl line 402.



So, I tried adding this
    use lib "/var/local/perl-5.6.0/lib/5.6.0/";
from which I got this error (the same error I got
the first time, just a plain call to assert):

350 ==/myexternals/home/dkc==> !perl
perl -w test-18may00.pl
----------- Now testing jobNum = 11
Undefined subroutine &main::assert called at test-18may00.pl line 436.

------

So, please, how DOES one call something like "assert()", other than
simply lifing the code in inserting it into my own program
or library-module?

perl-5.6.0/lib/5.6.0/assert.pl


Here is a dired buf of /usr:
  /usr:
  total 354
  drwxrwxr-x  33 root     sys         1024 May 28 18:46 .
  dr-xr-xr-x  29 dkc      root        1536 Apr 28 23:41 ..
  drwxrwxr-x   2 root     bin         1024 Dec 26  1999 4lib
  lrwxrwxrwx   1 root     root           5 Sep 24  1999 5bin -> ./bin
  lrwxrwxrwx   1 root     root           9 Sep 24  1999 X -> ./openwin
  lrwxrwxrwx   1 root     root          10 Sep 24  1999 adm -> ../var/adm
  drwx------   8 root     bin          512 Sep 24  1999 aset
  drwxrwxr-x   3 root     bin         7680 Dec 26  1999 bin
  drwxr-xr-x   4 bin      bin          512 Sep 24  1999 ccs
  ...
  drwxr-xr-x  12 root     other        512 May 28 18:44 local
  lrwxrwxrwx   1 root     other         21 Apr 13 12:03 local-gcc-2.95.2 -> /var/local/gcc-2.95.2
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  lrwxrwxrwx   1 root     other         20 May 28 18:46 local-make-3.77 -> /var/local/make-3.77
  lrwxrwxrwx   1 root     other         21 Apr 15 16:54 local-perl-5.6.0 -> /var/local/perl-5.6.0
  drwx------   2 root     root        8192 Sep 24  1999 lost+found
  ...


352 ==/myexternals/home/dkc==> echo /usr/ucb:/usr/bin:/usr/5bin:/usr/local/bin:/u/u5/dkcombs/bin:.
/usr/dt/bin:/usr/openwin/bin:/usr/bin:/usr/sbin:/usr/ucb:/usr/ccs/bin:/usr/local-perl-5.6.0/bin:/usr/local2/bin:/usr/local/bin:/myexternals/opt/Acrobat3.2/bin:/myexternals/opt/gnu/bin/:/opt/NSCPcom
                                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^
353 ==/myexternals/home/dkc==>



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

Date: 8 Aug 2000 23:25:14 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Howto find module informations in perldoc
Message-Id: <8mqmfa$bff$1@provolone.cs.utexas.edu>

In article <slrn8p1526.h1e.marcel@gandalf.local>,
Marcel Grunauer <marcel@codewerk.com> wrote:
>On Tue, 8 Aug 2000 22:38:14 +0200, Otto Wyss <otto.wyss@bluewin.ch> wrote:
>
>>I'd like to know anything about the "Getoptions" in the following script
>>but I don't know howto use perldoc, i.e.
>>
>>perldoc Getopt
>>No documentation found for "Getopt"
>
>>use Getopt::Long;
>
>Try the obvious thing:
>
>    perldoc Getopt::Long

In my mind, the obvious thing was always this:

	perldoc GetOpt::Long

But maybe that's just me.

  - Logan


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

Date: Wed, 9 Aug 2000 08:13:37 +0200
From: "Ronald Kas" <unartic@cistron.nl>
Subject: Mailform
Message-Id: <8mqst5$1lv4$1@beast.euro.net>

Hi there!

I'm completely new at perl, and though I'm formiliar with html, asp,
javascript , I want to learn more about perl. I'm trying to write a script
that sends a form by email, but I receive the following error from my
logfile:

'Premature end of script headers'

That is this causing and how do I fix it?

Question 2:
Does anybody now some good sites on which I can learn perl?

Thanx!

Ronald




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

Date: 9 Aug 2000 01:19:20 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: non-blocking TCP connect()?
Message-Id: <8mqt58$c2n$1@provolone.cs.utexas.edu>

Hi.

I've got a situation whether I'd like to connect() several TCP sockets
to several remote systems, but I'd like the connect itself to be
non-blocking so that I can continue processing if one of the systems is
down or being slow.

The first edition of "Unix Network Programming" by Stevens says I can
do this by creating the socket, binding it, and setting it to
non-blocking and *then* calling connect(), but I'd like to do this in
Perl.

The problem is that IO::Socket::INET seems to do everything (creation,
binding, and connect) all at once when you call its new() method.

So, does anyone know if this is possible with that module?  My guess is
that I could use Socket.pm instead, but I'd rather not if I can avoid
it.

Also, once I've gotten this non-blocking connect() issued, how can I
tell when the connection actually has been established?  I know you can
tell that a non-blocking accept() is ready to go using select() and
watching for it to show up as readable, but can you do that for
connect() as well?

Thanks!

  - Logan


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

Date: Tue, 08 Aug 2000 23:35:23 -0800
From: "Jeff Yoak" <jeff@yoak.com>
Subject: Re: Parsing name list -- Help!
Message-Id: <8mqn570146r@news2.newsguy.com>

In article <39909D84.2A8CBD81@ipac.caltech.edu>, Tim Conrow
<tim@ipac.caltech.edu> wrote:

> If you can answer Paul's excellent questions, check out the
> String::Approx module at your local CPAN site.

As I said.  The simpler way.  ;-)

Cheers,
Jeff




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

Date: 8 Aug 2000 23:31:02 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: perl sql (delimited)
Message-Id: <8mqmq6$bg4$1@provolone.cs.utexas.edu>

In article <3990A66B.FC3179AA@rochester.rr.com>,
Bob Walton  <bwalton@rochester.rr.com> wrote:
>fg19537@my-deja.com wrote:
>> 
>> Can anyone tell me how to create a pipe delimited file using SQL in
>> perl?
>> $ref = $sth->fetchall_arrayref();
    :
    :
>> {print "$$row[0] | $$row[1] |\n";}
    :
    :
>> RESULTS I get:
>> bob    | jones    |
>> john   | smith    |
>> RESULTS I want:
>> bob|jones|
>> john|smith|
>...
>Try replacing your print statement with [untested]:
>
>  {
>  my $results="$$row[0]|$$row[1]|\n";
>  $results=~s/\s//g;
>  print $results;
>  }
>
>Your database is returning whitespace past the end of your data that you
>appear to wish not to have, and the above will remove it.

Note that that regular expression will delete all spaces so that
"   billy bob   " would get changed into "billybob" instead of
"billy bob".  Therefore, I suggest this as a replacement for
your print statement:

	foreach my $column (@{$row})
		{
		$column =~ s/^\s+//;
		$column =~ s/\s+$//;
		print "$column|";
		}

Hope that helps.

  - Logan


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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


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