[18855] in Perl-Users-Digest
Perl-Users Digest, Issue: 1023 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 30 21:05:50 2001
Date: Wed, 30 May 2001 18:05:14 -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: <991271113-v10-i1023@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 30 May 2001 Volume: 10 Number: 1023
Today's topics:
[ANNOUNCE] Attribute::Overload 0.02 <marcel@codewerk.com>
[ANNOUNCE] Attribute::Util 0.02 <marcel@codewerk.com>
Re: Analyzing biometrics (was Re: Req. for help: need b <goldbb2@earthlink.net>
Built in functions to format ISO Date YYYYMMDD. (James)
Re: Built in functions to format ISO Date YYYYMMDD. (Damian James)
Re: Can't Compile 5.6.1 on AIX <ilya@math.ohio-state.edu>
Re: Can't get size value back when using $ftp->size <jdrumm@blazenetme.net>
Re: Controlling downloads using CGI and Apache (Dave)
Re: Controlling downloads using CGI and Apache (Dave)
Re: Frustrated people (not) answering questions (Michael D. Risser)
Re: Frustrated people (not) answering questions <godzilla@stomp.stomp.tokyo>
Re: Frustrated people (not) answering questions <senile_rabbi@hotmail.spam.com>
Re: How to match and print like this ??? <krahnj@acm.org>
Re: OT: killfiles (was: Re: Perl Community Stars (?)) (Damian James)
Re: OT: killfiles (was: Re: Perl Community Stars (?)) <godzilla@stomp.stomp.tokyo>
Re: Perl Community Stars (?) (Abigail)
Re: Perl Community Stars (?) <buggs@geekmail.de>
Pod::Tree 1.07 (Steven W McDougall)
Pod::Tree 1.08 (Steven W McDougall)
printf/sprintf round problem? <rnb@aecom.yu.edu>
Re: printf/sprintf round problem? <addi@umich.edu>
Re: printf/sprintf round problem? (Jay Tilton)
Re: Reading binary data (method and style)? <mitia.nospam@northwestern.edu.invalid>
Re: Reading binary data (method and style)? <ilya@math.ohio-state.edu>
Server push and $|? <bcoon@sequenom.com>
Re: Silly pipe() question <goldbb2@earthlink.net>
Re: Unsure about headers <"relaxedrob@optushome.com.au">
Re: Unsure about headers <"relaxedrob@optushome.com.au">
Re: Unsure about headers (Sam Holden)
Re: Unsure about headers <"relaxedrob@optushome.com.au">
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 May 2001 21:27:34 GMT
From: Marcel Grunauer <marcel@codewerk.com>
Subject: [ANNOUNCE] Attribute::Overload 0.02
Message-Id: <thatrgkns3umbd@corp.supernews.com>
NAME
Attribute::Overload - Attribute that makes overloading easier
SYNOPSIS
use Attribute::Overload;
sub add : Overload(+) { ... }
DESCRIPTION
The `Overload' attribute, when used on a subroutine, declares that
subroutine as handler in the current package for the operation(s)
indicated by the attribute options. Thus it frees you from the
implementation details of how to declare overloads and keeps the
definitions where they belong, with the operation handlers.
For details of which operations can be overloaded and what the
overloading function gets passed see the `overload' manpage.
Note that you can't overload constants this way, since this has to
happen during BEGIN time, but attributes are only evaluated at CHECK
time (at least as far as `Attribute::Handlers' is concerned).
BUGS
None known so far. If you find any bugs or oddities, please do inform
the author.
AUTHOR
Marcel Grunauer, <marcel@codewerk.com>
COPYRIGHT
Copyright 2001 Marcel Grunauer. All rights reserved.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
SEE ALSO
perl(1), overload(3pm), Attribute::Handlers(3pm).
Marcel
--
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
-- London.pm strategy aka "embrace and extend" aka "mark and sweep"
------------------------------
Date: 30 May 2001 20:52:17 GMT
From: Marcel Grunauer <marcel@codewerk.com>
Subject: [ANNOUNCE] Attribute::Util 0.02
Message-Id: <thatr4qkctcbb3@corp.supernews.com>
NAME
Attribute::Util - A selection of general-utility attributes
SYNOPSIS
use Attribute::Util;
# Alias
sub color : Alias(colour) { return 'red' }
# Abstract
package MyObj;
sub new { ... }
sub somesub: Abstract;
package MyObj::Better;
use base 'MyObj';
sub somesub { return "I'm implemented!" }
# Memoize
sub fib :Memoize {
my $n = shift;
return $n if $n < 2;
fib($n-1) + fib($n-2);
}
$|++;
print fib($_),"\n" for 1..50;
# SigHandler
sub myalrm : SigHandler(ALRM, VTALRM) { ... }
sub mywarn : SigHandler(__WARN__) { ... }
DESCRIPTION
This module provides four universally accessible attributes of general
interest:
Memoize
This attribute makes it slightly easier (and modern) to memoize a
function by providing an attribute, `:Memoize' that makes it
unnecessary for you to explicitly call `Memoize::memoize()'. Options
can be passed via the attribute per usual (see the
`Attribute::Handlers' manpage for details, and the `Memoize' manpage
for information on memoizing options):
sub f :Memoize(NORMALIZER => 'main::normalize_f') {
...
}
However, since the call to `memoize()' is now done in a different
package, it is necessary to include the package name in any function
names passed as options to the attribute, as shown above.
Abstract
Declaring a subroutine to be abstract using this attribute causes a
call to it to die with a suitable exception. Subclasses are expected
to implement the abstract method.
Using the attribute makes it visually distinctive that a method is
abstract, as opposed to declaring it without any attribute or method
body, or providing a method body that might make it look as though
it was implemented after all.
Alias
If you need a variable or subroutine to be known by another name,
use this attribute. Internally, the attribute's handler assigns
typeglobs to each other. As such, the `Alias' attribute provides a
layer of abstraction. If the underlying mechanism changes in a
future version of Perl (say, one that might not have the concept of
typeglobs anymore :), a new version of this module will take care of
that, but your `Alias' declarations are going to stay the same.
Note that assigning typeglobs means that you can't specify a synonym
for one element of the glob and use the same synonym for a different
target name in a different slot. I.e.,
sub color :Alias(colour) { ... }
my $farbe :Alias(colour);
doesn't make sense, since the sub declaration aliases the whole
`colour' glob to `color', but then the scalar declaration aliases
the whole `colour' glob to `farbe', so the first alias is lost.
SigHandler
When used on a subroutine, this attribute declares that subroutine
to be a signal handler for the signal(s) given as options for this
attribute. It thereby frees you from the implementation details of
defining sig handlers and keeps the handler definitions where they
belong, namely with the handler subroutine.
BUGS
None known so far. If you find any bugs or oddities, please do inform
the author.
AUTHOR
Marcel Grunauer, <marcel@codewerk.com>
COPYRIGHT
Copyright 2001 Marcel Grunauer. All rights reserved.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
SEE ALSO
perl(1), Attribute::Handlers(3pm), Memoize(3pm).
Marcel
--
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
-- London.pm strategy aka "embrace and extend" aka "mark and sweep"
------------------------------
Date: Wed, 30 May 2001 18:27:16 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Analyzing biometrics (was Re: Req. for help: need biometric guniea pigs)
Message-Id: <3B1573C4.9998F616@earthlink.net>
Anno Siegel wrote:
>
> According to Benjamin Goldberg <goldbb2@earthlink.net>:
> > Alan Barclay wrote:
> > >
> > > In article <Pine.GSO.4.10.10105131644070.2204-100000@aloha.cc.columbia.edu>,
> > > Mike Schiraldi <mgs21@columbia.edu> wrote:
> > > >I'm playing around with some simple biometrics - measuring the
> > > >time between keystrokes for a standard phrase, like "The quick
> > > >brown fox" or
> > >
> > > This sounds to me like a very unreliable method. My typing speed
> > > varies according to my posture, my general tiredness, my
> > > concentration on the task and other factors. Also, if I have to
> > > type a phrase repeatadly, eg passwords, then I get better at it as
> > > time goes on.
> >
> > It can be about as reliable as voice recognition. Sometimes your
> > voice
>
> Can you substantiate that claim? Voice recognition has a *lot* more
> data to go on than the handful of integers you get from timing a
> keyboard sample.
You're right. I was exagerating to get the point across; that point
being, that variances like your timings drifting over time (no pun
intended) are not automatically going to eliminate the utility of the
approach. Just because a user types at slightly difference speeds on
different occasions doesn't make the method unreliable, since other
methods (like voice recognition) also cope with variances as well.
--
The longer a man is wrong, the surer he is that he's right.
------------------------------
Date: 30 May 2001 16:28:53 -0700
From: visionary@yahoo.com (James)
Subject: Built in functions to format ISO Date YYYYMMDD.
Message-Id: <21f63013.0105301528.52dbaf31@posting.google.com>
All,
I am getting a date in the YYYYMMDD format and I need to format in
in to MM/DD/YYYY and Month DD, YYYY for presentation. Is there any
functions built in to perl that can do this?
THanks,
James
------------------------------
Date: 31 May 2001 00:02:21 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Built in functions to format ISO Date YYYYMMDD.
Message-Id: <slrn9hb2gi.dgr.damian@puma.qimr.edu.au>
James chose 30 May 2001 16:28:53 -0700 to say this:
>...
> I am getting a date in the YYYYMMDD format and I need to format in
>in to MM/DD/YYYY and Month DD, YYYY for presentation. Is there any
>functions built in to perl that can do this?
>
#!/usr/local/bin/perl -w
use strict;
$_ = '20010101';
s[^(\d\d\d\d)(\d\d)(\d\d)$][$2/$3/$1]g;
print "$_\n";
$_ = '20010101';
my %months = (
'01' => 'Jan',
'02' => 'Feb',
);
s[^(\d\d\d\d)(\d\d)(\d\d)$]["$months{$2} $3, $1"]eg;
print "$_\n";
__END__
See:
perldoc perlre
perldoc perlop (and look for s///)
HTH
Cheers,
Damian
--
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;)
{@;[$;,$:]=@;[$:,$;]if($:=rand$;+$|)!=$;}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3.1 -- a JAPH in progress, I guess...
------------------------------
Date: Wed, 30 May 2001 22:24:39 +0000 (UTC)
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: Can't Compile 5.6.1 on AIX
Message-Id: <9f3rv7$1ohk$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Ron Hill
<hillr@ugs.com>], who wrote in article <3B152738.6BA2132B@ugs.com>:
> Griff Hamlin wrote:
> Yes I have done this. I am running AIX 4.3.3 and using the IBM c++
> compiler version 3.6.6
> I had a similar problem with seg faults and core dumps. I found that if
> you use the malloc
> that perl provides all tests will pass. When the configure script asks
> to use the malloc
> that perl provides the default for AIX is no, change this to yes and
> continue with the build
> then run the make test.
Please report this to perlbug. While AIX's malloc() may be buggy, so
may be Perl itself - if so, using Perl's malloc() just masks the
problem.
Ilya
------------------------------
Date: Wed, 30 May 2001 20:08:11 -0400
From: Jeffrey Drumm <jdrumm@blazenetme.net>
Subject: Re: Can't get size value back when using $ftp->size
Message-Id: <1s1bhtgjjl76vumpp8l9p66ipmvuq9cbq3@4ax.com>
[posted to comp.lang.perl.misc]
On 30 May 2001 14:21:08 -0700, as@inaday.com (Anand Sethupathy) wrote:
>We have a perl script that transports large data files between Windows
>and Linux machines. For some reason, we can't seem to read the file
>size on files that reside on the Windows FTP Server (IIS4.0/NTSP6a).
>It just returns "" for the size each time. Any thoughts on what might
>be causing this?
SIZE has to be implemented on the server for the client to take advantage
of it. IIS 4.0[1] supports SIZE, but earlier versions of IIS don't. Are you
absolutely sure you're using IIS 4.0's FTP server?
>$ftp = Net::FTP->new($get_machine, Debug => 0);
>$status = $ftp->login($username,$password);
>print "Getting File\n";
>$status = $ftp->get($file);
>print "Status: $status\n";
I don't see the size() method used anywhere in this script fragment. Hint:
if you're going to post code, use cut and paste, with actual code that
exhibits the problem as your source.
(snip)
[1] This is NOT the version supplied in a fresh NT installation, nor are
you upgraded to it automatically via SP6A. You must install the Option Pack
to get IIS 4.0.
------------------------------
Date: 30 May 2001 23:05:12 GMT
From: david.obrien@ssmb.com.au (Dave)
Subject: Re: Controlling downloads using CGI and Apache
Message-Id: <Xns90B25C6FDDF65davidobrienssmbcomau@169.191.104.95>
>
>> Note that this can be implemented in many other langages; your
>> question is not Perl-specific,
>
>Fully concur with that.
>
It's perl specific, because I want to do it in perl, but thank you all for
the advice.
The request order is available with mod_perl, but is a real bastard to
understand/implement. Most sites are using form based authentication now,
by redirecting you to login pages. The good thing about the CGI is that
session management is pretty straight forward, and state can be passed
between different name spaces/environments
--
"The Sun is not God!"
------------------------------
Date: 30 May 2001 23:29:31 GMT
From: david.obrien@ssmb.com.au (Dave)
Subject: Re: Controlling downloads using CGI and Apache
Message-Id: <Xns90B2608ED11Cdavidobrienssmbcomau@169.191.104.95>
>
>That is a totally unnecessary (and hence anti-social) disruption of
>the HTTP caching mechanism.
>
Maybe so, but how do I prevent direct URL access?
--
"The Sun is not God!"
------------------------------
Date: Wed, 30 May 2001 23:44:48 GMT
From: michael@visionpro.com (Michael D. Risser)
Subject: Re: Frustrated people (not) answering questions
Message-Id: <3b158516.9384143@news.usenet.com>
I agree, we all had to start somewhere, and some of us are just coming
off the starting line.
If you feel that the question is stupid, ignore it. I for one would
rather have my question go unanswered than have someone attempt to
degrade me for asking.
On Wed, 30 May 2001 11:24:52 +0200, "Michel"
<michel.wouterse@intec-delft.com> wrote:
>I wonder why there are so many frustrated people answering questions.
>If you think a question is stupid (generally, only answers can be) just keep
>your mouth shut. Saves you some typing, and we would get answers, like we
>would like to have.
>If someone asks a question here, mostly it's not a complete idiot asking for
>something, but in most cases, the needy are the ones misreading or trying
>and failing a certain thing.
>And....then.... most of you all started by asking questions...remember?
>
>I got my tips from someone willing to say something usefull without remarks
>and that helped me a lot.
>For him, it was probably a simple thing, for me it was a headache. (and all
>I did was miss-read a line in the POD, which would have helped me accomplish
>almost everything I asked for)
>
>
>
>For all of you out there having fun in making stupid remarks: "I don't give
>a shit what you think. You can stick it all up your dark spot."
>
>For all of you actually making sense: "keep the goods coming. A lot of us
>are actually learning from you!"
>
>
>
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
------------------------------
Date: Wed, 30 May 2001 17:15:33 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Frustrated people (not) answering questions
Message-Id: <3B158D25.945BB02D@stomp.stomp.tokyo>
Michael D. Risser wrote:
> Michel wrote:
(some snippage)
> > For all of you out there having fun in making stupid remarks: "I don't give
> > a shit what you think. You can stick it all up your dark spot."
> > For all of you actually making sense: "keep the goods coming. A lot of us
> > are actually learning from you!"
> I agree, we all had to start somewhere, and some of us are just coming
> off the starting line.
> If you feel that the question is stupid, ignore it. I for one would
> rather have my question go unanswered than have someone attempt to
> degrade me for asking.
Ahhh... but this is not in accordance with the
Cabal Manifesto for this newsgroup,
"Spread discontent and hatred whenever possible."
Hey! Join in. Slip on those glossy jack boots.
Masturbate your ego at the expense of others.
It feels good!
If not, recognize these people for the hateful
anal retentive sissified geeks they are and act
accordingly. Now this is fun.
When people are deliberately mean to you, when
people treat you with no respect, when people
use you for ego satiation, those people also
grant you a license to treat them in any fashion
you wish; they have forfeited all their inherent
rights to be treated with respect and decency.
Godzilla! No. 1 Geek Butt Kicker.
------------------------------
Date: Wed, 30 May 2001 17:40:01 -0700
From: "communist rabbi" <senile_rabbi@hotmail.spam.com>
Subject: Re: Frustrated people (not) answering questions
Message-Id: <thb437btqgl228@corp.supernews.com>
>If you think a question is stupid (generally, only answers can be) just
keep
>your mouth shut.
I quote from the demotivators at thinkgeek:
CLUELESSNESS
There are no stupid questions, just a lot of inquisitive idiots.
BTW, i apologize for this being off the subject - oh well.
"Michael D. Risser" <michael@visionpro.com> wrote in message
news:3b158516.9384143@news.usenet.com...
> I agree, we all had to start somewhere, and some of us are just coming
> off the starting line.
>
> If you feel that the question is stupid, ignore it. I for one would
> rather have my question go unanswered than have someone attempt to
> degrade me for asking.
>
> On Wed, 30 May 2001 11:24:52 +0200, "Michel"
> <michel.wouterse@intec-delft.com> wrote:
>
> >I wonder why there are so many frustrated people answering questions.
> >If you think a question is stupid (generally, only answers can be) just
keep
> >your mouth shut. Saves you some typing, and we would get answers, like we
> >would like to have.
> >If someone asks a question here, mostly it's not a complete idiot asking
for
> >something, but in most cases, the needy are the ones misreading or trying
> >and failing a certain thing.
> >And....then.... most of you all started by asking questions...remember?
> >
> >I got my tips from someone willing to say something usefull without
remarks
> >and that helped me a lot.
> >For him, it was probably a simple thing, for me it was a headache. (and
all
> >I did was miss-read a line in the POD, which would have helped me
accomplish
> >almost everything I asked for)
> >
> >
> >
> >For all of you out there having fun in making stupid remarks: "I don't
give
> >a shit what you think. You can stick it all up your dark spot."
> >
> >For all of you actually making sense: "keep the goods coming. A lot of us
> >are actually learning from you!"
> >
> >
> >
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com
------------------------------
Date: Wed, 30 May 2001 23:29:48 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: How to match and print like this ???
Message-Id: <3B158268.C4A9F3E0@acm.org>
cadfei wrote:
>
> sorry, I mean every element come with \t
> can I put "\t" in somewhere in printf?
>
> printf "%${col_wid}s", exists $graph{$x}{$y} ? $graph{$x}{$y} :
If you just want a tab separated list then this will do it.
#!/usr/bin/perl -w
use strict;
my %graph;
my @masters;
while ( <DATA> ) {
my @f = split " ";
my $master = shift @f;
my $instance = pop @f;
$master = "$master($instance)";
push @masters, $master;
$graph{ $_ }{ $master } = 'X' for @f;
}
print join( "\t", ( '', @masters ) ), "\n";
for my $x ( sort keys %graph ) {
print $x;
print "\t", ( exists $graph{$x}{$_} ? $graph{$x}{$_} : '' ) for
@masters;
print "\n";
}
John
--
use Perl;
program
fulfillment
------------------------------
Date: 30 May 2001 23:32:20 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: OT: killfiles (was: Re: Perl Community Stars (?))
Message-Id: <slrn9hb0o8.dgr.damian@puma.qimr.edu.au>
Eli the Bearded chose 30 May 2001 18:53:04 GMT to say this:
>In comp.lang.perl.misc, Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>> Abigail <abigail@foad.org> wrote:
>> > Several movies have been made about Godzilla.
>> Yes, but I wouldn't really classify her as a Perl person, more as a
>> cargo-cult misinformant. Or has she improved since my killfile started
>> taking care of threads containing posts from her?
>
>You killfile the whole thread? Or all followups?
>...
I kill all followups, which does make the rest of the thread vanish. You
might want to see my query about this stance at:
http://groups.google.com/groups?hl=en&lr=&th=d678e20ea147d938&start=10&ic=1
and the replies by Abigail and Martien.
Cheers,
Damian
--
@:=grep!($;+=m!$/|#!),split//,<DATA>;@;=0..$#:;while(@;){for($;=@;;--$;;)
{@;[$;,$:]=@;[$:,$;]if($:=rand$;+$|)!=$;}push@|,shift@;if$;[0]==@|;select
$,,$,,$,,1/80;print qq x\bxx((@;+@|)*$|++),@:[@|,@;],!@;&&$/} __END__
Just another Perl Hacker # rev 3.1 -- a JAPH in progress, I guess...
------------------------------
Date: Wed, 30 May 2001 17:00:45 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: OT: killfiles (was: Re: Perl Community Stars (?))
Message-Id: <3B1589AD.64A3DEBE@stomp.stomp.tokyo>
Damian James wrote:
> Eli the Bearded wrote:
> > Martien Verbruggen wrote:
> >> Abigail wrote:
> >> > Several movies have been made about Godzilla.
> >> Yes, but I wouldn't really classify her as a Perl person, more as a
> >> cargo-cult misinformant. Or has she improved since my killfile started
> >> taking care of threads containing posts from her?
> >You killfile the whole thread? Or all followups?
> >...
> I kill all followups, which does make the rest of the thread vanish. You
> might want to see my query about this stance at:
> http://groups.google.com/groups?hl=en&lr=&th=d678e20ea147d938&start=10&ic=1
"Hello. My name is Damian. I am hateful."
* applauds *
You and your friends are on the road to recovery!
Godzilla!
------------------------------
Date: Wed, 30 May 2001 23:51:37 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Perl Community Stars (?)
Message-Id: <slrn9hb1s9.86m.abigail@tsathoggua.rlyeh.net>
Chris Stith (mischief@velma.motion.net) wrote on MMDCCCXXIX September
MCMXCIII in <URL:news:thanqdj5b32156@corp.supernews.com>:
:}
:} I think one reason there are so many well-known people in the
:} Perl community is because the language is so vast. It takes
:} someone with an exceptional knowledge of the language to know
:} the best ways to do a wide range of things. In C, you can
:} consult Knuth then write code that optimizes well. In Perl,
:} there's room for many people to contribute many ways to do the
:} same thing to the same group, and to have nearly equally
:} performing implementations.
It looks like you are implying that you can't take Knuth then write
optimized code in Perl.
That might be true. But I wouldn't call that a positive thing for Perl.
Abigail
--
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
------------------------------
Date: Thu, 31 May 2001 02:39:45 +0200
From: buggs <buggs@geekmail.de>
Subject: Re: Perl Community Stars (?)
Message-Id: <9f43pd$cpd$05$1@news.t-online.com>
Abigail wrote:
> It looks like you are implying that you can't take Knuth then write
> optimized code in Perl.
>
> That might be true. But I wouldn't call that a positive thing for Perl.
It tends to be easier to port the MIX
examples to similar languages ( like C ).
Higher languages leave more place for implementation.
Thinking that's why he will use another language ( MMIX )
in the future.
Buggs
------------------------------
Date: Wed, 30 May 2001 02:29:13 GMT
From: world!swmcd@uunet.uu.net (Steven W McDougall)
Subject: Pod::Tree 1.07
Message-Id: <thb49qsbgas4c3@corp.supernews.com>
Pod::Tree 1.07 has been released to CPAN.
DESCRIPTION
Modules
Pod::Tree parses a POD into a static syntax tree.
Applications walk the tree to recover the structure and content of
the POD.
Pod::Tree::HTML walks a Pod::Tree and translates it to HTML.
Pod::Tree::Pod walks a Pod::Tree and translates it back to POD.
Pod::Tree::Perl* translate the PODs in the Perl distribution to HTML.
Executables
pod2html translates a POD file to an HTML file.
pods2html walks a directory tree,
translates all the PODs that it finds into HTML files,
and puts the HTML files into a parallel directory tree.
perl2html translates the PODs in the Perl distribution to HTML
Changes
The Changes file details the changes to each module and program.
Functionally, there are a few big changes
- Pod::Tree now captures non-POD text (e.g. code) and line endings.
This is a big step towards the ultimate goal of being able to
exactly reconstruct any file from its Pod::Tree representation.
- Pod::Tree::HTML translates =for image paragraphs to <IMG> elements,
and L<http://...> markups to <A href="http://..."></A> elements.
The first is reasonably justified by perlpod; the second is not,
but is now supported by popular demand.
- pods2html is more robust and better behaved
- perl2html handles perlfunc.pod and the README.* files better.
It resolves all but 185 links in the 5.6.1 documentation set.
ACKNOWLEDGMENTS
Sean M. Burke <sburke@spinn.net>
Rudi Farkas <rudif@bluemail.ch>
Jost Krieger <Jost.Krieger@ruhr-uni-bochum.de>
Jonas Liljegren <jonas@jonas.rit.se>
Johan Lindstrom <johanl@bahnhof.se>
Rob Napier <rnapier@employees.org>
Christopher Shalah <trance@drizzle.com>
Johan Vromans <JVromans@Squirrel.nl >
COPYRIGHT
Copyright 1999-2001 by Steven McDougall. This module is free
software; you can redistribute it and/or modify it under the same
terms as Perl itself.
- SWM
------------------------------
Date: Wed, 30 May 2001 15:24:16 GMT
From: world!swmcd@uunet.uu.net (Steven W McDougall)
Subject: Pod::Tree 1.08
Message-Id: <thatqt39ffuuae@corp.supernews.com>
DESCRIPTION
Modules
Pod::Tree parses a POD into a static syntax tree.
Applications walk the tree to recover the structure and content of
the POD.
Pod::Tree::HTML walks a Pod::Tree and translates it to HTML.
Pod::Tree::Pod walks a Pod::Tree and translates it back to POD.
Pod::Tree::Perl* translate the PODs in the Perl distribution to HTML.
Executables
pod2html translates a POD file to an HTML file.
pods2html walks a directory tree,
translates all the PODs that it finds into HTML files,
and puts the HTML files into a parallel directory tree.
perl2html translates the PODs in the Perl distribution to HTML
CHANGES
1.08 fixes some t/ problems in 1.07.
See the announcement for 1.07 for a description of functional
changes from 1.06.
PREREQUISITES
Perl 5.6.0
Exporter
File::Find
IO::File
HTML::Stream
Pod::Usage
TODO
See the ToDo and ToDo.Not files.
Send suggestions, bugs, etc. to swmcd@world.std.com
ACKNOWLEDGMENTS
Sean M. Burke <sburke@spinn.net>
Rudi Farkas <rudif@bluemail.ch>
Jost Krieger <Jost.Krieger@ruhr-uni-bochum.de>
Jonas Liljegren <jonas@jonas.rit.se>
Johan Lindstrom <johanl@bahnhof.se>
Rob Napier <rnapier@employees.org>
Christopher Shalah <trance@drizzle.com>
Johan Vromans <JVromans@Squirrel.nl >
Thanks to all who sent bug reports, fixes, suggestions, and requests.
COPYRIGHT
Copyright 1999-2001 by Steven McDougall. This module is free
software; you can redistribute it and/or modify it under the same
terms as Perl itself.
- SWM
------------------------------
Date: Wed, 30 May 2001 18:15:46 -0400
From: "Robert Berlinger" <rnb@aecom.yu.edu>
Subject: printf/sprintf round problem?
Message-Id: <9f3rdi$re$1@moonbeam.aecom.yu.edu>
Why does
$a = 7;
$b = $a * 1.15;
printf ("%.1f\n", $b);
printf ("%.1f\n", 8.05);
print
8.0
8.1
when 7*1.5 = 8.05 which should round to 8.1? This is perl, v5.6.1 built for
sun4-solaris.
What am I missing? Thanks.
------------------------------
Date: Wed, 30 May 2001 22:52:22 GMT
From: Arnar M Hrafnkelsson <addi@umich.edu>
Subject: Re: printf/sprintf round problem?
Message-Id: <m3zobuih4o.fsf@steypa.ast.is>
"Robert Berlinger" <rnb@aecom.yu.edu> writes:
> Why does
>
> $a = 7;
> $b = $a * 1.15;
> printf ("%.1f\n", $b);
> printf ("%.1f\n", 8.05);
>
> print
>
> 8.0
> 8.1
>
> when 7*1.5 = 8.05 which should round to 8.1? This is perl, v5.6.1 built for
> sun4-solaris.
>
> What am I missing? Thanks.
I think this is called IEEE rounding.
$ perl -wle 'for($i=1.0; $i<5.0; $i+=.5) { printf("%.1f %.0f\n", $i, $i); }'
1.0 1
1.5 2
2.0 2
2.5 2
3.0 3
3.5 4
4.0 4
4.5 4
Notice how the break even points of n.5 are rounded up if n is odd but down
if n is even? That's the way IEEE rounding works.
This is covered in the faq, perldoc -q round has more.
------------------------------
Date: Thu, 31 May 2001 00:16:13 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: printf/sprintf round problem?
Message-Id: <3b158bc5.23373536@news.erols.com>
On Wed, 30 May 2001 18:15:46 -0400, "Robert Berlinger"
<rnb@aecom.yu.edu> wrote:
>Why does
>
>$a = 7;
>$b = $a * 1.15;
>printf ("%.1f\n", $b);
>printf ("%.1f\n", 8.05);
>
>print
>
>8.0
>8.1
>
>when 7*1.5 = 8.05 which should round to 8.1? This is perl, v5.6.1 built for
>sun4-solaris.
>
>What am I missing? Thanks.
That happens because the internal representation of floating point
numbers is imprecise. Try taking it out to 15 (or more) decimals.
printf ("%.15f\n", $b);
printf ("%.15f\n", 8.05);
8.049999999999999
8.050000000000001
------------------------------
Date: Wed, 30 May 2001 17:12:42 -0500
From: Dmitry Epstein <mitia.nospam@northwestern.edu.invalid>
Subject: Re: Reading binary data (method and style)?
Message-Id: <3B15705A.D377F99F@northwestern.edu.invalid>
nobull@mail.com wrote:
>
> Dmitry Epstein <mitia.nospam@northwestern.edu.invalid> writes:
>
> > I could write the format string for unpack() something like this:
> >
> > "v2aaaav3a3" etc.
> >
> > But, since each field has a particular meaning, what I would like to do
> > is to somehow write this with comments.
>
> > (I know the following doesn't work):
> >
> > "v # foo
> > v # bar
> > a # baz
>
> You'll kick yourself...
>
> my ($foo,$bar,$baz) = unpack (
> 'v'. # foo
> 'v'. # bar
> 'a', # baz
> $record);
Thanks... but I was thinking of something more elegant. I know, of
course, about string concatenation. I guess there's nothing better?
Incidentally, is there a way to write a string on multiple lines in
Perl? Couldn't find this in the docs.
--
Dmitry Epstein
Northwestern University, Evanston, IL. USA
mitia(at)northwestern(dot)edu
------------------------------
Date: Wed, 30 May 2001 22:58:48 +0000 (UTC)
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: Reading binary data (method and style)?
Message-Id: <9f3tv8$1pqu$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Dmitry Epstein
<mitia.nospam@northwestern.edu.invalid>], who wrote in article <3B14A1BE.B79E2B38@northwestern.edu.invalid>:
> But, since each field has a particular meaning, what I would like to do
> is to somehow write this with comments. It would then be easier to read
> and modify the code. So, what I would like to do is something like this
> (I know the following doesn't work):
>
> "v # foo
> v # bar
> a # baz
> ...
Upgrade.
Hope this helps,
Ilya
------------------------------
Date: Wed, 30 May 2001 17:58:03 -0700
From: BCC <bcoon@sequenom.com>
Subject: Server push and $|?
Message-Id: <3B15971B.307E94CC@sequenom.com>
I have been reading up on the server push stuff from CGI.pm and am
unclear on something.
Why is it recommended that you set $| to 1 to avoid buffering problems?
It says in my handy dandy perl pocket ref that $| forces a flush after
every write or print on the currently selected output channel. What is
happening in a server push that I need to control buffering that is
different from standard requests and responses? Is this something
I should be doing in all of my perl scripts?
Also (somewhat off topic) does there exist perl server push that works
with IE? I scoured CPAN and came up empty.
Thanks,
Bryan
------------------------------
Date: Wed, 30 May 2001 18:12:21 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Silly pipe() question
Message-Id: <3B157045.EBEB80A5@earthlink.net>
Per Kistler wrote:
>
> Hi Benjamin
>
> Benjamin Goldberg wrote:
> >
> > I suppose that this might seem to be a silly question, but...
> >
> > Why does the builtin function pipe() take two target operands,
> > rather than taking no arguments and returning a two-element list?
> >
> > I would prefer to be able to do these:
> > my ($read_fh, $write_fh) = pipe;
> > or local (*READER, *WRITER) = pipe;
> > or my @p = pipe;
> > or pipe my @p;
> >
> > Than have to do these:
> > pipe my($read_fh, $write_fh);
> > or pipe local(*READER, *WRITER);
> > or my @p; pipe $p[0], $p[1];
> >
> > It's such a simple, useful thing, and I don't understand why it
> > wasn't done. I know where the original syntax comes from... the C
> > function pipe takes as an argument a pointer to two ints, and fills
> > them in with filedescriptors... but the only reason it was done that
> > way (AFAIKS) is that C functions can only return a single value.
> > Perl has no difficulty at all returning a list with multiple values.
> > Also, it should have no difficulty differentiating the different
> > number of arguments, to do The Right Thing.
>
> Probably it would polute the global name space...
> You could make a small function, which uses the Gensym module.
Eh? How would adding an extra form pollute the global namespace? I'm
not suggesting adding a new function, but changing an old one.
Did it pollute the global namespace when the three-argument version of
open() was added to perl? No, because it didn't add a new name, just a
new method of using an old name.
--
The longer a man is wrong, the surer he is that he's right.
------------------------------
Date: Wed, 30 May 2001 23:40:36 GMT
From: "Rob" <"relaxedrob@optushome.com.au">
Subject: Re: Unsure about headers
Message-Id: <UxfR6.5250$25.18979@news1.eburwd1.vic.optushome.com.au>
Hi Brian!
Unless the reply needs to directly quote any of the original text, the reply
belongs above the original text. This is much easier to understand and precludes
the user from having to scroll through a potentially large message to get to a
potentially small reply.
Rob
"brian d foy" <comdog@panix.com> wrote in message
news:comdog-E2BA77.13031030052001@news.panix.com...
> In article <3B152889.881123B3@gmx.net>, Per Kistler <kistler@gmx.net>
> wrote:
>
> [please post your reply after the original text, as demonstrated here]
>
> > If your WWW server uses mod_perl, than global variables may
> > remain in the ever running perl interpreter.
>
> that is, the one in one of the httpd children. ;)
>
> --
> brian d foy <comdog@panix.com>
> CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
> Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html
>
------------------------------
Date: Thu, 31 May 2001 00:02:19 GMT
From: "Rob" <"relaxedrob@optushome.com.au">
Subject: Re: Unsure about headers
Message-Id: <fSfR6.5254$25.18958@news1.eburwd1.vic.optushome.com.au>
Thanks you very much for the reply!
<cut>
> Unsure what any of this has to do with any concept that anyone usually
> describes with the word 'headers'.
This is why I titled the message "unsure". I am unsure whether my problem is to
do with headers or not (but I suspected it was).
<cut>
> I think you are whitnessing the "sticky" behaviour of the CGI module.
> This behaviour can be switched off on a per-field basis using the
> '-force' parameter. For further details locate the documentation of
> the -foece paramter.
>
Where can I find this documentation? :(
"perldoc force" reported nothing back and a search of
http://www.perl.com/search/
revealed a lot of entries about the Air Force using perl but nothing about a
paramater called 'force'. (Nor did I find mention of it in the index of
O'Reilly's Programming Perl.) What is 'force' specific to please?
My understanding is that a CGI object has a life expectancy equal to the script
that creates it. I have a script that creates a CGI object and also creates a
form using POST method that sends form information back to itself.
When the user presses the 'submit' button, doesn't this make the web-server
create a new instance of the script?
Indeed, once the html result page has been sent to the client's browser in the
first place, doesn't the web server automatically kill the CGI object and any
other variables created by the script?
My understanding is that I am maintaining state between html pages (or perl
scripts that output html pages) by using a form to send fields back to the same
script. What I am witnessing in the behavious of my script is that sql-query
strings are still alive in the next instance of my called script.
For this reason I suspected that they might somehow be kept alive in the http
'header' being sent back to my web-server.. or something like that anyway.
Rob
------------------------------
Date: 31 May 2001 00:06:14 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Unsure about headers
Message-Id: <slrn9hb2nm.oi2.sholden@pgrad.cs.usyd.edu.au>
On Wed, 30 May 2001 23:40:36 GMT, Rob <> wrote:
>Hi Brian!
>
>Unless the reply needs to directly quote any of the original text, the reply
>belongs above the original text. This is much easier to understand and precludes
>the user from having to scroll through a potentially large message to get to a
>potentially small reply.
If the original text isn't necessary then just the trim the damn thing and
put the reply *after* whatever text is left. If nothing of the original is
left, then why is it a reply and not a new post?
Pretty simple.
That way people can actually see a bit of context without having to read
from bottom to top, which isn't something newsreaders are good at...
--
Sam
Even if you aren't in doubt, consider the mental welfare of the person
who has to maintain the code after you, and who will probably put parens
in the wrong place. --Larry Wall
------------------------------
Date: Thu, 31 May 2001 00:18:23 GMT
From: "Rob" <"relaxedrob@optushome.com.au">
Subject: Re: Unsure about headers
Message-Id: <j5gR6.5256$25.18907@news1.eburwd1.vic.optushome.com.au>
<cut>
Good point!
ROb
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 1023
***************************************