[10373] in Perl-Users-Digest
Perl-Users Digest, Issue: 3967 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 13 19:07:21 1998
Date: Tue, 13 Oct 98 16:01:32 -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 Tue, 13 Oct 1998 Volume: 8 Number: 3967
Today's topics:
Re: perl scripts won't work: (RH5.1 Linux) "command not <rootbeer@teleport.com>
Redirecting stdout cause data lost <pfung@mipos2.intel.com>
Rounding in Perl brobinson1@my-dejanews.com
Re: Rounding in Perl <rootbeer@teleport.com>
Re: Rounding in Perl (Larry Rosler)
Re: sorting hack <dgris@perrin.dimensional.com>
Re: sorting hack (Abigail)
Re: sorting hack (Larry Rosler)
Text::Wrap adds extra space? <upsetter@ziplink.net>
UPDATE: CNET Builder.com Live! New Orleans '98 (CNET Builder.com Live!)
Re: which chars to escape in reg.exp? (Ilya Zakharevich)
Re: which chars to escape in reg.exp? (Ilya Zakharevich)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 13 Oct 1998 22:00:00 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: perl scripts won't work: (RH5.1 Linux) "command not found" plz help
Message-Id: <Pine.GSO.4.02A.9810131459140.1979-100000@user2.teleport.com>
On 13 Oct 1998, Mark den hartog wrote:
> problem: Perl-scripts won't work. The bash returns : "command not
> found".
Have you seen what perldiag says about this message? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 13 Oct 1998 15:45:28 -0700
From: "Poon Fung" <pfung@mipos2.intel.com>
Subject: Redirecting stdout cause data lost
Message-Id: <6vvthr$osi$1@scnews.sc.intel.com>
I have a Perl script that works fine if I print all output text to stdout.
It also works fine if I print it to a file. However, when I print the text
to stdout and direct the output to a file, I loss about 7 lines of text and
the last line in the file is incomplete.
Does anyone know what is the problem here? Is there any know work around?
Poon
pfung@scdt.intel.com
------------------------------
Date: Tue, 13 Oct 1998 21:45:40 GMT
From: brobinson1@my-dejanews.com
Subject: Rounding in Perl
Message-Id: <700hm4$ops$1@nnrp1.dejanews.com>
Hi,
I have checked the FAQs, and searched CPAN, even tried to do it myself and
almost succeeded with the exception of a couple of rare, odd results..
Does anybody know of a library or function that rounds numbers to a specified
number of decimal places?
Thanks in advance,
Bill Robinson
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 13 Oct 1998 22:26:07 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Rounding in Perl
Message-Id: <Pine.GSO.4.02A.9810131525480.1979-100000@user2.teleport.com>
On Tue, 13 Oct 1998 brobinson1@my-dejanews.com wrote:
> Subject: Rounding in Perl
> I have checked the FAQs,
Try again; section four. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 13 Oct 1998 15:30:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Rounding in Perl
Message-Id: <MPG.108d746bc7d5c44798980b@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <700hm4$ops$1@nnrp1.dejanews.com> on Tue, 13 Oct 1998 21:45:40
GMT, brobinson1@my-dejanews.com <brobinson1@my-dejanews.com> says...
> I have checked the FAQs, and searched CPAN, even tried to do it myself and
> almost succeeded with the exception of a couple of rare, odd results..
>
> Does anybody know of a library or function that rounds numbers to a specified
> number of decimal places?
Look harder, for example at perlfaq4:
"Does perl have a round function? ..."
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 13 Oct 1998 21:00:11 GMT
From: Daniel Grisinger <dgris@perrin.dimensional.com>
Subject: Re: sorting hack
Message-Id: <m3hfx8i3rl.fsf@perrin.dimensional.com>
lr@hpl.hp.com (Larry Rosler) writes:
> Sorry, you have missed the point completely.
Yup. My apologies.
> And I'm sorry for shouting, but ...
'Sokay, sometimes one must shout to be understood. :-)
dgris
--
Daniel Grisinger dgris@perrin.dimensional.com
`By about halfway through I was beginning to guess the
ending, but it still kind of surprised me.'
David Hatunen, talking about the movie Titanic
------------------------------
Date: 13 Oct 1998 21:49:06 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: sorting hack
Message-Id: <700hsi$gjr$1@client3.news.psi.net>
Larry Rosler (lr@hpl.hp.com) wrote on MDCCCLXIX September MCMXCIII in
<URL:news:MPG.108d3fe2ab939406989803@nntp.hpl.hp.com>:
++ [Posted to comp.lang.perl.misc and a copy mailed.]
++
++ In article <6vthdu$m3e$1@client3.news.psi.net> on 12 Oct 1998 18:22:54
++ GMT, Abigail <abigail@fnx.com> says...
++ >
++ > You will always have a loop in the comparison routine; either directly
++ > in your program, or somewhere behind the scenes.
++
++ "Always" is a rather strong statement. Below is the code I posted
++ yesterday, modified to deal with Xah's unreasonable requirement that the
++ input numbers (all non-negative integers) can be of arbitrary length. I
++ cannot find a loop in the comparison routine; either directly in my
++ program, or somewhere behind the scenes.
How do you think the cmp operator works? Magic? It *does* come down
to a character by character comparison.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Tue, 13 Oct 1998 15:24:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: sorting hack
Message-Id: <MPG.108d72e2fd91bf1b98980a@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <700hsi$gjr$1@client3.news.psi.net> on 13 Oct 1998 21:49:06
GMT, Abigail <abigail@fnx.com> says...
> Larry Rosler (lr@hpl.hp.com) wrote on MDCCCLXIX September MCMXCIII in
...
> ++ I cannot find a loop in the comparison routine; either directly in my
> ++ program, or somewhere behind the scenes.
>
> How do you think the cmp operator works? Magic? It *does* come down
> to a character by character comparison.
It works by calling the C library function memcmp, which may be
implemented in assembler to get at hardware that does a lot of parallel
comparisons. For long strings, even this will involve looping, of
course, but somewhere down in the silicon.
Essentially what you are saying is that, absent an infinitely parallel
computer, significant computation involves looping somewhere. Yes. But
this is not what you were addressing in your generalization about the
sort requested.
:-) (to keep the peace)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 13 Oct 1998 22:15:42 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Text::Wrap adds extra space?
Message-Id: <700jee$c98$1@kali.ziplink.net>
I've been playing around with Text::Wrap and observing some odd(?)
behavior. The docs make no mention of this, and DejaNews turns up nothing
either.
Is Text::Wrap supposed to add a space at the beginning of paragraphs?
Consider the following script:
#! /usr/local/bin/perl -w
use strict;
use Text::Wrap;
$Text::Wrap::columns = 70;
my @input;
push @input, 'This is my first line of text';
push @input, 'This is my second line of text. It is a little bit longer.';
push @input, 'This is my third line of text. It is short.';
push @input, 'This is my fourth line of text. It is extremely long. It is
the longest line I\'ve typed.';
#foreach (@input) {
# $_ .= "\n";
#}
#my $wrapped = wrap('','',@input);
my $wrapped = wrap('.','..',@input);
print $wrapped, "\n";
When this script is run, it produces the following output:
.This is my first line of text This is my second line of text. It is
..a little bit longer. This is my third line of text. It is short.
..This is my fourth line of text. It is extremely long. It is
..the longest line I've typed.
However, if I un-comment out the foreach loop (i.e. make each "line" in
@input newline-terminated), I get the following:
.This is my first line of text
.. This is my second line of text. It is a little bit longer.
.. This is my third line of text. It is short.
.. This is my fourth line of text. It is extremely long. It is
..the longest line I've typed.
Note the extra space before the start of the second and subsequent
paragraphs. Is this normal? BTW: This is perl, version 5.004_04 built for
i386-freebsd
TIA,
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: 13 Oct 1998 21:55:48 GMT
From: builderlive@cnet.com (CNET Builder.com Live!)
Subject: UPDATE: CNET Builder.com Live! New Orleans '98
Message-Id: <builderlive-1310981458030001@10.10.65.8>
CNET Builder.com, the site for site builders, is looking forward to a
spectacular conference for Web builders in December. There is a
tremendous amount of energy and excitement about New Orleans '98, and
based on early registrations we expect to sell out. So register now while
space is still available. If you register before October 23, you'll save
$200 off on-site registration.
Below you will find information regarding the most recent updates to the
conference. Complete information can always be found on the online
conference brochure at http://www.builder.com/live
We look forward to seeing in New Orleans in December.
____________________________
CONFERENCE UPDATE
CNET Builder.com Live! New Orleans '98
December 7-9
http://www.builder.com/live
* TUTORIALS
Tutorials are a great way to advance your skills on specific Web building
products and technologies. In-depth tutorials are being offered on Sunday
December 6 in the following areas:
* Allaire ColdFusion
* Adobe ImageReady
* ASP
* DHTML
* JavaScript
* Macromedia Dreamweaver
* NetObjects Fusion
* XML
Complete information and registration is now available. Visit the online
conference brochure at http://www.builder.com/live
* BRING YOUR BOSS
Does your company have a successful Internet strategy? Find out what it
takes in the Bring Your Boss conference-within-a-conference at CNET
Builder.com Live! Produced by the successful Internet strategy consultants
at Scient, http://www.scient.com, Bring Your Boss will cover:
* The 8 core approaches of e-business opportunities today
* The 10 most important technologies and technical issues your company
faces as you move into the Web and Internet space
* Security, transactions, and scalability, real- world problems and
solutions
* Case studies--success, failure, and TBD
Complete information and registration is now available. Visit the online
conference brochure at http://www.builder.com/live
* SAVE $200
The early bird registration rate expires October 23. Register now and pay
only $895, $200 off onsite registration. Complete information and
registration is now available. Visit the online conference brochure at
http://www.builder.com/live
------------------------------
Date: 13 Oct 1998 21:12:43 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: which chars to escape in reg.exp?
Message-Id: <700fob$ai3$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Randal Schwartz
<merlyn@stonehenge.com>],
who wrote in article <8caf30e0to.fsf@gadget.cscaper.com>:
> Ilya> Perl tries to be smart, and DWYM. In particular, you can never
> Ilya> predict how a complicated RE is going to be parsed, since perl
> Ilya> considers several different variants, and chooses one basing on
> Ilya> weights assigned by unintellegible algorithms.
>
> I bet there's at least *one* person on the planet who understands
> those algorithms. :)
I would not be so sure. Perl is a team work now, and carries all the
problems of such beasts. I remember people tinkering with this
weighting system trying to make it "more intuitive" - meaning less
predictable.
As somebody said in one of the first Perl discussions I have seen on
c.l.p (sic!) near '92, "I want intelligence from the patch program,
not from a compiler". Unfortunately, I've lost my archive of this
discussion, so cannot reproduce this in details. Anybody having this?
I would think it was circa v4.010, maybe v4.019.
Ilya
------------------------------
Date: 13 Oct 1998 21:15:41 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: which chars to escape in reg.exp?
Message-Id: <700ftt$amp$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Larry Wall
<larry@kiev.wall.org>],
who wrote in article <700cum$f0t@kiev.wall.org>:
> >Perl tries to be smart, and DWYM. In particular, you can never
> >predict how a complicated RE is going to be parsed, since perl
> >considers several different variants, and chooses one basing on
> >weights assigned by unintellegible algorithms.
>
> Now you're just jumping onto your own bandwagon. This has nothing to
> do with weighted dwimming, and nothing to do with regular expressions.
> @ will simply *never* interpolate an array named "[" anywhere, ever.
> In fact, the next character must be alphanumeric, unless you happen to
> be saying one of
>
> @::foo, @'foo, @{foo}, @$foo
>
> Please don't overstate your case--it prejudices me against it, and
> I don't like to be prejudiced. :-)
Hmm, I consider this as another argument in my favour! See, I've even
read the source. In fact many times. I've even patched some parts of
this source needed for a saner (?{ CODE }) in the REx engine.
Still, I have no slightest idea how this thing works. ;-)
Ilya
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3967
**************************************