[8716] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2333 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 16 00:07:26 1998

Date: Wed, 15 Apr 98 21:00:24 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 15 Apr 1998     Volume: 8 Number: 2333

Today's topics:
    Re: array of matches in s/// <rjk@coos.dartmouth.edu>
    Re: Array slices using variables for range <uri@sysarch.com>
    Re: avoid double-click on submit button (Martien Verbruggen)
        beta book on Perl <do@ikc.bashnet.ru>
    Re: Blat question <sowmaster@juicepigs.com>
    Re: Content-Length with mailx (Abigail)
    Re: environnemt variables <eelkin@mediaone.net>
    Re: Formatting script for Perl5... <rootbeer@teleport.com>
        Has anyone tested 5.004_64 under FreeBSD? (John Reynolds)
    Re: info on cookies <glchy@csah.com>
    Re: Lat/Long-Dist-Bearing Program? (Dave Adams)
    Re: Memory Leak?  Embedding into C <sdh1@anchor.hotmail.com>
    Re: Perl 5.004_64 Slower??? <sneaker@earthling.net>
    Re: Perl, warning message ?? (Martien Verbruggen)
        Regex problem: match maximal substring (Peter J. Scott)
    Re: understanding Perl<->.html forms? <grinch@whoville.com>
    Re: Weird Truncate Behavior <rjk@coos.dartmouth.edu>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Wed, 15 Apr 1998 23:48:58 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: array of matches in s///
Message-Id: <35357FAD.143C6EA2@coos.dartmouth.edu>

Bart Lateur wrote:
> 
> 'eval' is out of the question, because the phrases are stored into an
> external data file. Tainted code is something I don't regard highly, and
> I only want to substitute actual matches, not just any variable.

So untaint it.  Only accept the code if it is a literal string.
(Using /^("(?:[^\\"]|\\.)*")$/s, perhaps.)

You seem to have already disqualified all the possible solutions to your
problem.  You're going to have to loosen your standards a bit until one of the
solutions is acceptable.  :-)

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 15 Apr 1998 23:47:03 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Array slices using variables for range
Message-Id: <x7g1jezavc.fsf@sysarch.com>

>>>>> "RF" == Robert Fridman <fridman@cpsc.ucalgary.ca> writes:

  RF> Perl (version 5.004_04 built for sun4-solaris) complains that line 9 of
  RF> the following program uses an uninitialized value. I suspect that this
  RF> is caused by the fact the during the compilation stage, the value of
  RF> $length is not known.

your problem is much simpler. $length = @a == 6 so @a[0 .. 6] references
an element in @a which doesn't exist. @a only has elements 0 .. 5 in it.

  RF> #!/usr/local/bin/perl -w
  RF> @a = qw(a b c d e f);
  RF> $length = @a;

$length = @a - 1 ;	# or
$length = $#a;		# last element of @a which is what you want for ..

  RF> print join " ", @a[0..$length], "\n";

no warnings or errors here!

hth,

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----  8 Years of Perl Experience, Available Immediately
uri@sysarch.com  ---------  Resume and Perl Example at http://www.sysarch.com
Use the Best Search Engine on the Net  --------  http://www.northernlight.com


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

Date: 16 Apr 1998 02:36:14 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: avoid double-click on submit button
Message-Id: <6h3qqu$q4q$2@comdyn.comdyn.com.au>

In article <3534D9A6.321A50D7@utoronto.ca>,
	Daryl Nguyen <daryl.nguyen@utoronto.ca> writes:
> The problem is if one double clicks on the submit button, the perl
> script will run twice, if n-click on the submit button, then the script
> will run n-times.

submit button? Does perl have submit buttons? Since when?

> I just want to have a script run just ONCE regardless of how many
> clicks.

Easy. delete it after it has finished running. (hint: look up unlink
and the $0 variable)

If this is (yet another) CGI/HTML question, then I suggest you ask in
one of the appropriate groups in comp.infosystems.www.* somewhere.
There doesn't really seem to be anything perl specific about your
question. Whatever the executable is written in, the answer would be
the same.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.       | you come to the end; then stop.
NSW, Australia                      | 


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

Date: Thu, 16 Apr 1998 08:40:57 +0500
From: "Dmitry Omelchenko" <do@ikc.bashnet.ru>
Subject: beta book on Perl
Message-Id: <6h3uka$54r$1@dns2.bashnet.ru>

Yesturday I began to read the beta book on Perl by Edward S. Peschko and
Michele DeWolfe, and today it is expired and was cancelled from
http://www.pbg.mcgraw-hill.com/betabooks/peschko/peschko-home.html

To my deep regret I had a chance to read only 1 Chapter from there.

Did anybody webcopied it before? If any, could you send it me by email in
any format (preferrable in zipped) if possible?

I haven't possibility to buy the release due to lack of credit card from
here on.

Thank you so much in advance








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

Date: Wed, 15 Apr 1998 22:41:11 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: Sleep <mhchau@cse.cuhk.edu.hk>
Subject: Re: Blat question
Message-Id: <35356FC7.5104@juicepigs.com>

Sleep wrote:
> 
> On Tue, 14 Apr 1998, Hakon Steinx wrote:
> 
> >   Invoke blat with the "- " switch. This produces some garbage at the end of
> > file, and I haven't found a way to get rid of that. I prefer using the
> > file-way.
> > Do something like `blat - -server xxx -f xxx.....`;
> >     - Hakon
> >
> 
> Have u every tried a "-q" switch ? etc 'blat - -server xxx ... -q' .
> 
> btw , I have another question :
> how to set a variable (scalar) become a stdin ? or just send mail (using
> blat) with scalar as it's content ?
> 
> Regards,
> Chau.

Blat was good for a couple of months but it is passe. Use Net::SMTP
instead.


-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: 16 Apr 1998 02:49:03 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Content-Length with mailx
Message-Id: <6h3riv$212$1@client3.news.psi.net>

Database Coder (dbcoder@juno.com) wrote on MDCLXXXVIII September MCMXCIII
in <URL: news:6h382h$49p$1@news.scruz.net>:
++ I wrote a small perl script that uses mailx to send email. The body of the
++ message is read from a text file. When the message is received the first
++ line of the body contains "Content-Length:  805" even thought the string
++ that contains the body text at the time it is sent to mailx does not contain
++ that line. Is there a way to get rid of it?

What does this have to do with perl?

Your question would be more appropriate in rec.furniture; after all,
you are likely to sit on a chair while coding. And if your computer has
a mouse, don't forget to crosspost to rec.pets.rodents.



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'


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

Date: Wed, 15 Apr 1998 23:20:23 -0400
From: "Dick Elkin" <eelkin@mediaone.net>
Subject: Re: environnemt variables
Message-Id: <6h3tcj$343$1@ndnws01.ne.highway1.com>

>On Tue, 14 Apr 1998 09:35:36 +0200, N i c l a s O l o f s s o n
><gurun@acc.umu.se> uttered:
>
>>IMO the original poster committed a CGI/Perl question.
>
>No. It was a SSI/HTML-question. The answer,
><!--#exec cgi="myscript.pl" -->
>has not a single bit of Perl in it, other than possibly the file
>extension.

That may be true, but the poster can tell this only after the question has
been answered.
The orgininal poster did not know the answer and it is a very reasonable and
common request.
I say this because that is exactly the question and answer I have been
reading this newsgroup for.

Thanks to the person who answered it.

Dick Elkin




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

Date: Thu, 16 Apr 1998 02:10:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: jeff <jeff@extrapoint.com>
Subject: Re: Formatting script for Perl5...
Message-Id: <Pine.GSO.3.96.980415191002.14954A-100000@user2.teleport.com>

On Wed, 15 Apr 1998, jeff wrote:

> I saw once somewhere a script that would format a perl program. It
> would line up all of the braces, and "beutify" the whole program. Now
> I can't find it

I think the FAQ mentions this somewhere. I'd tell you where, but I'm sure
you'll find many other undiscovered gems in your search. :-)

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 15 Apr 1998 20:19:01 -0700
From: zeek@primenet.com (John Reynolds)
Subject: Has anyone tested 5.004_64 under FreeBSD?
Message-Id: <slrn6jatur.3s9.zeek@dolphin.primenet.com>

Question to some of the developers/porters working on 5.005. Have any of
you successfully done a "make test" when building 5.004_64 under
any version of FreeBSD?

I fetched the code the other night in an attempt to start playing with
the neat-o thread features and "make test" can't get past trying to
execute t/io/pipe.t

This test just "hangs there" ... doesn't dump core, just sits and chews
up CPU forever ... won't respond to ^C (only kill -9).

A buddy of mine config'ed and compiled under his Linux (latest dev 
kernel and GNU libc 2.0.7) and his "make test" went through no problem.

I'm trying to track this down to see if there's a problem with the
Perl sources under developement, or if the FreeBSD team needs to look
at things (kernel ... libc_r ... whatever).

I've been compiling this on FreeBSD 2.2.5 ... I haven't tried any other
version of FreeBSD simply because I don't have access to any other
versions.

If anyone out there has other compile stories for 5.004_64 please relate
them to me!!!

Thanks,

-Jr

ps: hoping to try the same under Slowlaris and HP-UX tomorrow (if it
compiles on those platforms with threads....)

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
John Reynolds               Four Guys' Plumbing -- South Chandler -- M.o.S.T.W.
jreynold@sedona.intel.com      SPG Central Logic Engineering, Intel Corporation
zeek@primenet.com                             My opinions are mine, not Intel's
http://www.primenet.com/~zeek/                   Running FreeBSD and loving it!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


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

Date: Thu, 16 Apr 1998 10:27:20 +0800
From: "Gilles L. Chong Hok Yuen" <glchy@csah.com>
Subject: Re: info on cookies
Message-Id: <35356C88.DA3F5236@csah.com>

Errrr ... hmmmmm
ok guys fanx for the response n concern shown. I just hope tt it will not
escalate into somefing other than a newsgroup response to a newbie.

Im sorry but i didnt get any mail n cannot read from the newsgroup the detailed
explanation n URLs cookie info by Lloyd Zusman. Can u pls resend them to me
and/or repost them in the newsgroup. Yesterday, our mailserver went down real
bad n i guess some mails got lost in the cyber black hole! The only messages in
my newsgroup are from (i)Tom Phoenix - Toyotas, SF (!) n (ii)Lloyd Zusman -
replying to Tom.

And this perhaps would help resolve my problem faster:
JAVASCRIPT on HTML
<SCRIPT>
document.cookie="testing2cookie"
alert(document.cookie)
</SCRIPT>

(Alert window echoes "testing2cookie", i.e cookie is generated n present)

In PERL SCRIPT
$cookieX = $ENV{'HTTP_COOKIE'};
print "<br><b>cookieX: $cookieX</b> \n";

(cookieX:      *just blank*)

And if i test it with those codes:
if(! defined $ENV{'HTTP_COOKIE'})
{print "<br>NO COOKIE<br> \n";}
('NO COOKIE' is printed out)

Even if i put the env var after the read command, nothing is printed out:

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

#Testing cookies
$cookie = $ENV{'HTTP_COOKIE'};
print "<br><blink>cookie: $cookie </blink><br> \n";

I.e the perl script is NOT able to get the cookie and read it!

Yeah, i fink tt if u email ur comments n suggestions to me (and post them in
the newsgrp), it would be better.

Fanx again guys

G.
--
Gilles Chong (glchy@csah.com, glchy@csa.com.sg)
Systems Engineer, Internet Division
CSA Holdings Ltd, Singapore.




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

Date: 16 Apr 1998 03:49:01 GMT
From: adams@well.com (Dave Adams)
Subject: Re: Lat/Long-Dist-Bearing Program?
Message-Id: <6h3v3d$efn$1@its.hooked.net>

> 
> In article <3532a597.29216544@news.zetnet.co.uk> you write:
> >On 11 Apr 1998 13:16:37 GMT, adams@well.com (Dave Adams) wrote:
> >
> >>Thanks to Seymour Dupa for supplying the formula for great-circle
> >>distance calculations.  I have implemented Sinnott's formula in my
> >>speadsheet program (Wingz), but how do I implement arcsin in perl
> >>which doesn't have this builtin function?  Is there a useful
> >>relationship between asin and atan, which the language does have?
> >
> >Surely asin and atan *are* arc-sine and arc-tangent functions?
> >They are in my C compiler library!
> >
> >Adrian
> >
> >WWW    WWW Adrian Gothard
> >WWW ww WWW White Horse Design
> >WWWWWWWWWW
> >WWWW  WWWW whd@zetnet.co.uk, http://www.users.zetnet.co.uk/whd
> >---
> >Designers of GPS-based satellite tracking systems
> 
> Sorry, I wasn't clear in my earlier post.  What I'm trying to do is implement
> a CGI binary in perl that will display a list of locations from a waypoint
> database that are within a specified distance of a given reference point.
> Although perl is the world's most practical extraction and reporting language,
> it's a little light on inverse trigonometric functions (it's implmented in C,
> but does not provide access to all C language primitives.)  Since I'm a
> better programmer than a mathematician, I was looking to this group for a
> possible relationship between atan, which the language does provide, and the
> required asin, which it does not.  As it turns out, I found the following
> approximation on the group comp.graphics.algorithms:
> 
> $asinx = (.00003796193943 + .9975723800 * $x
>        - 1.494983565 * $x**2 + .5106861809 * $x**3)
>        / ( 1.000000000 - 1.520086765 * $x + .4385318013 * $x**2
>        + .09022824392 * $x**3);
> 
> This method uses the Chebyshev-Pade approximation, which is much more accurate
> for my purposes than the Taylor expansion asin(x) = x+(x**3)/6+(x**5)/120*9.
> I also received some insight into calculating azimuths from the newsgroup
> sci.engr.surveying, but I haven't evaluated those suggestions yet.
> 

Thanks guys for the quick responses listed below.  It's the people in this
newsgroup that make it a great resource!

From: gbynum@nospamusa.net (George Bynum)
Subject: Re: Lat/Long-Dist-Bearing Program?
Date: Tue Apr 14 14:09:27 PDT 1998
> 
> I remember from doing thermocouple calculations that calculating those
> squares and cubes was slow, and expressing it differently helps there
> ...
> 
> with T=a0+a1x+a2x^2+a3x^3, you get the same thing, and it computes
> more quickly I'm told,
> 
> T=a0+x(a1+x(a2+a3x))
> 
> Good Luck!

From: DS <dsnwz@dscs.demon.co.uk>
Subject: Re: Lat/Long-Dist-Bearing Program?
Date: Tue Apr 14 14:24:27 PDT 1998
 
> Try:
> 
> Arcsin(X) = Atn(X / Sqr(-X * X + 1))
> 
> Source: MS VB4 Help file, Dervied Math Functions.
> 
> Hope it helps...
> 
> --
> 
> Dominic Sexton
> 

From: james kahelin <jkahelin@qualcomm.com>
Subject: i found asin - could you explain it? for perl 
Date: Wed, 15 Apr 1998 16:41:51 -0700 

> sub asin { return ($_[0]<-1 or $_[0]>1) ? undef :
> atan2($_[0],sqrt(1-$_[0]*$_[0])); }
>
>jk

By coincidence, while cleaning house last night, I happened to reach the
stratagraphic layer containing my old CRC Handbook of Standard Mathematical
Tables.  In the section showing the relationship between the inverse trig
functions, it lists asin x = atan(x/sqrt(1-x**2)), which is exactly the
formula suggested by James, and equivalent to the formula suggested by
Dominic.  Since perl does have atan, I've abandoned the approximation
methods in preference to the more exact form using atan presented here.
To compare the various methods:
----------------------------------------------------------------------
Chebyshev approximation:
X = 1, asin(X) = 1.50920131556, sin(asin(X)) = 0.998103626970551

Chebyshev-Pade approximation:
X = 1, asin(X) = 1.53493920428526, sin(asin(X)) = 0.999357202259294

Taylor expansion:
X = 1, asin(X) = 1.24166666666667, sin(asin(X)) = 0.946324012751072

Derivation from atan function:
X = 1, asin(X) = 1.5707963267949, sin(asin(X)) = 1
----------------------------------------------------------------------
Chebyshev approximation:
X = .5, asin(X) = 0.51862457451625, sin(asin(X)) = 0.495686047607398

Chebyshev-Pade approximation:
X = .5, asin(X) = 0.523498846764304, sin(asin(X)) = 0.499913456594891

Taylor expansion:
X = .5, asin(X) = 0.523177083333333, sin(asin(X)) = 0.499634759340693

Derivation from atan function:
X = .5, asin(X) = 0.523598775598299, sin(asin(X)) = 0.5
----------------------------------------------------------------------

The asin functions listed above using the atan primitive fail if x is
exactly one, which leads directly to a division by zero.  I've implemented
the function more generally as:

####**************************************************************
sub	asin {
	my $x = shift;
####**************************************************************
	if(abs($x) >= 1) {
		$x = $x/abs($x); }
	return 2*atan2($x, (1 + sqrt(1 - $x*$x)));
}

This function first grabs its parameter from the @_ array, then checks
to see if the argument's absolute value is greater than or equal to one.
If it is, the argument is reduced to either positive or negative one,
depending on its original sign.  The arcsin is then computed via perl's
atan2 function, which is of the form atan2(x,y) representing the arc
tangent of x/y.  The formula used above is equivalent to the functions
discussed previously and avoids the division by zero problem.  I've also
incorporated George's suggestion and used multiplication instead of
expotentiation, although that suggestion was oriented more towards the
more complicated expression used in the previous approximation method.

This function is just what I was looking for, and I wish to thank those
who responded.  When implemented in Sinnott's Formula for great-circle
distances, it's right on the money compared with the distances shown on
the GPS.  Differences of one degree at the equator are exactly 69.1105
statute miles apart, and distances of one minute are one nautical mile
(about 1.15 statue miles.)  It can even resolve distances of 0.1 seconds
(about ten feet, the maximum resolution recorded by the GPS,) whereas my
spreadsheet implementation returns an error if the distance is less than
about a full minute!

Perl also doesn't implement tan directly, so here's my impression of it:

####**************************************************************
sub	tan {
	my $x = shift;
####**************************************************************
	return ((sin($x))/(cos($x)));
}

I've always assumed that the missing functions were left out when Larry
Wall invented Perl (or when Perl invented Larry Wall, there's still some
theological debate amongst the desciples) were only left out because
they could be simulated if the application required, and so were not
worth adding to the size of the perl interpreter.  Now that I've sussed
it, I'm much happier.  

Sorry for the length of this post, but I'm intending this to be my last
word on the subject.  I'd also like to apologize to the original poster
for hijacking this thead, which was originally about finding DOS-based
lat/long-distance-bearing calculator type programs.  Since I work with
Unix computers during the day, and have Apple computers at home, the
only advice I can offer is, get perl!
--
Dave Adams        //dna//                                  adams@well.sf.ca.us
------------------------------------------------------------------------------
"The effort of using machines to mimic the human mind has always struck me as
rather silly. I would rather use them to mimic something better." 
--Edsger Dijkstra

DISCLAIMER: Beware of dog.



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

Date: Wed, 15 Apr 1998 23:36:39 -0400
From: "Scott" <sdh1@anchor.hotmail.com>
Subject: Re: Memory Leak?  Embedding into C
Message-Id: <6h3uhv$2ui$1@camel29.mindspring.com>


Ken Fox wrote in message <6h3bkb$jm33@eccws1.dearborn.ford.com>...
><sdh1@anchor.hotmail.com> writes (using a munged From: address ;):
>> I'm trying to embed the perl interpreter into C, but I'm running into
>> a major memory leak.
>>
>> ...
>>
>> int test(void)
>> {
>>   my_perl = perl_alloc();
>>   perl_construct(my_perl);
>>   perl_destruct(my_perl);
>>   perl_free(my_perl);
>> }
>>
>> it leaks like a sieve.
>
>I assume you are calling this in a loop.  The "normal" way to use
>embedded perl is to create one perl interpreter and then share it among
>all the places you need to.  In your case, it looks like you should
>change to something like:
>
>  PerlInterpreter *my_perl;
>
>  int test_initialize(void)
>  {
>    my_perl = perl_alloc();
>    perl_construct(my_perl);
>  }
>
>  int test_cleanup(void)
>  {
>    perl_destruct(my_perl);
>    perl_free(my_perl);
>  }
>
>  int test(void)
>  {
>  }
>
>There's a whole lot of other stuff (like error checking and calling
>perl_parse() etc.) that needs to be done, but I assume you already
>know that.
>
>BTW, I'm running 5.004_04 on SunOS 5.5.1 and if I do a tight loop
>of your original test() function it leaks like a sieve here too.  My
>perl doesn't use MULTIPLICITY -- that might make a difference.  Anybody
>know if the development track has this problem?
>
>- Ken
>
Well, the problem is that I'm using a mult-tasking interpreted environment
that
is built around a real time database.  Specifically, a product called
Monitrol that
is packaged and sold by Hilco Technologies in St. Louis that is a top end
SCADA/MMI system.  I just ask them, because I'd have to ask me (I work for
them).

The command interpreters (known as doprocs) do die when they aren't used for
a while, and I could set up a single command interpreter to handle perl, and
use
inter-process communication (message queues and so forth), but I'd rather
just
call a script from inside the process and keep things simple(r).

I would just think that a Perl_destruct would undo anything a Perl_construct
would do,
just as a common sense matter.  It sounds like Perl has a problem.






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

Date: Thu, 16 Apr 1998 02:31:17 GMT
From: Bill 'Sneex' Jones <sneaker@earthling.net>
Subject: Re: Perl 5.004_64 Slower???
Message-Id: <35356BE1.26152CA3@earthling.net>

This is a multi-part message in MIME format.
--------------04DABC9068F5BAB1FB4F5FFB
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Martien Verbruggen wrote:

> Doesn't the "usethreads=define" here mean that the binary was compiled
> for thread support? I haven't actually compiled this myself yet, but
> that's how I would read it.
>
> If the binary was indeed compiled with thread support, which looks
> like it, and without knowing anything about the program, which we
> don't, it seems fairly reasonable to assume that this perl binary
> seems slow, because of the thread support.

 And you are correct in saying that I compiled with thread support, because I
did.
I just finished compiling without thread support and the same code as posted
before
now runs in at under two seconds, whereas it took about 6-7 seconds before
(which seemed like 1 or 2 minutes...)

I think I will keep the 'without thread support' for now...

Thx,

Sneex :-)
__________________________
Bill Jones...............|
Sneaker's Nest...........|
Chasecreek Systemhouse...|



--------------04DABC9068F5BAB1FB4F5FFB
Content-Type: text/plain; charset=us-ascii; name="perl-V.NonThreaded"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="perl-V.NonThreaded"

Summary of my perl5 (5.0 patchlevel 4 subversion 64) configuration:
  Platform:
    osname=linux, osvers=2.0.31, archname=i586-linux
    uname='linux sneex 2.0.31 #1 sun nov 9 21:45:23 est 1997 i586 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.7.2.3
    cppflags='-Dbool=char -DHAS_BOOL'
    ccflags ='-Dbool=char -DHAS_BOOL'
    stdchar='char', d_stdstdio=define, usevfork=true
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Apr 15 1998 21:44:32
  @INC:
    /usr/lib/perl5/i586-linux/5.00464
    /usr/lib/perl5
    /usr/lib/perl5/site_perl/i586-linux
    /usr/lib/perl5/site_perl
    .

--------------04DABC9068F5BAB1FB4F5FFB--



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

Date: 16 Apr 1998 02:31:48 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl, warning message ??
Message-Id: <6h3qik$q4q$1@comdyn.comdyn.com.au>

In article <35355B3E.F661A3EF@gitnet.com>,
	webmaster <root@gitnet.com> writes:
> Hi,
> 
> I just installed perl 5.004 on my RH5.0 Linux box, but when I try to run
> some small perl script, it always shows this following message :
> 
>     perl: warning: Setting locale failed
>     perl: warning: Please check that your locale settings:
>                     LC_ALL = (unset),
>                     LANG = "EN"
>                 are supported and installed on your system.
>     perl: warning: Falling back to the standard locale ("C")
> 
> I'm newbie for linux stuff, so if somebody can help me what's wrong with
> it ??

Read the man page on locale settings for perl.

# man perllocale
or
# perldoc perllocale

Since you claim to be root@gitnet.com, I suppose you won't have any
trouble understanding any of it.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | The gene pool could use a little
Commercial Dynamics Pty. Ltd.       | chlorine.
NSW, Australia                      | 


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

Date: 16 Apr 1998 02:27:37 GMT
From: psf@euclid.jpl.nasa.gov (Peter J. Scott)
Subject: Regex problem: match maximal substring
Message-Id: <6h3qap$h7e@netline.jpl.nasa.gov>

It seemed like a simple problem at the time I thought of it:
given a string $s and some text $t, find the longest substring of $s
in $t.  But a simple solution eluded me.  After reading Jeffrey Friedl's
regex book (which I will reread as soon as my head stops spinning - if
anyone knows of medication which will cure the "asterisks flashing before
the eyes" syndrome, please advise), I crafted the below, which appears to
work but I would not want at this point to advertise it as a testimonial
to the book's powers :-)

If I'm missing something, please let me know.  It seems as though there
ought to be a far more elegant solution to this problem, with or without
regexes.  Herewith, a script which produces the results following,
when run with Perl 5.004_04 on Solaris 2.5.1:

chomp (my $s = <DATA>);  # String to find largest substring of ...
my @lines = map { chomp; $_ } <DATA>;  # ... in each of these strings
my @parts = map quotemeta $_, split //, $s;
my $m = pop (@parts) . "?";
$m = join ("(?:", @parts) . $m . ")?" x $#parts;
my $r = $m;
while ($m =~ /\(/) {
    $m =~ s/.*?\(\?:(.*)\).*/$1/;
$r .= "|$m";
}
print "Matching on $r\n";
foreach (@lines) {
  my $biggest = '';
  while (/($r)/og) {  
    $biggest = $1 if length($1) > length($biggest);
  }
  print "$_ : ", $biggest || "no match", "\n";
}
__END__
ABCDE
xABy
xBCy
xCDy
xDEy
xABCDEy
xACy
xBCyCDEz
xACDEyBCDAz
xyDz
xAyABzABC
xyABzw
xABCyDz
AxyBDwzC
xyzwx
AAAxBC
xACDwyBDzBCD

Matching on A(?:B(?:C(?:DE?)?)?)?|B(?:C(?:DE?)?)?|C(?:DE?)?|DE?
xABy : AB
xBCy : BC
xCDy : CD
xDEy : DE
xABCDEy : ABCDE
xACy : A
xBCyCDEz : CDE
xACDEyBCDAz : CDE
xyDz : D
xAyABzABC : ABC
xyABzw : AB
xABCyDz : ABC
AxyBDwzC : A
xyzwx : no match
AAAxBC : BC
xACDwyBDzBCD : BCD

(I know, it's a lot of test cases, but I kept finding expressions that
almost worked but broke on one of the above.)

-- 
This is news.  This is your      |  Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?   |  (psf@euclid.jpl.nasa.gov)

Disclaimer:  These comments are the personal opinions of the author, and 
have not been adopted, authorized, ratified, or approved by JPL.


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

Date: Wed, 15 Apr 1998 21:56:34 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: understanding Perl<->.html forms?
Message-Id: <6h3nmr$2ve@fridge.shore.net>

Dan Baker wrote in message <35354721.BC1@flash.net>...

>My impression was that if I use a POST action from an html form, it
>basically passes the variables and values to the designated program in a
>particular format...

That's the general idea. The devil's in the details. :-)

>assumtion that I cannot use some html like:
> <form method=POST action="file:/somelocalbin/someprog.pl">
> <input name=firstvar size=20>


Your browser can't run the program directly. The data has to be passed
through an intermediary. Usually, the web server program running on the host
machine handles this. For development, many people like to run a "local" web
server program on their own machine. Or, as someone has mentioned, there is
a Perl module with similar functionality.

For CGI reference material, check out O'Reilly's Perl site:

<URL: http://reference.perl.com/query.cgi?cgi >

HTH!

-grinch

-----
"Of course coffee doesn't make the world go around. It
just makes it go faster." - me

Sherm Pendley
grinch@whoville.com
http://www.whoville.com





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

Date: Wed, 15 Apr 1998 23:25:53 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: Weird Truncate Behavior
Message-Id: <35357A42.BB90CF45@coos.dartmouth.edu>

Art Cohen wrote:
> 
> I still can't figure out what the original problem was, but I found it
> works MUCH BETTER when I don't use the same token to represent two
> different handles! ;) (boy is my face red)

In that case, perhaps you were trying to truncate on a filehandle that you had
opened for read.  Could that be the problem?

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

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

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