[8699] in Perl-Users-Digest
Perl-Users Digest, Issue: 2316 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 14 10:20:25 1998
Date: Tue, 14 Apr 98 07:00:40 -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, 14 Apr 1998 Volume: 8 Number: 2316
Today's topics:
Re: [Q] find largest value in key of associative array? (Joel Coltoff)
Re: Array Question (Jean-Damien Durand)
Re: Bill Gates should be invited to O'Reilly's "Free So <davidv@hsa.com.au>
Re: Bill Gates should be invited to O'Reilly's "Free So <abraham@dina.kvl.dk>
Re: Bill Gates should be invited to O'Reilly's "Free So (Nathan V. Patwardhan)
Re: Bill Gates should be invited to O'Reilly's "Free So (Chris Nandor)
Re: Bill Gates should be invited to O'Reilly's "Free So (Chris Nandor)
Re: Bill Gates should be invited to O'Reilly's "Free So (James Mcpherson)
Re: Blat question <hakon@netbureauet.dk>
Re: Can I install perl5.004_04 myself? (Tad McClellan)
Re: Can someone give me an example of rounding! <gwynne@utkux.utk.edu>
Re: Can someone give me an example of rounding! <ljz@asfast.com>
Re: Can someone give me an example of rounding! <ljz@asfast.com>
Re: Confused - pod and man files <jim.michael@gecm.com>
Re: Converting a scalar data to ACII format. <jdporter@min.net>
Error number Help wanted romei@sprynet.com
Getting the name of an SMTP server <hakon@netbureauet.dk>
HELP: Trying to create a search application <a.r.mccoy@larc.nasa.gov>
Re: HELP: Trying to create a search application <jim.michael@gecm.com>
How could I improve my perl script's speed ? <dorr@cetrel.lu>
How to read systemcommand value to a variable? (Tony Christian Svderudd)
Re: How to read systemcommand value to a variable? <grinch@whoville.com>
Re: i want to learn Perl. HELP! <gwynne@utkux.utk.edu>
Re: Ideas for installations <jdporter@min.net>
Re: info on cookies <grinch@whoville.com>
Re: make perl program start with icon <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: May can you help, please? <gwynne@utkux.utk.edu>
Re: MKDIR problem (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Re: Need a Free Perl Data Base to the Web <fty@utk.edu>
Re: Perl 5.004_64 Slower??? <jdporter@min.net>
Re: Perl 5.004_64 Slower??? (Kevin Reid)
Re: perl win 32 : asterisk on command line (Clark Morgan)
Re: RMS should be invited to O'Reilly's "Free Software (Barry O'Neill)
Re: Tip: How to selectively quiet warnings (Kevin Reid)
using perl scripts from C++ (Michael Badt)
Which Win32 Perl (Rob Greenbank)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 14 Apr 1998 13:38:35 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: [Q] find largest value in key of associative array?
Message-Id: <6gvorv$sl3@netaxs.com>
In article <01bd66cb$a9542460$1ff8aecc@direct.ca.direct.ca>,
Stephen_Chan <schan_ca@rocketmail.com> wrote:
>What's the fastest way to find the largest key value
If your keys are all positive (as the example seems to indicate)
and have an upper bound that you know ahead of time then you should
be able to do a binary search using defined() or exists().
Writing of code is left as an exercise to the student.
--
Joel Coltoff
I'd explain it, but there's a lot of math. -- Calvin
------------------------------
Date: 14 Apr 1998 09:33:39 GMT
From: ddurand@hpplus17.cern.ch (Jean-Damien Durand)
To: Mark Fergusson <mferg@hal.ddntl.didata.co.za>
Subject: Re: Array Question
Message-Id: <6gvahj$3pa$1@sunnews.cern.ch>
> keyA value1 value2 value3 ... valueN
> keyB value1 value2 value3 ... valueN
A key in a hash can be associated to any kind of value. we just have to take
care of the ref() of this value.
$myhash{'keyA'} = [ qw/value1 value2 value3 ... valueN/ ];
$myhash{'keyB'} = [ @yoursecondlist ];
@{$myhash{'keyC'}} = @yourthirdlist;
print "ref(\$myhash{'keyA'}) = " . ref($myhash{'keyA'}) . "\n";
print "ref(\$myhash{'keyB'}) = " . ref($myhash{'keyB'}) . "\n";
print "ref(\$myhash{'keyC'}) = " . ref($myhash{'keyC'}) . "\n";
will say ARRAY in the those three examples.
Please read The Perl Data Structures Cookbook at:
http://language.perl.com/pdsc/index.html
Cheers, Jean-Damien.
--
*******************************************************
* Jean-Damien Durand (Jean-Damien.Durand@cern.ch) *
* www : http://wwwinfo.cern.ch/~ddurand/ *
*******************************************************
------------------------------
Date: 14 Apr 1998 19:52:52 +1000
From: David A Vincent <davidv@hsa.com.au>
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <q2songpw5n.fsf@hsa.com.au>
pudge@pobox.com (Chris Nandor) writes:
> In article <slrn6j4kog.4hf.wnoise@puree.ugcs.caltech.edu>,
> wnoise@ugcs.caltech.edu wrote:
>
> # Not to put too fine a point on it, but while information does not long
> # to be free, it is a useful approximation to consider it as if it did.
>
> Apologies, but I rarely consider it useful to consider something as true
> that which is not.
I do not think you have thought this through. Do you never think its
useful to make an hypothesis and explore the consequences? Do you
never make an hypothesis? Are your hypotheses always right? Are
wrong hypotheses never useful?
> # The information that is most widely replicate tends to last the
> # longest. If information is not widely replicated, it tends to die
> # out. The upshot is that we see the information that does "want to be
> # free". This is just another case of evolution in action, complete with
> # mutations, competition, parasites, symbionts, and widely varied
> # ecosystems.
>
> Can evolution really be applied to something that is completely inactive,
> that has no driving force of its own, such as information? Even amoebas
> move around of their own power. This just makes not a shred of sense to
> me.
Yes, it can. Many evolutionists do regard genes, the information
stored in our DNA, as the units of evolution. Read "The Selfish Gene"
or "The Blind Watchmaker" by Richard Dawkins, especially his
discussion of 'memes'.
> # In a similar way, uni-cellular creatures do not have any
> # "desire" to reproduce and avoid being eaten, but nevertheless it is a
> # very good way of understanding their behaviour. If they didn't behave
> # that way, they wouldn't be around.
>
> Unicellular creatures may not have desire as we know it, but they
> certainly have some sort of inherent drive to survive. They move toward
> that which keep them alive, and shirk away from perceived threats.
Your language here, 'inherent drive' , 'shirk away', 'perceive', is a
classic example of how it can be useful to consider something true
that is not. What would such a description look like if it were
reduced to the more 'true' description invoking tropisms, osmosis,
intracellular messengers, microtubules, and so on?
> Information does no such thing. It sits in a leather binding or on a
> floppy disk and does nothing one way or another to survive or prevent
> extinction.
Nothing except to convey its content... the above paragraph has
already `survived' a short time on Usenet, by virtue of its content.
Your expressed viewpoint says it has not 'done' anything at all. I
maintain that, in some circumstances, it makes sense to say that a
paragraph is 'strong', or 'weak', or 'is surviving'.
...dav
--
David A Vincent <mailto:davidv@hsa.com.au> JUNK E-MAIL NOT WELCOME
Working (not speaking) for Hydrographic Sciences Australia Pty Ltd
HSA phone extension number 27 within HSA, web site <http://marilyn/>
GCS C++++$ US++$ P+$ E++$ W++ N+++ w--- M++ Y+ PGP+ t-- G e++ h--- b+++
------------------------------
Date: 14 Apr 1998 12:45:26 +0200
From: Per Abrahamsen <abraham@dina.kvl.dk>
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <rj4szw65rt.fsf@zuse.+dina.kvl.dk>
[ FUT: gnu.misc.discuss ]
aidan@panix.com (Aidan Cully) writes:
> I haven't seen much software that _requires_ version 2, so the licenses of
> most GPL'ed software can be replaced by an arbitrary future license from
> the FSF.. The only promise we have that the future GPL will be something
> under which we'd like to license our software is the phrase "similar in
> spirit to the present version", which I doubt (IANAL) is enforcable in
> court.
They also have signed thousands of contracts explicitly stating that
the software will remain free. Whenever someone sign over software to
the FSF, they receive such a contract in return. So the FSF is
seriously limited in what they can do with the GPL in the future.
See <URL:http://egcs.cygnus.com/contribute.html>.
> (I'd love to see counterexamples to this.) People complaining
> about Troll-tech's license.. Well.. I agree with them, but the GPL seems
> to be heir to the same sort of problems as are objected to in the Troll
> license.
I don't see any similarity. The Troll Tech license is not free now.
The GPL v2 is free now, and software released under it can only become
more free since
GPL> later version", you have the option of following the terms and conditions
======================
i.e. it will be up to the user to decide whether he want to obey v2 or
v3 of the license.
------------------------------
Date: 14 Apr 1998 12:51:25 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <6gvm4d$jpe@fridge.shore.net>
Ben Bullock (ben@hayamasa.demon.co.uk) wrote:
: I don't have exact data as to how many copies of the books they
: sell this way, but you don't have any real sales figures to back up
: your opinion either, so I don't see this discussion getting
: anywhere.
But then again, you brought the X-Windows books up. Since you don't
have any evidence to backup your claims, you shouldn't have ever
mentioned such a topic.
--
Nathan V. Patwardhan
------------------------------
Date: Tue, 14 Apr 1998 09:18:47 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <pudge-1404980918500001@ppp-15.ts-1.kin.idt.net>
In article <353303ea.0@news.uni-ulm.de>, borchert@mathematik.uni-ulm.de wrote:
# Software = program code + associated reference documentation.
If it helps you sleep at night.
# Sometimes the associated reference documentation is in separate files,
# sometimes it is even mixed with the program code (see embedded POD for
# Perl, for example). Independent from this, it is an integral part of
# software.
As I said, so is distribution. Without distribution, software is
completely useless; therefore, it is an integral part of software.
Hardware is an integral part of software, too.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== New Book: MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: Tue, 14 Apr 1998 09:17:09 -0400
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <pudge-1404980917100001@ppp-15.ts-1.kin.idt.net>
In article <q2songpw5n.fsf@hsa.com.au>, David A Vincent
<davidv@hsa.com.au> wrote:
# pudge@pobox.com (Chris Nandor) writes:
#
# > In article <slrn6j4kog.4hf.wnoise@puree.ugcs.caltech.edu>,
# > wnoise@ugcs.caltech.edu wrote:
# >
# > # Not to put too fine a point on it, but while information does not long
# > # to be free, it is a useful approximation to consider it as if it did.
# >
# > Apologies, but I rarely consider it useful to consider something as true
# > that which is not.
#
# I do not think you have thought this through. Do you never think its
# useful to make an hypothesis and explore the consequences?
If there is a chance it is true, sure.
# Are wrong hypotheses never useful?
Sometimes.
# > Can evolution really be applied to something that is completely inactive,
# > that has no driving force of its own, such as information? Even amoebas
# > move around of their own power. This just makes not a shred of sense to
# > me.
#
# Yes, it can. Many evolutionists do regard genes, the information
# stored in our DNA, as the units of evolution. Read "The Selfish Gene"
# or "The Blind Watchmaker" by Richard Dawkins, especially his
# discussion of 'memes'.
I've read Dawkins, and I think he is a looney.
# > Information does no such thing. It sits in a leather binding or on a
# > floppy disk and does nothing one way or another to survive or prevent
# > extinction.
#
# Nothing except to convey its content... the above paragraph has
# already `survived' a short time on Usenet, by virtue of its content.
# Your expressed viewpoint says it has not 'done' anything at all. I
# maintain that, in some circumstances, it makes sense to say that a
# paragraph is 'strong', or 'weak', or 'is surviving'.
No, it does not. It has done no acting, it has only been acted upon.
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6'])
#== New Book: MacPerl: Power and Ease ==#
#== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==#
------------------------------
Date: 14 Apr 1998 13:37:29 GMT
From: mljmcphe@mailbox.uq.edu.au (James Mcpherson)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <6gvoqp$5eb$1@nargun.cc.uq.edu.au>
Chris Nandor (pudge@pobox.com) spake thusly:
: In article <q2songpw5n.fsf@hsa.com.au>, David A Vincent
: <davidv@hsa.com.au> wrote:
: # pudge@pobox.com (Chris Nandor) writes:
: # > In article <slrn6j4kog.4hf.wnoise@puree.ugcs.caltech.edu>,
: # > wnoise@ugcs.caltech.edu wrote:
: # > # Not to put too fine a point on it, but while information does not long
: # > # to be free, it is a useful approximation to consider it as if it did.
: # > Apologies, but I rarely consider it useful to consider something as true
: # > that which is not.
: # I do not think you have thought this through. Do you never think its
: # useful to make an hypothesis and explore the consequences?
: If there is a chance it is true, sure.
so, if you think there is even the slightest possibility that your
hypothesis might be false, you discard it immediately? I take it that
you therefore are afraid to experiment or explore, or do anything which
might make your tight little universe seem to be illogical.
:
: # Are wrong hypotheses never useful?
: Sometimes.
other people (scientists, philosophers, engineers, doctors, writers, etc)
find that incorrect hypotheses often bring them closer to the correct
hypothesis - "We learn from our mistakes" - at least, most people do.
:
: # > Can evolution really be applied to something that is completely inactive,
: # > that has no driving force of its own, such as information? Even amoebas
: # > move around of their own power. This just makes not a shred of sense to
: # > me.
: # Yes, it can. Many evolutionists do regard genes, the information
: # stored in our DNA, as the units of evolution. Read "The Selfish Gene"
: # or "The Blind Watchmaker" by Richard Dawkins, especially his
: # discussion of 'memes'.
: I've read Dawkins, and I think he is a looney.
and why, pray tell, is Dawkins a looney? I think it fair to hypothesize
that the people who read the groups to which is thread is posted would
like to see some reasoning and logic from you about why you hold those
particular views. Personally, I'm inclined to think that you don't really
have the courage of your convictions.
:
[snippage about information and freedom]
: # Nothing except to convey its content... the above paragraph has
: # already `survived' a short time on Usenet, by virtue of its content.
: # Your expressed viewpoint says it has not 'done' anything at all. I
: # maintain that, in some circumstances, it makes sense to say that a
: # paragraph is 'strong', or 'weak', or 'is surviving'.
: No, it does not. It has done no acting, it has only been acted upon.
Yes, the information has been acted upon, but the information referred
to has _acted_ upon you and now me to produce your postings and mine -
information is not neutral, nor is it passive.
James C. McPherson
libBofh
--
I do not speak for the University of Queensland or the University Library
J.McPherson@mailbox.uq.edu..au | this space _not_ for rent.
j.mcpherson@library.uq.edu..au | remove erroneous char to reply properly
------------------------------
Date: Tue, 14 Apr 1998 15:22:12 +0200
From: "Hakon Steinx" <hakon@netbureauet.dk>
To: Sleep <mhchau@cse.cuhk.edu.hk>
Subject: Re: Blat question
Message-Id: <35336304.CFDAF78C@netbureauet.dk>
Sleep wrote:
> hello ,
> anyone know when using Blat to send mail through CGI, how to use
> standard input (instead of a file) as the mail's content ?
>
> Thanx for ur attention.
>
> Regards,
> Chau.
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
------------------------------
Date: Mon, 13 Apr 1998 21:50:43 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Can I install perl5.004_04 myself?
Message-Id: <3uiug6.348.ln@localhost>
John Taylor-Johnston (eslcafe@callisto.si.usherb.ca) wrote:
: Can I install perl myself, with the modules, under my public_html
: directory (UNIX SERVER), and then call my version of perl with my
: scripts using this syntax:
: WHAT AM I GETTING MYSELF INTO?
from 'perlfaq8'
---------------------------------
=head2 How do I keep my own module/library directory?
When you build modules, use the PREFIX option when generating
Makefiles:
perl Makefile.PL PREFIX=/u/mydir/perl
then either set the PERL5LIB environment variable before you run
scripts that use the modules/libraries (see L<perlrun>) or say
use lib '/u/mydir/perl';
See Perl's L<lib> for more information.
---------------------------------
: Please respond by email.
Bad.
Very Bad.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 14 Apr 1998 06:09:43 -0400
From: "Bob Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: Can someone give me an example of rounding!
Message-Id: <6gvcnn$qm2$1@gaia.ns.utk.edu>
$num = int(100 * $num) / 100; # getscha to 2 places.
Bob Gwynne
Chocolate wrote in message ...
>I don't nor will I have access to the web for about a week or two so I
>would really appreciate it if someone would tell me how to round to 2
>decimal point. I don't know how much different it will be but I am not
>too familiar with perl5.
------------------------------
Date: 14 Apr 1998 08:40:16 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Can someone give me an example of rounding!
Message-Id: <lt3efgmv9r.fsf@asfast.com>
"Bob Gwynne" <gwynne@utkux.utk.edu> writes:
> $num = int(100 * $num) / 100; # getscha to 2 places.
>
> Bob Gwynne
I'm sorry, but this will not do rounding, just truncation. Here's a
similar example that rounds:
$num = int(100 * num + 50) / 100;
Another method of rounding (which I believe is a bit more reliable) is
as follows:
$roundedString = sprintf("%.2lf", $num);
The `%.<n>f' and `%.<n>lf' operators in printf/sprintf do rounding to
<n> decimal places. There may be a broken implementation of
printf/sprintf which doesn't round in this case on certain operating
systems or C libraries, but I doubt that such broken implementations
are very common these days.
If, however, your OS or C library does happen to make use of such a
broken implementation, then the following will work:
$roundedString = sprintf("%.2lf", $num + .005);
The following routine will properly do rounding to a specified number
of decimal places, and it will work with either broken or non-broken
printf/sprintf implementations. You would invoke this routine as
follows: $roundedString = round($number, $numberOfDecimalPlaces);
$sprintfIsBroken = undef; # must be a global
sub round {
my $number = shift;
my $dp = shift;
unless (defined($sprintfIsBroken)) {
# Only gets invoked once.
my $tempResult = sprintf("%.2lf", 10.0 / 6.0);
$sprintfIsBroken = ($tempResult =~ m/7$/ ? 0 : 1);
}
if ($dp < 0) {
# Treat negative dp's as no dp's.
$dp = 0;
}
my $fmt = "%.$dp" . 'lf';
if ($sprintfIsBroken) {
$number += ('.' . ('0' x $dp) . '5');
}
return (sprintf($fmt, $number));
}
There are ways to jam this routine into a smaller number of
statements, but I deliberately did it this way to aid in the clarity
of this example.
I hope this helps.
> Chocolate wrote in message ...
> >I don't nor will I have access to the web for about a week or two so I
> >would really appreciate it if someone would tell me how to round to 2
> >decimal point. I don't know how much different it will be but I am not
> >too familiar with perl5.
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: 14 Apr 1998 09:29:55 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Can someone give me an example of rounding!
Message-Id: <ltwwcsleek.fsf@asfast.com>
Lloyd Zusman <ljz@asfast.com> writes:
I have a few corrections to my previous post. I didn't take negative
numbers properly into account.
> "Bob Gwynne" <gwynne@utkux.utk.edu> writes:
>
> > $num = int(100 * $num) / 100; # getscha to 2 places.
> >
> > Bob Gwynne
>
> I'm sorry, but this will not do rounding, just truncation. Here's a
> similar example that rounds:
>
> $num = int(100 * num + 50) / 100;
Correction: $num = int(100 * $num + ($num < 0 ? -50 : 50)) / 100;
> Another method of rounding (which I believe is a bit more reliable) is
> as follows:
>
> $roundedString = sprintf("%.2lf", $num);
>
> The `%.<n>f' and `%.<n>lf' operators in printf/sprintf do rounding to
> <n> decimal places. There may be a broken implementation of
> printf/sprintf which doesn't round in this case on certain operating
> systems or C libraries, but I doubt that such broken implementations
> are very common these days.
>
> If, however, your OS or C library does happen to make use of such a
> broken implementation, then the following will work:
>
> $roundedString = sprintf("%.2lf", $num + .005);
Correction: $roundedString =
sprintf("%.2lf", $num + ($num < 0 ? -.005 : .005));
> The following routine will properly do rounding to a specified number
> of decimal places, and it will work with either broken or non-broken
> printf/sprintf implementations. You would invoke this routine as
> follows: $roundedString = round($number, $numberOfDecimalPlaces);
>
> $sprintfIsBroken = undef; # must be a global
> sub round {
> my $number = shift;
> my $dp = shift;
> unless (defined($sprintfIsBroken)) {
> # Only gets invoked once.
> my $tempResult = sprintf("%.2lf", 10.0 / 6.0);
> $sprintfIsBroken = ($tempResult =~ m/7$/ ? 0 : 1);
> }
> if ($dp < 0) {
> # Treat negative dp's as no dp's.
> $dp = 0;
> }
> my $fmt = "%.$dp" . 'lf';
> if ($sprintfIsBroken) {
> $number += ('.' . ('0' x $dp) . '5');
Correction: $number += (($number < 0 ? '-.' : '.') . ('0' x $dp) . '5');
> }
> return (sprintf($fmt, $number));
> }
>
> There are ways to jam this routine into a smaller number of
> statements, but I deliberately did it this way to aid in the clarity
> of this example.
>
> I hope this helps.
>
> > Chocolate wrote in message ...
> > >I don't nor will I have access to the web for about a week or two so I
> > >would really appreciate it if someone would tell me how to round to 2
> > >decimal point. I don't know how much different it will be but I am not
> > >too familiar with perl5.
--
Lloyd Zusman
ljz@asfast.com
------------------------------
Date: Tue, 14 Apr 1998 08:10:09 -0400
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: Confused - pod and man files
Message-Id: <35335221.3901@gecm.com>
Bob Trieger wrote:
>
> It is very annoying that the text just rolls off the dos window and you
> can't scroll back for it. So, I usually output it to a temp file and
> then read the file with notepad or whatever.
You can increase the buffer size of your dos window to have a scrollable
display: start|settings|control panel|console|options. Can also pipe to
more: perldoc -f print | more, but no page up feature.
Cheers,
Jim
------------------------------
Date: Tue, 14 Apr 1998 12:55:29 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Converting a scalar data to ACII format.
Message-Id: <35335E38.35CF@min.net>
Martien Verbruggen wrote:
>
> Use localtime() in a scalar context:
>
> my $time = time();
> my $time_text = localtime($time);
> print "$time_text\n";
Actually, I believe Data::Dumper takes scalar refs too, so
this will do the job:
use Data::Dumper;
$data = 'data';
print Data::Dumper->Dump([\$data],['data']);
;-)
John Porter
------------------------------
Date: Tue, 14 Apr 1998 15:09:57 GMT
From: romei@sprynet.com
Subject: Error number Help wanted
Message-Id: <6gvk5e$sf2$1@juliana.sprynet.com>
Hi,
I'm writing a perl pgm in perl 5.001 in a unix envir and keep getting
a "error number 8" in my system error log. I can find no reference to
any error numbers anywhere.
If you know what this error is or where I can get a list of error
numbers, I sure would appreciate it.!
Thanks
Russ
------------------------------
Date: Tue, 14 Apr 1998 15:15:56 +0200
From: "Hakon Steinx" <hakon@netbureauet.dk>
Subject: Getting the name of an SMTP server
Message-Id: <3533618B.B329E112@netbureauet.dk>
How does one get the name of an SMTP server from the network name in an
email address ?
E.g. My own address is "hakon@netbureauet.dk", but my mailserver's name
is "mail.netbureauet.dk" (and several other aliases).
I want to do this in order to verify email addresses. In order to do
this i need to connect to the remote host and ask him.
If any of you know of a way to find the name for a particular server in
a network, providing a particular service (in this case MX) - or of
another way to verify addresses, i'm grateful.
- Hakon
------------------------------
Date: Tue, 14 Apr 1998 07:40:57 -0400
From: "Alan McCoy" <a.r.mccoy@larc.nasa.gov>
Subject: HELP: Trying to create a search application
Message-Id: <6gvi7g$mn0$1@reznor.larc.nasa.gov>
We have several researchers here who currently have to search through
several different formats of information, such as html documents,
subscription-based databases, and Usenet groups. I was told that using a
few specific CGI/Perl libraries, I can write a collection of scripts that
would perform parallel searches across web sites, structured databases, and
newsgroups, using a single query form interface.
There is, however, an obstacle regarding accessing the databases. We have
subscriptions to several different technical journal databases, all of which
require users to enter a login name and password before allowing them to run
a query. Also, each database has its own distinct query form nestled within
the login procedure.
Is it possible to use Perl or CGI to accomplish these tasks? Here are the
requirements in a nutshell:
1. Present the user with a single query form.
2. Perform parallel web searches across multiple engines. (e.g., Yahoo,
Altavista, Lycos, Infoseek, etc.)
3. Log into multiple subscription-based technical journal databases and
perform search using query data from the form in step 1.
4. Perform search through newsgroups using query data from the form in step
1.
5. Collect results from sources mentioned in steps 2 through 4.
6. Remove duplicate results and collate into a condensed list or results
which are presented to the user.
Please let me know if this is possible. Any help with this would be greatly
appreciated.
Alan McCoy
a.r.mccoy@larc.nasa.gov
------------------------------
Date: Tue, 14 Apr 1998 08:57:27 -0400
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: HELP: Trying to create a search application
Message-Id: <35335D37.43C5@gecm.com>
Alan McCoy wrote:
> subscription-based databases, and Usenet groups. I was told that using a
> few specific CGI/Perl libraries, I can write a collection of scripts that
> would perform parallel searches across web sites, structured databases, and
> newsgroups, using a single query form interface.
You need "Web Client Programming With Perl".
>
> There is, however, an obstacle regarding accessing the databases. We have
> subscriptions to several different technical journal databases, all of which
> require users to enter a login name and password before allowing them to run
> a query. Also, each database has its own distinct query form nestled within
> the login procedure.
>
> Is it possible to use Perl or CGI to accomplish these tasks? Here are the
> requirements in a nutshell:
>
> 1. Present the user with a single query form.
Tk/Tcl front end. Example in the book mentioned above.
> 2. Perform parallel web searches across multiple engines. (e.g., Yahoo,
> Altavista, Lycos, Infoseek, etc.)
LWP module would help here.
> 3. Log into multiple subscription-based technical journal databases and
> perform search using query data from the form in step 1.
What kind of interface? Do they telnet to the server or use a web-based
query or dial in? How are the result sets delivered?
> 4. Perform search through newsgroups using query data from the form in step
> 1.
LWP could be used to query dejanews. Parse result set then retrieve the
articles.
> 5. Collect results from sources mentioned in steps 2 through 4.
> 6. Remove duplicate results and collate into a condensed list or results
> which are presented to the user.
If you can define what makes a result unique, then use a hash to store
unique results as the keys.
Sounds like fun.
Cheers,
Jim
------------------------------
Date: Tue, 14 Apr 1998 11:34:31 +0200
From: Denis DORR <dorr@cetrel.lu>
Subject: How could I improve my perl script's speed ?
Message-Id: <35332DA7.82617278@cetrel.lu>
Hi,
I have to write a script to erase all data on hard disks.
I've written the following one that does the job, but it takes more than
40 minutes for a 2Gb disk.
I think there must be a one-liner that would do it in a couple of
seconds, but I cannot figure out how.
(rem : I've read :
perldoc perlre
perldoc perlop
perldoc perfunc
perldoc perlfaq6
& the camel book
and still doesn't see The Light ...)
#!/usr/local/bin/perl
$disk = @ARGV[0];
$disk =~ s,.*/,,;
$disk = "/dev/rdsk/".$disk;
$crypt_key = "change_on_install";
print"Cleaning disk $disk\n";
#
# Writing data to disk
#
$repeat=1024 * 1024;
open CRYPTDD, "| crypt $crypt_key | dd bs=8k of=$disk" or die "Cannot
fork : $!\n";
while ( true ) {
print CRYPTDD pack ("c64", 33..96) x $repeat ;
}
close CRYPTDD ;
Any suggestion/comment/(constructive)flame is welcome.
Thanks.
--
dorr@cetrel.lu
------------------------------
Date: 14 Apr 1998 12:12:01 GMT
From: e75727@vilkku.uwasa.fi (Tony Christian Svderudd)
Subject: How to read systemcommand value to a variable?
Message-Id: <6gvjqh$3nb$1@verkko.uwasa.fi>
So how should I do this in order to get it work?
I tried..
$a=system("finger|grep 75727");
but it doesn't work. It only executes the finger command but
doesn't put the value of it to $a.
Does anyone know how this should be done?
tony -- e75727@uwasa.fi
------------------------------
Date: Tue, 14 Apr 1998 08:30:14 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: How to read systemcommand value to a variable?
Message-Id: <6gvk35$hu8@fridge.shore.net>
Tony Christian Svderudd wrote in message <6gvjqh$3nb$1@verkko.uwasa.fi>...
>So how should I do this in order to get it work?
>I tried..
>
> $a=system("finger|grep 75727");
>
>but it doesn't work. It only executes the finger command but
>doesn't put the value of it to $a.
Use backticks, like this:
$a = `finger|grep 75727`;
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: Tue, 14 Apr 1998 06:03:29 -0400
From: "Bob Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: i want to learn Perl. HELP!
Message-Id: <6gvcbv$qdr$1@gaia.ns.utk.edu>
If you are looking for a freebie to get you started, in addition to Chris
Nandor's book which mentioned by Tom Phoenix, you might try Perl 5
Complete_ available at:
http://www.pbg.mcgraw-hill.com/betabooks/peschko/peschko-home.html
Despite what the others say about the Camel & Llama books, I've found that
Jon Ormont's Perl 5 Interactive Course is the best all around tutorial.
Make sure to get the second (certified) edition, however. The first is full
of editorial errors.
Then there's The Complete Perl Training Course With Book by Ellie Quigley.
It's not yet available and will cost $90. Go for Ormont's book, but also
invest in the Camel & Llama. If you are interested in Web client
programming, try the Abigail book (Web Client Programming with Perl, by
Clinton Wong).
Bob Gwynne
University of Tennessee
bernie wrote in message <6gu8g7$h7v$1@news0-alterdial.uu.net>...
>i have been into the Internet for a while but, only have learned HTML.
> i thought that i chould expand my learning to Perl but, i don't know how
to
>get started.
>if anyone knows of any sites that could help me or books please tell me, i
>would be very greatful.
>
>
------------------------------
Date: Tue, 14 Apr 1998 12:48:34 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Ideas for installations
Message-Id: <35335C9C.181@min.net>
Grinch wrote:
>
> If you're not looking for code, you won't get much help from a
> language-specific newsgroup.
That's a bad attitude. In general, if you're simply looking for
code, you won't be well-received here. We don't do homework.
OTOH, if you're looking for help with the perl language, which
help might come in the form of code, welcome.
John Porter
------------------------------
Date: Tue, 14 Apr 1998 06:38:34 -0400
From: "Grinch" <grinch@whoville.com>
Subject: Re: info on cookies
Message-Id: <6gvdhs$b3v@fridge.shore.net>
Gilles Chong wrote in message <35332C56.7433130D@csah.com>...
>im playing with cookies for the moment.
Better than losing them. :-)
>But im stuck when it comes to getting the
>cookie and reading it in Perl.
Check out the CGI::Cookie module
If you don't have it, you can get it from CPAN, at <URL: http://www.perl.com
>
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: Tue, 14 Apr 1998 06:34:13 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: make perl program start with icon
Message-Id: <6gvokc$48h@bgtnsc02.worldnet.att.net>
Denis Goddard wrote in message <35330493.6AB91712@us.oracle.com>...
>Frank wrote:
>>
>> On Mon, 13 Apr 1998 03:37:10 -0800, ~arthur <star@sonic.net> wrote:
>>
>> >How can one get a Perl program to start off of an Icon on the desk
top.
>> >
>> (this is a Windows question - try asking in a windows group.)
>
>Ouch! :-)
>Well, just to be a crude, here's one way:
>take the file, "myscript.pl" (or "myscript.bat" if you've done a pl2bat
>on it)
>and copy it to the desktop (C:\windows\desktop or
>C:\winnt\profiles\<user>\desktop)
If you're going to run the script you want to make a shortcut to it on
the desktop. If you're still editing it you might want to move the
script to the desktop so you can get to it faster, or make a shortcut
that opens it in your editor, e.g. notepad c:\myperl\myscript.pl).
If you give perl.exe its own icon (I don't think it ships with one) and
associate .pl files with perl.exe in Explorer, you'll see that Perl icon
in any shortcuts you create to .pl files.
Email me if you need to know how to do these things, since they are
*definitely* not Perl questions.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
------------------------------
Date: Tue, 14 Apr 1998 06:20:23 -0400
From: "Bob Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: May can you help, please?
Message-Id: <6gvdbm$r9p$1@gaia.ns.utk.edu>
It's all explained in Web Client Programming with Perl by Clinton Wong,
otherwise known as the Abigail book (the one with a drawing on the cover of
Abigail devouring a newbie).
Bob Gwynne
bjf wrote in message <892202490.7262.0.nnrp-06.c2de5b4a@news.demon.co.uk>...
>Hello all :-)
>
>First of all, I want to thank to those who answer to my questions ...
>
>All I need the code to do is, to see if the URL is out there or not. But,
>this code doesn't work
------------------------------
Date: Tue, 14 Apr 1998 13:45:33 +0200
From: lassehp@imv.aau.dk (Lasse =?ISO-8859-1?Q?Hiller=F8e?= Petersen)
Subject: Re: MKDIR problem
Message-Id: <lassehp-1404981345340001@hoeder.imv.aau.dk>
In article <slrn6injn4.9cc.gabor@vnode.vmunix.com>, gabor@vmunix.com
(Gabor) wrote:
>In comp.lang.perl.misc, Lasse Hillerxe Petersen <lassehp@imv.aau.dk> wrote :
># In article <Pine.GSO.3.96.980407173416.1034U-100000@user2.teleport.com>,
># Tom Phoenix <rootbeer@teleport.com> wrote:
>#
># > "A program is written for the computer to interpret, and for the human
># > to interpret as well. We hope that they will agree on its meaning!"
>#
># Well said. Anyway, I have been corresponding with BJF, and it turns out
># the problem was probably that the permissions given with mkdir are subject
># to the umask setting. An explicit chmod afterwards is necessary. I'm a
># little surprised noone has mentioned this yet?
>I have two reasons for you.
>1. You should know these things
What's your first point, please? (What are you trying to
express/imply/insinuate?)
>2. And here is the kicker, it's mentioned on page 187 of the blue
> camel
What's your second point, please? (What are you trying to
express/imply/insinuate?)
-Lasse
------------------------------
Date: Tue, 14 Apr 1998 09:08:40 -0400
From: Jay Flaherty <fty@utk.edu>
To: Grinch <grinch@whoville.com>
Subject: Re: Need a Free Perl Data Base to the Web
Message-Id: <35335FD8.AA8FB562@utk.edu>
Grinch wrote:
> smile_ wrote in message <3531F265.4950AEDD@cindy.fe.up.pt>...
>
> >Need a Free Perl Data Base to the Web, if you can help me send me one.
>
> If you're working for an educational or non-profit organization, mSQL is
> free. You can find it at <URL: http://www.hughes.com.au >.
You should also look at mySQL which more broadly "free" as well as being way
faster and in my opinion, more stable and robust. Go to www.mysql.com...jay
------------------------------
Date: Tue, 14 Apr 1998 12:41:40 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl 5.004_64 Slower???
Message-Id: <35335AFD.56CF@min.net>
Bill 'Sneex' Jones wrote:
>
> Given the following code -
>
> #!perl -w
> use strict;
> use diagnostics;
>
> my $string = "This is a simple string.";
> my $retStr = '';
> my $chopAmt = 4;
>
> $retStr = substr(reverse($string), 0, (0 - $chopAmt));
> $retStr = reverse($retStr);
>
> print "$retStr\n", (0 - $chopAmt), "\n";
>
> Why is it SO SLOW???
1. How do you know it's slow? What's your basis of comparison?
What are your times? Did you even "use Benchmark"?
2. Did you try eliminating or isolating sections of code, to
see where the bottleneck might be?
3. Can't you come up with a single wild guess as to where
the bottleneck might be?
4. As someone who knows perl intimately (:-) do you really
think that is the best way to do what you want to do?
(I don't.)
> Is perl 5.004_64 slower???
Than what? What version are you using now? Hint: include
the output of perl -V, or at least perl -v, when you post
a problem like this.
hand,
John Porter
------------------------------
Date: Tue, 14 Apr 1998 09:42:06 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Perl 5.004_64 Slower???
Message-Id: <1d7gws3.47oimm1wyq0e8N@slip166-72-108-104.ny.us.ibm.net>
Bill 'Sneex' Jones <sneaker@earthling.net> wrote:
> John Taylor-Johnston wrote:
>
> > >
> > > #!perl -w
> > > use strict;
> > > use diagnostics;
There's your problem: "use diagnostics;". It takes a long time to load.
Comment that out and your script will run much faster.
> > I assume you are using Macperl!? Right!?
> > It's a Mac server thing. I never liked a mac, but forced to use it.
> > Not much you can do. Macperl runs slower. That's all.
>
> Nope. This is code was tested my RedHat Hurricane P100
> System at home.
I use MacPerl and, after commenting out "use diagnostics;", the script
runs in about .25 seconds.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 14 Apr 1998 10:47:33 GMT
From: cmorgan@aracnet.com (Clark Morgan)
Subject: Re: perl win 32 : asterisk on command line
Message-Id: <6gves5$7di$1@spitting-spider.aracnet.com>
In article <352f1e93.2237112@news.zip.com.au>,
Excession <dac@NOSPAM.pcug.org.au> wrote:
>spawn() is the Windows C function I'd have thought that the Perl porters
>would have used as an alternative to fork(). Perhaps there are good
>reasons why spawn() isn't equivalent to fork()?
Yep!
Anyone with access to the VC++ CD can install the sources for
MS's C runtime library. If you browse the file vc/crt/src/dospawn.c,
you'll see that spawn is nothing but a tricked up call to
CreateProcess(). Bwahahahaha.
I've actually endured the agony of porting vi's "filter" feature
(elegantly effected on Unix with fork and exec) to Win32. That's
an experience I won't soon forget.
Here's a hint: WNT == ++VMS . Literally. Dave Cutler created VMS,
then he rewrote it as WNT.
Ever used VMS? It's a step above DOS. Barely.
--
Clark O. Morgan cmorgan@aracnet.com
------------------------------
Date: Tue, 14 Apr 1998 13:51:35 +0100
From: boneil@nothanks.cableinet.co.uk (Barry O'Neill)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <MPG.f9d6baf1030122298977d@news.cableinet.co.uk>
In article <6gtb5m$auu$1@halcyon.com>, tzs@halcyon.com says...
> In article <6gm3rj$gjb$1@nnrp1.dejanews.com>, <harman@omsi.com> wrote:
> > Think not only of other "programmers" but of other "users" who would use the
> > software produced by those programmers.
>
> If I release something to the public domain:
You are essentially giving away your code for anyone to use as they
please, with no restrictions. To do such a thing would indicate you
hold your code in either extremely high or extremely low regard. If the
former, you should consider protecting your code with licensing to enable
others to benefit from its availability and source code. Paradoxically,
in the latter instance, you should also place similar protection on your
code.
> (1) Those other users are free to get it and use it. If, say, Microsoft takes
> a copy of my public domain code and puts it in something proprietary, it in
> no way lessens the freedom of the public domain code. People often point
> out when arguing in favor of free software that copying software does not
> harm anyone, because it does not take away from the original. That exact
> same point applies when something free is used in something non-free: it does
> not take away from the original. (Well, if the proprietary program is so
> much better than the free program, it kills user interest in the free program,
> and so the developers give up, then the proprietary program could be said to
> have harmed the free program, but if the free program is that easily killed,
> then who cares?)
Those who would support the free/libre software ethos for a start; the
original author; anyone who would have been prepared to contribute to the
further development of the free program. Plus any potential users of the
free program.
>
> (2) If by having something free of mine in the proprietary code, the
> proprietary product is improved, I have helped the users of that proprietary
> product.
Not really. You *have*, however, helped the vendors of the proprietary
product by ensuring *they* profit from your work, which of course you are
free to do. It does seem a rather strange way to operate though.
regards,
Barry
--
"Humour is *such* a subjective thing, don't you think Mollari?" - Emperor
Cartagia, Babylon 5
------------------------------
Date: Tue, 14 Apr 1998 09:42:09 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Tip: How to selectively quiet warnings
Message-Id: <1d7gx3a.1uhqz1419kcc3oN@slip166-72-108-104.ny.us.ibm.net>
Tom Phoenix <rootbeer@teleport.com> wrote:
> On Mon, 13 Apr 1998, Denis Goddard wrote:
>
> > foreach ( @ary ) {
> > /Created user "[^"]*" with password "[^"]*"/ && {
> > $username = $1; $passwd = $2;
> > }
> > }
>
> Do you see that the right arg to && is going to be an anonymous hash
> constructor? :-) Don't obfuscate; write out a real if statement!
>
> > "Useless use of scalar ref constructor in void context at my_prog line
> > 5"
>
> Yep, that's the anonymous hash constructor. Hope this helps!
But that doesn't explain why my trick didn't turn off the warning.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Tue, 14 Apr 1998 13:28:52 GMT
From: mibadt@rafael.co.il (Michael Badt)
Subject: using perl scripts from C++
Message-Id: <3533642b.2026842@news.netvision.net.il>
Does anyone know where I can get information, or sample programs for
calling perl scripts from code writtem in C++, and what setups do I
have to make in my C++ project for activating it ?
Thanks,
------------------------------
Date: Tue, 14 Apr 1998 13:31:26 GMT
From: rob@frii.com (Rob Greenbank)
Subject: Which Win32 Perl
Message-Id: <35336299.320098218@news.frii.com>
I noticed the other day there are now two choices (besides building it
yourself) for Perl on the Win32 platform, both with links on the page
"www.perl.com/latest.html".
I've read the description of the differences between "Active State"
and "Gurusamy Sarathy's" versions. I like the sounds of GS's, but
before I blow away my "Active State" version I'd like to know if
anyones had any problems with GS's. Also, anyone had problems
switching between the versions?
Thanks,
Rob Greenbank
(rob@frii.com)
------------------------------
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 2316
**************************************