[10341] in Perl-Users-Digest
Perl-Users Digest, Issue: 3934 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 9 04:07:50 1998
Date: Fri, 9 Oct 98 01:00:22 -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 Fri, 9 Oct 1998 Volume: 8 Number: 3934
Today's topics:
5.005_02 AnyDBM_File, NDBM_File fail tests, why? gaj@austaxprac.com.au
Re: [OT] London.pm (was "Many Jars" Mystery) <eashton@bbnplanet.com>
adding to the @INC at install time <jay@adei.com>
Re: Can I FORMAT variables to be a specific length? (Tad McClellan)
Re: Can I FORMAT variables to be a specific length? (Tad McClellan)
Re: Can't send mail via telnet programmatically <9631917@ml.petech.ac.za>
Re: Can't send mail via telnet programmatically <9631917@ml.petech.ac.za>
cgi perl for win32 script using OLE (on NES) nicolaslecart@my-dejanews.com
Curious perl -pe Question? liteindie@my-dejanews.com
Database Search Output >Help!! <sroque@man.amis.com>
Dynamic Trees in Perl <dottedquad@usa.net>
Re: Dynamic Trees in Perl (Mark-Jason Dominus)
Re: How to pass an array in AND out of a subroutine? stevenjm@olywa.net
Hrm. Linguistic Quandry <eashton@bbnplanet.com>
Re: Newbie - using variable for search or substitute op <rick.delaney@shaw.wave.ca>
Re: PERL, C++ Software Test Engineer-Chandler, AZ <ebohlman@netcom.com>
Re: Please help with time... (Martien Verbruggen)
posix test fails: Perl 5.005_02, MSWin32-x86 (Simon Taylor)
Re: print bug/feature? (Damian Conway)
Re: print bug/feature? (Damian Conway)
run a script Perl with a form isabellec@my-dejanews.com
Search and replace across multiple directories <kevscott_tx@yahoo.com>
Re: Search and replace across multiple directories (Ilya Zakharevich)
using cgi perl sctipt with OLE on NES3.5.1 nicolaslecart@my-dejanews.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 09 Oct 1998 06:45:44 GMT
From: gaj@austaxprac.com.au
Subject: 5.005_02 AnyDBM_File, NDBM_File fail tests, why?
Message-Id: <6vkbeo$8qh$1@nnrp1.dejanews.com>
It's a mystery why they fail on my RH 4.2 Linux system. (DB_File also fails.)
I can find ndbm.h and libndbm.so (which is linked to libdb.so).
ndbm doesn't appear to be part of standard RH Linux. I can only assume that
ndbm is part of the Berkeley DB 1.85 package. Even allowing for this why does
AnyDBM_File fail? Surely it would find gdbm (RH Linux standard) if it can't
find ndbm.
How do I make AnyDBM_File find gdbm so that I can ignore the Berkeley DB
package?
To add to the mystery 5.004_04 found ndbm with no problems and passed all
tests.
Any clues folks?
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 09 Oct 1998 04:35:49 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: [OT] London.pm (was "Many Jars" Mystery)
Message-Id: <361D902A.BC26925@bbnplanet.com>
Jonathan Stowe wrote:
> >> The Cittie of Yorke on High Holborn. Sam Smiths Old Brewery Bitter at #1.50 a
> >> pint.
Ah, High Holborn. Lovely place. I used to live in Chelsea. Miss the beer
and the civilisation.
> >> London.pm meetings are on the first Thursday of the month and have so far all
> >> been held at the same pub. All visiting Perl Mongers will be made very welcome
> >> (ask Chris Masto).
I still have my passport and may just get a jag to come and visit. :)
> > How does one recognise london.pm ? By the badges or by the
> > conversation topics ?
If you cannot listen you must feel. Pay attention. If you are listening
you can always tell those who are of you.
e.
But my mind was unclear and shaky. Nothing
was happening. Everything was happening. Life
was a stone, grinding and sharpening. - R. Carver -
------------------------------
Date: Thu, 8 Oct 1998 22:51:12 -0700
From: "Jay Di Silvestri" <jay@adei.com>
Subject: adding to the @INC at install time
Message-Id: <6vk88c$qa3$1@ultra.sonic.net>
How do I add to perl's *default* @INC path, I'll reinstall if I need to . .
.
I'm looking for a solution that does not require visiting any of the
individual scripts and unshifting the array myself.
--Jay
------------------------------
Date: Thu, 8 Oct 1998 22:50:42 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Can I FORMAT variables to be a specific length?
Message-Id: <i61kv6.prh.ln@flash.net>
Guy Doucet (gdoucet@ait.acl.ca) wrote:
: I am receiving data from users. I need to format that data to a certain
: length. Is there a quick function. The only thing I know is this:
: do {$i=$i . " ";}until length($i) = max ;
^^^^^
Please don't post pseudo code without saying that it is pseudo...
$i .= ' ' x ($max - length $i);
or
$i = sprintf "%-20s", $i;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 8 Oct 1998 23:34:29 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Can I FORMAT variables to be a specific length?
Message-Id: <lo3kv6.42i.ln@flash.net>
Tad McClellan (tadmc@flash.net) wrote:
: Guy Doucet (gdoucet@ait.acl.ca) wrote:
: : I am receiving data from users. I need to format that data to a certain
: : length. Is there a quick function. The only thing I know is this:
: : do {$i=$i . " ";}until length($i) = max ;
: $i .= ' ' x ($max - length $i);
: or
: $i = sprintf "%-20s", $i;
Uhh... that should have been:
$i = sprintf "%-${max}s", $i;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 09 Oct 1998 08:48:44 +0200
From: Ayanda Mabombo <9631917@ml.petech.ac.za>
To: "John W. Fierke" <John.Fierke@Avnet.com>
Subject: Re: Can't send mail via telnet programmatically
Message-Id: <361DB1CB.F1364C0C@ml.petech.ac.za>
There might be a very basic SMPT command error. Here. The first command
sent in an SMTP connection, as soon as the connect is made, is not MAIL FROM:
but HELO hostname.com.
Some servers are okay with this, but your server is Micro$oft and might be a
stickler
for accurate SMTP. However I do agree with the other responses that telnet is
not
the best way to do things like this.
Bruce Smith
John W. Fierke wrote:
> I'm putting together some error-checking Unix scripts on a DEC-Alpha
> machine for our EDI group. Now that we have moved to MS Exchange/
> Outlook, they aren't having any luck sending mail from the Unix box.
>
> I'd like to use 'telnet [mailserver] 25', along with the proper mail
> syntax, to notify the EDI team with email messages and/or paging them via
>
> email....but it looks like I've got a problem when it comes to trying to
> send the mail commands once I've initiated the telnet!!
>
> Anybody know how to get this done? I'm writing the script in perl and
> it's fairly straight-forward :
>
> $sender="Fred.Flinstone@stone.com";
> $recipient="George.Jetson@space.com";
> open(MAIL, "| telnet dev.mail.com 25")
> || die "\nERROR - Unable to open Mail process, stopped";
> # sleep 60; # had been sleeping long enough for the server to
> # # respond
> print MAIL "mail from: $sender\n";
> print MAIL "rcpt to: $sender\n";
> print MAIL "data\n";
> print MAIL "from: $sender\n";
> print MAIL "to: $recipient\n";
> print MAIL "subject: $subject\n";
> print MAIL "$message\n";
> print MAIL ".\n";
> close(MAIL);
>
> also, all that exists is the perl binary which is 5.004_01. How much
> trouble would it be to replace that with a FULLY EQUIPPED version of perl
> (compiled with all its features)? Currently it's size is 942,080...how
> much space would I need to have? I'm just thinking that I won't be able
> to copy the Net::SMTP module and its constituants onto the box and 'use'
> them, without recompiling. OK...I just DON'T KNOW! This isn't really my
> machine to 'experiment' with.
>
> thx,
> John Fierke
>
> Anyone Without a Sense of Humor
> is at the Mercy of the Rest of Us!
> ================================================================
> | John Fierke 11333 Pagemill Road |
> | Programmer Analyst Dallas, TX 75243 |
> | Open Systems Development (V)214.553.4086 |
> | (P)214.581.1564 |
> | John.Fierke@Avnet.com (F)214.553.4004 |
> ================================================================
------------------------------
Date: Fri, 09 Oct 1998 08:49:20 +0200
From: Ayanda Mabombo <9631917@ml.petech.ac.za>
To: "John W. Fierke" <John.Fierke@Avnet.com>
Subject: Re: Can't send mail via telnet programmatically
Message-Id: <361DB1F0.9AFE8CD9@ml.petech.ac.za>
There might be a very basic SMPT command error. Here. The first command
sent in an SMTP connection, as soon as the connect is made, is not MAIL FROM:
but HELO hostname.com.
Some servers are okay with this, but your server is Micro$oft and might be a
stickler
for accurate SMTP. However I do agree with the other responses that telnet is
not
the best way to do things like this.
Bruce Smith
John W. Fierke wrote:
> I'm putting together some error-checking Unix scripts on a DEC-Alpha
> machine for our EDI group. Now that we have moved to MS Exchange/
> Outlook, they aren't having any luck sending mail from the Unix box.
>
> I'd like to use 'telnet [mailserver] 25', along with the proper mail
> syntax, to notify the EDI team with email messages and/or paging them via
>
> email....but it looks like I've got a problem when it comes to trying to
> send the mail commands once I've initiated the telnet!!
>
> Anybody know how to get this done? I'm writing the script in perl and
> it's fairly straight-forward :
>
> $sender="Fred.Flinstone@stone.com";
> $recipient="George.Jetson@space.com";
> open(MAIL, "| telnet dev.mail.com 25")
> || die "\nERROR - Unable to open Mail process, stopped";
> # sleep 60; # had been sleeping long enough for the server to
> # # respond
> print MAIL "mail from: $sender\n";
> print MAIL "rcpt to: $sender\n";
> print MAIL "data\n";
> print MAIL "from: $sender\n";
> print MAIL "to: $recipient\n";
> print MAIL "subject: $subject\n";
> print MAIL "$message\n";
> print MAIL ".\n";
> close(MAIL);
>
> also, all that exists is the perl binary which is 5.004_01. How much
> trouble would it be to replace that with a FULLY EQUIPPED version of perl
> (compiled with all its features)? Currently it's size is 942,080...how
> much space would I need to have? I'm just thinking that I won't be able
> to copy the Net::SMTP module and its constituants onto the box and 'use'
> them, without recompiling. OK...I just DON'T KNOW! This isn't really my
> machine to 'experiment' with.
>
> thx,
> John Fierke
>
> Anyone Without a Sense of Humor
> is at the Mercy of the Rest of Us!
> ================================================================
> | John Fierke 11333 Pagemill Road |
> | Programmer Analyst Dallas, TX 75243 |
> | Open Systems Development (V)214.553.4086 |
> | (P)214.581.1564 |
> | John.Fierke@Avnet.com (F)214.553.4004 |
> ================================================================
------------------------------
Date: Fri, 09 Oct 1998 07:22:13 GMT
From: nicolaslecart@my-dejanews.com
Subject: cgi perl for win32 script using OLE (on NES)
Message-Id: <6vkdj4$b8l$1@nnrp1.dejanews.com>
Hello
I've got some problems with perl5 for win32 in a cgi script using OLE.
I'm working on Windows NT4.0 with Netscape Enterprise Server 3.5.1
When i try the following cgi script via Netcape Communicator,
it works very well :
print <<EOF;
Content-type: text/html
<HTML>
<HEAD>
<TITLE> Hello World </TITLE>
</HEAD>
<BODY>
Hello World <BR>
Voici les informations essentielles <BR>
AUTH_PASS: $ENV{'AUTH_PASS'}
<br>CONTENT_LENGTH: $ENV{'CONTENT_LENGTH'}
<br>PATH_INFO: $ENV{'PATH_INFO'}
<br>PATH_TRANSLATED: $ENV{'PATH_TRANSLATED'}
<br>QUERY_STRING: $ENV{'QUERY_STRING'}
<br>REMOTE_ADDR: $ENV{'REMOTE_ADDR'}
<br>REMOTE_HOST: $ENV{'REMOTE_HOST'}
<br>REMOTE_USER: $ENV{'REMOTE_USER'}
<br>REQUEST_METHOD: $ENV{'REQUEST_METHOD'}
<br>SCRIPT_NAME: $ENV{'SCRIPT_NAME'}
<br>SERVER_NAME: $ENV{'SERVER_NAME'}
<br>SERVER_PORT: $ENV{'SERVER_PORT'}
<br>SERVER_PROTOCOL: $ENV{'SERVER_PROTOCOL'}
<br>SERVER_SOFTWARE: $ENV{'SERVER_SOFTWARE'}
</BODY>
</HTML>
EOF
;
so i think that my web server manages to execute cgi script !
but if i try the next cgi script :
use OLE;
$excel=CreateObject OLE 'Excel.Application.8'
or warn "Couldn't create new instance of Excel App!!";
$excel->Workbooks->Open( 'c:\\perl\\test.xls' ) or warn "Couldn't open file";
print "AUTEUR " , $excel->Workbooks(1)->Author;
print <BR>;
print "TITRE " , $excel->Workbooks(1)->Title;
print <BR>;
print "SUJET " , $excel->Workbooks(1)->Subject;
$excel->Workbooks->Close() or warn "impossible fermer";
$excel->Quit();
there is a server error :
"failure: for host 192.27.3.133 trying to POST /shell-cgi/excel1.pl
cgi-parse-output reports: the CGI program C:\PERL\Perl.exe did not
produce a valid header (program terminated without a valid CGI header
(check for core dump or other abnormal termination) "
Even if this script works very well when i execute it in a DOS window taping
"perl excel1.pl"
I really don't know where i'm wrong :-((((
Thanks very much for anyone who can help me
Regards, Nicolas LECART
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 09 Oct 1998 06:18:19 GMT
From: liteindie@my-dejanews.com
Subject: Curious perl -pe Question?
Message-Id: <6vk9ra$6tk$1@nnrp1.dejanews.com>
Hi y'all,
I am pondering over the mechanics of the -p and -n switches. After executing
the following:
perl -pe '$a=<STDIN>;print (a);'
I type in:
hello
there
and it produces:
hello
there
there
Control D to end it
Ain't the -p and -n switch suppose to put a enclose the statements in a loop?
The printing order is confusing me
Thanx you for some enlightenment
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 9 Oct 1998 04:04:43 GMT
From: "AMIP" <sroque@man.amis.com>
Subject: Database Search Output >Help!!
Message-Id: <01bdf339$42dc2110$2bbe10ac@amipnet>
How can include my four variables (or fields) inside the <pre></pre> tags?
------------------------------
Date: Thu, 8 Oct 1998 22:00:53 -0600
From: "John Broadhead" <dottedquad@usa.net>
Subject: Dynamic Trees in Perl
Message-Id: <6vk1qd$5$1@news.xmission.com>
I need to make a Dynamically growing tree in perl. Fist I thought I would
make a node object with a data field and an array of references to Other
node objects, but I haven't been able to find much on how to do something
like this. The explaination in the camel book about references is pretty
vague and doesn't have much in the way of examples. It's also important
that there be an arbitrary number of branches, hence the array of
references.
If anyone could point me to an example of a dynamically growing tree
implementation in perl, I'd much appreciate it.
-John Broadhead
------------------------------
Date: 9 Oct 1998 00:16:46 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Dynamic Trees in Perl
Message-Id: <6vk2ne$4ag$1@monet.op.net>
In article <6vk1qd$5$1@news.xmission.com>,
John Broadhead <dottedquad@usa.net> wrote:
>I need to make a Dynamically growing tree in perl.
Probably not.
>If anyone could point me to an example of a dynamically growing tree
>implementation in perl, I'd much appreciate it.
http://www.plover.com/~mjd/perl/#tpj-wi97
If your real problem is that you don't understand references, you
might want to see
http://www.plover.com/~mjd/perl/FAQs/References.html
------------------------------
Date: Fri, 09 Oct 1998 04:14:39 GMT
From: stevenjm@olywa.net
Subject: Re: How to pass an array in AND out of a subroutine?
Message-Id: <6vk2jf$tsm$1@nnrp1.dejanews.com>
In article <6vd3oo$f7g$1@nnrp1.dejanews.com>,
huntersean@hotmail.com wrote:
> Use a reference if you want to modify items in place. Something like
>
<BIG SNIP>
>
> In article <19981006011956.01129.00001070@ng137.aol.com>,
> tianxiong@aol.com (Tianxiong) wrote:
> >
> > For example, I want to read data from two data files using a subroutine. If
> > there are 5 and 10 items in those two files, and I would expect that
> $num_items
> > = 15 and @items contains 15 items after the folling routine is executed. I
> > know how to do it in C but not in perl. Thanks in advance for your help.
> >
> > ############
> > $num_items = 0;
> > &read_data ($file1, $num_items, @items);
> > print "num_items = ",$num_items, "\n";
> > &read_data ($file2, $num_items, @items);
> > print "num_items = ",$num_items, "\n";
> >
> > sub read_data{
> > # ???? how ????
> > }
> >
> > ###########
> >
Or... (TMTOWTDI)
############
# I sort of like the hungarian notation myself
# I wonder if the real issue isn't scoping???
local($ra_items); # local so we don't have to pass it.
# not a brilliant idea sometimes, but...
my($num_items);
&read_data($file1);
$num_items = scalar @$ra_items;
print "num_items = $num_items\n";
&read_data ($file2);
$num_items = scalar @$ra_items;
print "num_items = $num_items\n";
##############
sub read_data{
my($file) = @_;
open(FILE, $file) or die "Can't open $file, $!\n";
while(<FILE>){push(@$ra_items, $_} # might want to chomp?
close FILE
}
##########
To access elements of the reference $ra_list, you just do something like
$element = $ra->[1];
or
my($ct) = '0';
foreach(@$ra){
print "This is element $ct, $_\n";
$ct++;
}
or whatever. Haven't tested this as a whole, but, unless I've typoed
something it should work. And if you have blank lines, things could get out
of shape, but again...
Steve
blackwater-pacific.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 09 Oct 1998 04:16:37 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Hrm. Linguistic Quandry
Message-Id: <361D8BAA.6DBE307B@bbnplanet.com>
Since the word 'troll' came up recently I did a little etymological
digging and I find myself wondering about it. To troll is fishing
casually on a long line. To trawl is to fish the bottom. I'm wondering
if 'troll' is the proper term. Being that I live in a largely seaside
community the difference is distinct. Perhaps to 'trowel' is the most a
propos term. To dig and not to fish. What say you boys?
e.
But my mind was unclear and shaky. Nothing
was happening. Everything was happening. Life
was a stone, grinding and sharpening. - R. Carver -
------------------------------
Date: Fri, 09 Oct 1998 04:12:10 GMT
From: Rick Delaney <rick.delaney@shaw.wave.ca>
Subject: Re: Newbie - using variable for search or substitute option
Message-Id: <361D8EA0.41F33B89@shaw.wave.ca>
Ronald J Kimball wrote:
>
> Rick Delaney <rick.delaney@shaw.wave.ca> wrote:
>
> > In particular, look for (?imsx). So things like
> >
> > s/search/replace/i;
> >
> > are the same as
> >
> > s/(?i)search/replace/;
> >
> > It's not going to work with /g though.
>
> Really? I must have gotten lucky, then.
>
[snip example showing how wrong I am]
>
> This is perl5.004. Oddly, (?g) is not documented with (?ismx).
You know, I tried it too even though it's not documented. Unfortunately
I just replaced 'i' with 'g' in my above example to get
s/(?g)search/replace/;
My test string was 'SEARCH'. Ugh!
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Fri, 9 Oct 1998 07:07:49 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: PERL, C++ Software Test Engineer-Chandler, AZ
Message-Id: <ebohlmanF0Jt51.6o1@netcom.com>
pramsey@iname.com wrote:
: On Thu, 08 Oct 1998 16:03:02 GMT, droby@copyright.com wrote:
: >This is not a job posting newsgroup.
: Says who, and since when? And who appointed you the enforcer?
The reason the majority of regular posters don't want job offers posted
here is that recruiters have been empirically observed to compete with
each other over how many ads they can post to a group. The *.jobs groups
are essentially multiple dumps of recruiters' databases. The traffic
generated by job ads could very easily drown everything else out. Even
if all the ads were properly labelled for kill-filing, most readers would
have to junk the majority of posts.
------------------------------
Date: Fri, 09 Oct 1998 04:13:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Please help with time...
Message-Id: <Q3gT1.3984$tC2.249132@nsw.nnrp.telstra.net>
In article <361D88B9.D0DD494B@att.net>,
Bernie <bfb@att.net> writes:
> I have to add many time values together in
> a format like 00:01:23
>
> What's the easiest way to accomplish this?
This is hours minutes seconds?
One way:
Convert all three to seconds, add, and
convert back. Use split to split the three values, multiply the first
and second by 3600 and 60 respectively, etc.
Another way:
Start by adding the last ones, use % and ? to figure out how many
minutes and seconds that is, carry over the minutes to the sum of all
the fields in the middle, etc.
I'd probably use the first.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
Date: Fri, 09 Oct 1998 05:04:20 GMT
From: sztaylor@alaska.net (Simon Taylor)
Subject: posix test fails: Perl 5.005_02, MSWin32-x86
Message-Id: <361d92b7.45005905@news.alaska.net>
Hello,
I'd REALLY appreciate any insight folks might have on this one.
Test #2 in the posix.t test-suite of perl 5.005_02, MSWin32-x86 build
fails on some win32 machines and not others. The problem seems to be
with line 22:
read($testfd, $buffer, 9)
this reads the first 9 bytes of "posix.t", which are: "#!./perl\n"
When it fails, instead of reading the tailing "\n" it seems to chop it
off, and only returns 8 bytes. See code slice below.
To make matters more confusing the machine that passes this test
correctly fails one of the "op\stat.t" tests, while the machine that
passes all op\stat.t tests fails the posix.t test above. I haven't
had time to look at the stat.t test and figure out what's happening
there, but any ideas on that would be appreciated also.
from posix.t (starting on line 21)
<snip>
$testfd = open("TEST", O_RDONLY, 0) and print "ok 1\n";
$bytes = read($testfd, $buffer, 9) if $testfd > 2;
print (($buffer eq "#!./perl\n") ? "ok 2\n" : "not ok 2\n");
<snip>
------------------------------
Date: 9 Oct 1998 06:20:46 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: print bug/feature?
Message-Id: <6vk9vu$jck$1@towncrier.cc.monash.edu.au>
lr@hpl.hp.com (Larry Rosler) writes:
>The answer lies in the IEEE 754 standard. I can't find it on the Web
>(copyrighted material?) and I can't locate my copy, so I'll have to wing
>it.
>To avoid upward bias in always rounding to the next higher value a number
>whose value is "exactly" 0.5 in the position to be rounded, the
>implementation is expected to do such rounding upward or downward "at
>random".
^^^^^^
I was always under the impression that rounding of "half" values under 754
was to the nearest even integer.
Hmmmm....
% perl -e 'foreach (-2000..2000) { printf "%.0f ", $_-0.5 }'
-2000 -2000 -1998 -1998 -1996 -1996 -1994 -1994 -1992 -1992 -1990 -1990
[SNIP]
-10 -10 -8 -8 -6 -6 -4 -4 -2 -2 0 0 2 2 4 4 6 6 8 8 10 10
[SNIP]
1990 1990 1992 1992 1994 1994 1996 1996 1998 1998 2000 2000
Well, that's good enough for this engineer ;-)
Damian
------------------------------
Date: 9 Oct 1998 06:30:27 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: print bug/feature?
Message-Id: <6vkai3$cv6$1@towncrier.cc.monash.edu.au>
I wrote:
> % perl -e 'foreach (-2000..2000) { printf "%.0f ", $_-0.5 }'
> -2000 -2000 -1998 -1998 -1996 -1996 -1994 -1994 -1992 -1992 -1990 -1990
> [SNIP]
> -10 -10 -8 -8 -6 -6 -4 -4 -2 -2 0 0 2 2 4 4 6 6 8 8 10 10
> [SNIP]
> 1990 1990 1992 1992 1994 1994 1996 1996 1998 1998 2000 2000
Only one 2000, dammit!
Remember friends, careless cut-and-pastes cost credibility!
Or perhaps it was a pre-emptive strike by the millenium bug?
Damian
------------------------------
Date: Fri, 09 Oct 1998 07:37:06 GMT
From: isabellec@my-dejanews.com
Subject: run a script Perl with a form
Message-Id: <6vkef3$d5c$1@nnrp1.dejanews.com>
Hello,
I want to run a script Perl (which is in the cgi-bin repertory) from a form.
If it works, I will have some results to be written in a hidden file. But I
have an Internal error of misconfiguration. Maybe some access rights are not
good.
Can someone tell me the steps I have to follow to run my program ?
Thanks
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 09 Oct 1998 05:08:20 +0000
From: kevin scott <kevscott_tx@yahoo.com>
Subject: Search and replace across multiple directories
Message-Id: <361D9A44.F5F2153F@yahoo.com>
I manage a 600 + page web site. I am look for a PERL program that can
search for a text string and replace it with another. In addition,
it would like to be able to do this in multiple files and directories.
Has anyone see any code that can do this ?
Thanks,
------------------------------
Date: 9 Oct 1998 05:28:43 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Search and replace across multiple directories
Message-Id: <6vk6ub$do5$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to kevin scott
<kevscott_tx@yahoo.com>],
who wrote in article <361D9A44.F5F2153F@yahoo.com>:
> I manage a 600 + page web site. I am look for a PERL program that can
> search for a text string and replace it with another. In addition,
> it would like to be able to do this in multiple files and directories.
>
> Has anyone see any code that can do this ?
pfind can do it. It is on $CPAN/id/ILYAZ/scripts/.
Ilya
------------------------------
Date: Fri, 09 Oct 1998 07:17:52 GMT
From: nicolaslecart@my-dejanews.com
Subject: using cgi perl sctipt with OLE on NES3.5.1
Message-Id: <6vkdb0$b32$1@nnrp1.dejanews.com>
Hello
I've got some problems with perl5 for win32 in a cgi script using OLE.
I'm working on Windows NT4.0 with Netscape Enterprise Server 3.5.1
When i try the following cgi script via Netcape Communicator, it works very
well :
print <<EOF;
Content-type: text/html
<HTML>
<HEAD>
<TITLE> Hello World </TITLE>
</HEAD>
<BODY>
Hello World <BR>
Voici les informations essentielles <BR>
AUTH_PASS: $ENV{'AUTH_PASS'}
<br>CONTENT_LENGTH: $ENV{'CONTENT_LENGTH'}
<br>PATH_INFO: $ENV{'PATH_INFO'}
<br>PATH_TRANSLATED: $ENV{'PATH_TRANSLATED'}
<br>QUERY_STRING: $ENV{'QUERY_STRING'}
<br>REMOTE_ADDR: $ENV{'REMOTE_ADDR'}
<br>REMOTE_HOST: $ENV{'REMOTE_HOST'}
<br>REMOTE_USER: $ENV{'REMOTE_USER'}
<br>REQUEST_METHOD: $ENV{'REQUEST_METHOD'}
<br>SCRIPT_NAME: $ENV{'SCRIPT_NAME'}
<br>SERVER_NAME: $ENV{'SERVER_NAME'}
<br>SERVER_PORT: $ENV{'SERVER_PORT'}
<br>SERVER_PROTOCOL: $ENV{'SERVER_PROTOCOL'}
<br>SERVER_SOFTWARE: $ENV{'SERVER_SOFTWARE'}
</BODY>
</HTML>
EOF
;
so i think that my web server manages to execute cgi script !
but if i try the next cgi script :
use OLE;
$excel=CreateObject OLE 'Excel.Application.8' or warn "Couldn't create new
instance of Excel App!!";
$excel->Workbooks->Open( 'c:\\perl\\test.xls' ) or warn "Couldn't open file";
print "AUTEUR " , $excel->Workbooks(1)->Author;
print <BR>;
print "TITRE " , $excel->Workbooks(1)->Title;
print <BR>;
print "SUJET " , $excel->Workbooks(1)->Subject;
$excel->Workbooks->Close() or warn "impossible fermer";
$excel->Quit();
there is a server error : "failure: for host 192.27.3.133 trying to POST
/shell-cgi/excel1.pl cgi-parse-output reports: the CGI program
C:\PERL\Perl.exe did not produce a valid header (program terminated without
a valid CGI header (check for core dump or other abnormal termination) "
Even if this script works very well when i execute it in a DOS window : "perl
excel1.pl"
I really don't know where i'm wrong :-((((
Thanks very much for anyone who can help me
Regards, Nicolas LECART
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
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 3934
**************************************