[8810] in Perl-Users-Digest
Perl-Users Digest, Issue: 2427 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 27 11:07:08 1998
Date: Mon, 27 Apr 98 08:00:41 -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 Mon, 27 Apr 1998 Volume: 8 Number: 2427
Today's topics:
Re: "Slurp"? <irsan@tcf.nl>
Re: "Slurp"? <jdf@pobox.com>
Re: "Slurp"? <ragoff@sandia.gov>
Re: == vs. eq (Abigail)
Re: Berkeley DB support (Charles Ball)
Re: books for learning perl <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Can't find certain libraries in path <bmb@ginger.libs.uga.edu>
Re: Changing @INC (Abigail)
convert an @array into a single $variable? <bth@acsu.buffalo.edu>
Re: convert an @array into a single $variable? <bmb@ginger.libs.uga.edu>
Re: Defending Perl <jdporter@min.net>
Dynamic Linker? (Craig Nelson)
File locking using Fcntl <cdm2@formalsys.ca>
Re: File locking using Fcntl <jdf@pobox.com>
Re: foreach question <jdporter@min.net>
GDBM_File module bthak@bascom.com
Hello people, want to learn Perl ? (Mattias Pihlstrvm)
Re: HELP! PerlScript <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: If you solve this your are FANTASTIC! and it's some <webmaster@fccjmail.fccj.org>
Re: image size for jpg and/or gif <jdf@pobox.com>
Re: Implementing sh in perl (Jonathan Stott)
Re: o-modifier <jdf@pobox.com>
Re: o-modifier <bmb@ginger.libs.uga.edu>
Re: Perl classes or training (Andrew M. Langmead)
Re: Perl classes or training (Andrew M. Langmead)
Perl for ISAPI and Registry Problem(NT) <perry@twowaycom.com>
Print Currency tanr@vancpower.com
Re: Print Currency <qdtcall@esb.ericsson.se>
Re: Print Currency <jdporter@min.net>
Re: Question on sorting <bmb@ginger.libs.uga.edu>
Re:How to save an external program output in a var? Tha <yong@shell.com>
Re: removing spaces (Mattias Pihlstrvm)
Re: removing spaces <webmaster@fccjmail.fccj.org>
Re: RMS should be invited to O'Reilly's "Free Software nathanh@chirp.com.au
Re: RMS should be invited to O'Reilly's "Free Software nathanh@chirp.com.au
Re: RMS should be invited to O'Reilly's "Free Software nathanh@chirp.com.au
Re: win32::registry (queryvalue) (Preston L. Bannister)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 27 Apr 1998 15:25:28 +0200
From: "Irsan Widarto" <irsan@tcf.nl>
Subject: Re: "Slurp"?
Message-Id: <6i213o$daf$1@news2.xs4all.nl>
DESCRIPTION
File::Slurp just reads and writes entire files with single commands
at http://theory.uwinnipeg.ca/CPAN/data/File-Slurp/ or your local CPAN.
Regards,
Irsan.
root wrote in message ...
>
>I vaguely remember seeing a technique once where an entire input file
>is read in with a single command, carriage returns and all. My poor
>memory also seems to think it was called "slurping" the file, but I
>cannot find any reference to it in the camel book, the newsgroup, or
>the FAQ. Is there such a thing. If so, how is it done (and what is
>it really called)?
>
>Thank you.
>
>--
>John Guthrie
------------------------------
Date: 27 Apr 1998 09:34:12 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: root <jimmer@charm.net>
Subject: Re: "Slurp"?
Message-Id: <hg3fgwpn.fsf@mailhost.panix.com>
[posted and mailed]
root <jimmer@charm.net> writes:
> I vaguely remember seeing a technique once where an entire input file
> is read in with a single command, carriage returns and all.
You want the $/ variable, which is documented in perlvar. It's also
called $INPUT_RECORD_SEPARATOR in English. Just so you don't feel bad
about not being able to find this information in the docs yourself, I
*already know* this variable (and use it all the time), but couldn't
figure out a way to find it in the docs without searching for "$/"
itself. Maybe DejaNews will be some help to you next time... Hope
this helps.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Mon, 27 Apr 1998 08:28:33 -0600
From: Robert Goff <ragoff@sandia.gov>
Subject: Re: "Slurp"?
Message-Id: <35449611.906639EB@sandia.gov>
open(IN, 'filename') or die "Could not open filename: $!";
@wholefile = <IN>;
Ok, so it's two statements, but no one else's was just one either.
--
=================================================
Robert Goff email: ragoff@sandia.gov
Sandia National Labs Phone: (505)284-3639
------------------------------
Date: 27 Apr 1998 14:32:05 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: == vs. eq
Message-Id: <6i24t5$6nq$1@client3.news.psi.net>
Kelby Valenti (kelby@mplx.com) wrote on MDCXCVIII September MCMXCIII in
<URL: news:6hthfs$g7r@aaron.hamilton.edu>:
++ What exactly is the difference between == and eq in an if statement. Also
++ is there a function that can tell me whether a string is numbers or chars.
If you are able to read, both question are answered in the
documentation bundled with Perl.
If you can't read, answering the question on Usenet is pointless.
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
Date: 27 Apr 1998 12:54:36 GMT
From: cball@bu.edu (Charles Ball)
Subject: Re: Berkeley DB support
Message-Id: <6i1v6c$17b$1@news1.bu.edu>
Jim Levie (Jim.Levie@dynetics.com) wrote:
: Where do I find support for Berkely DB 2.x.
:
: There isn't a module listed on CPAN for it, and the only references to
: it that I've located so far (www.sleepycat.com) claims that "DB_File
: and Berkeley_DB" are only distributed with the standard Perl source
: distribution.
:
: I've got perl 5.004_04 and I don't see Berkeley_DB in it anywhere, and
: as I would expect DB_File is less than thrilled with the header files
: from db-2.3.16.
I just tracked this down Friday, myself. It's in CPAN, but only keyed by
author in the CPAN archive that I frequent. Also, the module is
"BerkeleyDB-0.02", not Berkeley_DB as indicated on sleepycat.
Try .../CPAN/authors/Paul_Marquess/BerkeleyDB-0.02
--
Charles Ball
Information Technology
Boston University
------------------------------
Date: Mon, 27 Apr 1998 06:30:41 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: books for learning perl
Message-Id: <6i2190$o34@bgtnsc02.worldnet.att.net>
Andrew M. Langmead wrote in message ...
>doswald@xmission.com (David Oswald) writes:
>
>>There are a lot of great books on Perl; Perl for Dummies isn't really
>>one of them. For that matter, .*\s[fF]or\sDummies isn't generally the
>>best book on any given subject. It's only the book with the brightest
>>colored cover. You can't judge a book by its cover.
>
>I was happy with the book "Wine for Dummies." It was certainly a lot
>less dry (pun unintended) than many other books on the subject.
>
>Their computer books, as I whole, I stay away from.
>
>--
>Andrew Langmead
I may be the only person, other than the millions who have bought them
and use them, who actually likes the Dummies books. I agree that they
are not *great* *books*. I am also painfully aware that they have their
limitations, as you will be when you first try to look up something that
isn't in them. But they're good introductions to the subject. Macs for
Dummies got me started when I first found myself thrust into the Mac
world as part of my job (up until then I'd never so much as touched a
Mac), and I'm using TCP/IP for Dummies to help me study for the
Microsoft certification exam. And, they're a lot less expensive than
many other books out there.
Perl5 for Dummies is an adequate reference. It won't teach you how to
write programs (it assumes you can already program in something else).
It won't teach you how to write packages, on the (correct) assumption
that writing packages is outside the realm of Dummydom. You might not
like the intended humorous tone. I would never recommend it as anyone's
first or only Perl book. But I still keep a copy at my desk.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
------------------------------
Date: Mon, 27 Apr 1998 10:30:09 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Can't find certain libraries in path
Message-Id: <Pine.A41.3.96.980427102848.11866C-100000@ginger.libs.uga.edu>
'/lib/blib/' vs. '/blib/lib/' maybe?
On Mon, 27 Apr 1998, Salvatore Sferrazza wrote:
> use lib '/home2/salzie/lib/libwww-perl-5.31/lib/blib';
> in my home directory I get:
> ./lib/libwww-perl-5.31/blib/lib/auto/LWP/UserAgent/_need_proxy.al
---
Brad Baxter, UGA
------------------------------
Date: 27 Apr 1998 14:55:36 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Changing @INC
Message-Id: <6i2698$72h$2@client3.news.psi.net>
Grimes (grimes@msn.com) wrote on MDCXCIX September MCMXCIII in
<URL: news:6huob9$t13$1@nntp2.ba.best.com>:
++ How do I change the default @INC list of paths?
++
++ I'm running Win32 Perl 5.004. I've searched through the installed files to
++ see where this is set up but cannot find it. I've also searched registry
++ keys, INI files, etc.
I guess you haven't checked the manual. That might be a better place
to start than registry keys and INI files. After all, Perl was born
in the Unix world, not in M$ hell.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
------------------------------
Date: Mon, 27 Apr 1998 09:32:51 -0400
From: Bryan T Hoch <bth@acsu.buffalo.edu>
Subject: convert an @array into a single $variable?
Message-Id: <Pine.GSO.3.96.980427093122.14673A-100000@hercules.acsu.buffalo.edu>
Hi, does any one know how to take the seperate elements of an
array an pass them all as a string into a single variable?
Thanks in advance.
Bryan H
------------------------------
Date: Mon, 27 Apr 1998 10:56:29 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: convert an @array into a single $variable?
Message-Id: <Pine.A41.3.96.980427105356.11866E-100000@ginger.libs.uga.edu>
On Mon, 27 Apr 1998, Bryan T Hoch wrote:
> Hi, does any one know how to take the seperate elements of an
> array an pass them all as a string into a single variable?
> Thanks in advance.
> Bryan H
Yes. ;-)
---
Brad Baxter, UGA
ps: 'join' is one answer.
------------------------------
Date: Mon, 27 Apr 1998 13:30:07 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Defending Perl
Message-Id: <354489C9.56E0@min.net>
Ilya Zakharevich wrote:
>
> Of course, *if*
> $/ eq "\n",
> *and*
> you know what is the maximal length of your input lines,
>
> the C library can do the same tricks as Perl does, and you can
> optimize you C code to skip some of the things Perl does. In such a
> case C will win.
Actually, if one assumes those two things, then C is faster by an
order of magnitude, without using any tricks or optimizations at all.
I showed you the code and the benchmarks.
> With an arbitrary $/ I would think it is very hard to write a portable
> C which would be as quick as Perl.
"I would think"? Sounds like speculation.
John Porter
------------------------------
Date: 27 Apr 1998 14:05:05 GMT
From: cnelson@127.0.0.1 (Craig Nelson)
Subject: Dynamic Linker?
Message-Id: <6i23ah$p60$1@clarknet.clark.net>
Can someone give me a starting point to research the following error:
install_driver(Oracle) failed: Can't load
'/usr/local/lib/perl5/site_perl/AViiON-dgux/auto/DBD/Oracle/Oracle.so' for
module DBD::Oracle: dynamic linker: /usr/bin/perl: relocation error:
symbol not found: sys_nerr at
/usr/local/lib/perl5/AViiON-dgux/5.00404/DynaLoader.pm line 166.
I've searched the Perl Docs, and can't find anything that helps me even
start to research this problem! I am using the Oracle DBD and trying to
connect to a Oracle 7.3 database. Has anyone seen the above error before?
--
Craig Nelson
cnelson[at]clark.net
Jacksonville, Florida
------------------------------
Date: Mon, 27 Apr 1998 10:34:53 -0300
From: Craig Morris <cdm2@formalsys.ca>
Subject: File locking using Fcntl
Message-Id: <3544897D.1ECB0E92@formalsys.ca>
Good morning, or afternoon depending on where you are.
I'm trying to institute a file lock but I'm unsure of the syntax
with respect to fcntl(). I know I have to pass a filehandle, a
function, and a scalar
but I'm unsure as to the purpose and content of the function and scalar
parameters.
Any help would be appreciated.
Regards,
Craig Morris
------------------------------
Date: 27 Apr 1998 10:58:49 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Craig Morris <cdm2@formalsys.ca>
Subject: Re: File locking using Fcntl
Message-Id: <iunvl0hy.fsf@mailhost.panix.com>
[posted and mailed]
Craig Morris <cdm2@formalsys.ca> writes:
> I'm trying to institute a file lock but I'm unsure of the syntax
> with respect to fcntl().
The Fcntl module is used primarily as a source of mnemonic constants.
You use the perl flock builtin to lock a file. Please see perlfaq5,
"How can I lock a file," and
perldoc -f flock
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Mon, 27 Apr 1998 13:39:05 GMT
From: John Porter <jdporter@min.net>
Subject: Re: foreach question
Message-Id: <35448BE3.2A25@min.net>
Gilly (kEQNql) wrote:
>
> >you want, but it can be a problem if the resulting list takes
> >up an unexpectedly large amount of memory. An alternative is
>
> Thank you, so if @filelist contains 10,000 files(about 10,000 size
> of array) then will it be beter to sort before?
No, in this case, you're going to have to have a second array
to hold the sorted list, whether it's a named variable or not.
for ( sort @a )
is fine.
Another consideration, however, is that if you're going to need
the sorted version for more than just this loop, you're better
off storing it in a variable, so you don't have to do the
expensive sort more than once.
hth,
John Porter
------------------------------
Date: Mon, 27 Apr 1998 09:42:40 -0600
From: bthak@bascom.com
Subject: GDBM_File module
Message-Id: <6i25h0$kip$1@nnrp1.dejanews.com>
I was wondering if there was any help on creating GDBM database files using
the GDBM module. More than what the man page has. Preferrably on win32
platform. A web site or a book would be helpfull. Thanks.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 27 Apr 1998 13:12:53 GMT
From: mm@c64.org (Mattias Pihlstrvm)
Subject: Hello people, want to learn Perl ?
Message-Id: <354483ec.22641534@news.ericsson.se>
I am working as a freetime WEBMASTER on www.c64.org, www.c64.com,
www.c64.net and www.c64.nu
I need some perl programmers to help me out, no money involved, just
friendship, and doing things to learn from it.
I have some tasks for you, so mail me right away if you are
interested.
/Mattias.
AKA Metal Maniac of Dual Crew Shining (http://www.dc-s.com)
------------------------------
Date: Mon, 27 Apr 1998 06:32:52 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: HELP! PerlScript
Message-Id: <6i21d3$ove@bgtnsc02.worldnet.att.net>
Nervick wrote in message <3543b218.0@news.bewellnet.com>...
>Does anyone know where I can find documentation on PerlScript?
>
>
Check the ActiveState web site (http://www.activestate.com).
------------------------------
Date: Mon, 27 Apr 1998 14:47:08 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: If you solve this your are FANTASTIC! and it's something real simple (I think)
Message-Id: <354498C4.2EF5A31A@fccjmail.fccj.org>
stevenf@pcdynamics.nl wrote:
> <form method=POST action="/cgi-bin/test.pl">
> <input type="Submit" name="submit" value="Submit">
> <input type=hidden name="picture" value="test.gif">
> <input type=hidden name="text1" value="This is a cool picture">
> <input type=hidden name="text2" value="It's a 325td BMW ">
> So that it will make a new HTML page with the picture and some text.
> This shouldn't be to difficult, but I'm very very new to Perl.
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
I solved this problem in the CGI news group already.
Look up all 'Sneex' posts at www.dejanews.com; Look for 'CGI 101'.
HTH,
-Sneex-
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
------------------------------
Date: 27 Apr 1998 09:20:09 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: image size for jpg and/or gif
Message-Id: <lnsrgxd2.fsf@mailhost.panix.com>
"Henry Wolff" <admin@hatsoft.com> writes:
> Since I could not for some reason get the Image::Size module to make
> I did some research and came up with a good script which I modified
> to do just the jpeg and gif sizes.
Perhaps you could share with us the errors you encountered while
trying to install Image::Size. That way, someone here may be able to
solve your difficulty, or perhaps the package maintainer will be
informed of a bug or porting problem. Followups set.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: 27 Apr 1998 14:55:30 GMT
From: jstott+usenet@poly.phys.cwru.edu (Jonathan Stott)
Subject: Re: Implementing sh in perl
Message-Id: <6i2692$qbk$1@pale-rider.INS.CWRU.Edu>
In article <Pine.GSO.3.96.980425190915.18328A-100000@area51>,
David Lee Lambert <lamber45@EGR.msu.edu> wrote:
>I'm thinking of writing a replacement Bourne shell in perl. Has anyone
>else already done this, or tried to?
[...]
> Is there some reason why this cannot be done in
>perl?
Quite possibly. Check perlfunc(1) a bit more closely. In particular,
look at how Perl handles calls to exec() and open() with shell
meta-characters in the argument.
-JS
--
Jonathan Stott xxxxxxxxxxxxxxxxxx jstott@poly.cwru.edu
CWRU Dept. of Physics <fakeaddr@poly.phys.cwru.edu>
School of Graduate Studies http://poly.phys.cwru.edu/~jstott/
An optimist is someone who believes Schroedinger's cat is half alive.
------------------------------
Date: 27 Apr 1998 09:25:46 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "Robert Friberg" <robban@it-konsult.com>
Subject: Re: o-modifier
Message-Id: <k98bgx3p.fsf@mailhost.panix.com>
[posted and mailed]
"Robert Friberg" <robban@it-konsult.com> writes:
> for $w (@words){
> $failed++ and last unless /$w/i;
> }
>
> Does anyone have a trick for this?
This is addressed in perlfaq6, "How do I efficiently match many
regular expressions at once?"
> Is there a more perlish equivalent of the following?
>
> $d{'max'} = $maxhits if $d{'max'} > $maxhits;
That's how I'd do it.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Mon, 27 Apr 1998 10:43:20 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: o-modifier
Message-Id: <Pine.A41.3.96.980427104052.11866D-100000@ginger.libs.uga.edu>
> "Robert Friberg" <robban@it-konsult.com> writes:
> > Is there a more perlish equivalent of the following?
> >
> > $d{'max'} = $maxhits if $d{'max'} > $maxhits;
Don't you have that backwards? ... or maybe I'm confused? ... both? :-)
+1 #!/usr/local/bin/perl -w
+2 use strict;
+3
+4 my $maxhits;
+5 my %d = ();
+6 $d{'max'} = 0;
+7
+8 foreach $maxhits ( 1 .. 20 ) {
+9 $d{'max'} = $maxhits if $d{'max'} > $maxhits;
10 } # foreach
11
12 print $d{'max'}, "\n"; ### prints '0'
13
14 foreach $maxhits ( 1 .. 20 ) {
15 $d{'max'} = $maxhits if $d{'max'} < $maxhits;
16 } # foreach
17
18 print $d{'max'}, "\n"; ### prints '20'
---
Brad Baxter, UGA
------------------------------
Date: Mon, 27 Apr 1998 13:17:02 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl classes or training
Message-Id: <Es2q8E.8Jt@world.std.com>
"Bob Gwynne" <gwynne@utkux.utk.edu> writes:
>Randal Schwartz wrote in message <8cbttqnhoh.fsf@gadget.cscaper.com>...
>>>>>>> "Bryan" == Bryan Beske <beske@worldnet.att.net> writes:
>>Sure, but have they written bestselling Perl books? :-)
>>
>Randal:
> Maybe I'm missing something here, but I don't understand your logic.
>Although you have written a couple of Perl books and obviously know a lot
>about Perl, does that necessarily mean that you are a better teacher of Perl
>than someone who knows Perl, but has not written a book on the subject?
Last Saturday, I went to a talk given by Randal. At one point when
talking about the financial drain caused by some of the events in his
life, he told the audience not to think that he was wealthy because he
had written a bestselling technical book. He said that the purpose
purpose of being a technical author was to gain status in the
community, and that the status hopefully leads to jobs that that make
money.
--
Andrew Langmead
------------------------------
Date: Mon, 27 Apr 1998 14:00:00 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl classes or training
Message-Id: <Es2s80.Kvs@world.std.com>
"Bob Gwynne" <gwynne@utkux.utk.edu> writes:
>Randal Schwartz wrote in message <8cbttqnhoh.fsf@gadget.cscaper.com>...
>>Sure, but have they written bestselling Perl books? :-)
>>
>Randal:
> Maybe I'm missing something here, but I don't understand your logic.
>Although you have written a couple of Perl books and obviously know a lot
>about Perl, does that necessarily mean that you are a better teacher of Perl
>than someone who knows Perl, but has not written a book on the subject?
Last Saturday, I went to a talk given by Randal. When talking about
some issues in his life that have caused him some financial hardships,
he told the audience not to think that he was rich because he was an
author or co-author of some bestselling technical books. He said that
technical authors mostly write to gain status in their community and
that the added status hopefully will lead to jobs that will lead to
better money.
Now I know nothing about Randal's or Onsight's training. But I would
say that the book does give some credibility to Randal's ability as an
instructor. (Especially since Randal has said in the past that the
Llama was an outgrowth of his training course.) It shows knowledge in
the subject, and an ability to organize the subject in a coherent
manner for a novice. Also, since according to Randal's web page, he
has been giving Perl courses since 1992, I would assume that he has
had enough satisfied customers to maintain teaching as a business. Also
such a thorough knowledge of the subject at hand (proven by the
books, the posts here, and other sources), does add value to an
instructor. That the instructor will be able to answer any question
given to him is a very valuable asset. (The fact that Randal is
mentioned in the "Changes*" file in the perl distribution shows that
he has worked enough of perl to discover bugs or suggest features that
seemed worthwhile to implement.)
Onsight's Web Page says that the founder created Onsight in 1995. I
guess I feel that is probably long enough to prove their worth as
well. (Well, the cynical side of me may think that maybe there is such
a demand for perl classes that anybody can do it. The year 1995 does
put put you in the start of the WWW craze. I do recognize that the
basis for thoughts like that are entirely prejudicial. I have no
reason to form any opinion one way or another.)
I guess if a friend told me that were going to a class given by some
company that I had never heard of taught by instructors that I had
never heard of, I'd tell them that that was great. I'd have no reason
to doubt that they would get something from it. If they came up and
asked me where to to find a course on perl, I'd probably point the to
Randal's company.
--
Andrew Langmead
------------------------------
Date: Mon, 27 Apr 1998 09:36:58 +0100
From: Perry Moutzouros <perry@twowaycom.com>
Subject: Perl for ISAPI and Registry Problem(NT)
Message-Id: <354443A7.BEB11D1@twowaycom.com>
I need some help here with the registry problem I have encountered.
I have downloaded and followed the FAQ from ActiveState.com for
perlWin32 and Perlfor ISAPI. I installed the NT 4.0 option pack the
other night and perl went to hell!! I reintstalled the service pack for
NT just to make sure... So here is my setup
NT 4.0 running IIS 4.0 with the option pack...build 1381 I believe... I
have the latest versions of perl for isapi and perl for win32.
I can run perl scripts from the command line. No problem. But when I try
to access them thru a browser(aka a CGI script) it blows up. I either
get the infamous save or open dialog box or it just doesnt do anything.
I seem to be missing a key in the registry for Perl for ISAPI because
when I try to remove perl(all of it) I get a message that says it cant
remove the key from the registry(for isapi). You know why? Because it
was never installed...
So what do I do next? Anyone know where I can get instructions to
manually add the key to the registry? Do I need to configure the web
server to handle the *.pl extenstion. Under IIS 4.0, the ISAPI filters
dialog??
Thanks for the help.
Perry
mail me at perry@twowaycom.com
------------------------------
Date: Mon, 27 Apr 1998 08:51:14 -0600
From: tanr@vancpower.com
Subject: Print Currency
Message-Id: <6i22gj$h7v$1@nnrp1.dejanews.com>
What would be the easiest way to print a float number in a currency format
($xx,xxx.xx)? Thanks!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 27 Apr 1998 16:27:09 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: Print Currency
Message-Id: <iswwcbuypu.fsf@godzilla.kiere.ericsson.se>
tanr@vancpower.com writes:
> What would be the easiest way to print a float number in a currency format
> ($xx,xxx.xx)? Thanks!
The one described in part five of the FAQ, probably.
--
Calle Dybedahl, UNIX Sysadmin
qdtcall@esavionics.se http://www.lysator.liu.se/~calle/
------------------------------
Date: Mon, 27 Apr 1998 14:44:37 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Print Currency
Message-Id: <35449B3F.1609@min.net>
tanr@vancpower.com wrote:
>
> What would be the easiest way to print a float number in a currency format
> ($xx,xxx.xx)? Thanks!
The easiest way I know of is to use Mark-Jason's Interpolation
module, available at http://www.PLOVER.com/~mjd/perl/Interpolation/
As an example:
use Interpolation commify => 'commify';
$gross = 666000.42;
print "Total tax: \$$commify{ $gross * 0.28 } \n";
hth,
John Porter
------------------------------
Date: Mon, 27 Apr 1998 10:28:35 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: Question on sorting
Message-Id: <Pine.A41.3.96.980427093503.11866B-100000@ginger.libs.uga.edu>
The first time I used '::' as a field separator, my script began giving
me very bizarre error messages, so I thought I'd share my experiences for
this poster. For example, the following script:
+1 #!/usr/local/bin/perl -w
+2 use strict;
+3
+4 my( $one, $two, $tre ) = split( /::/, 'ONE::TWO::THREE' );
+5 print "$one::$two::$tre\n";
produces the following output:
Use of uninitialized value at /home/bmb/bin/qt line 5.
Use of uninitialized value at /home/bmb/bin/qt line 5.
THREE
which, as we all know now, is because double-colon is a valid package
separator in an identifier. This trap is pointed out in the Camel
book (but of course, it took me an embarrassingly long time to figure
it out).
The answer is to change line five to:
print $one, '::', $two, '::', $tre, "\n";
producing
ONE::TWO::THREE
Now I am curious. The two "Use of uninitialized ..." messages above
make me wonder how perl is interpreting the first quoted string:
"$one::$two::$tre\n";
The following comes to mind, but doesn't really make sense:
Step 1: $tre changed to THREE
Step 2: $two::THREE not initialized, so error message
Step 3: $two changed to TWO
Step 4: $one::TWO::THREE not initialized, so error message
Step 5: $one::TWO::THREE and $two::THREE are null, so print "THREE\n"
The opposite is still sticky:
Step 1: $one::$two looks like a package variable, so look for $one::TWO;
it's not initialized, so error message
Step 2: Likewise with $two::$tre (or $one::TWO:$tre??)
Step 3: $tre changed to THREE and printed
What is perl really doing?
> "Bug" <bugking@usa.net> writes:
> >==== a.txt ====
> >Aqua::Barbie Girl::1
> >Aqua::Doctor Jones::4
> >Aqua::Happy Boys And Girls::3
> >=============
---
Brad Baxter, UGA
------------------------------
Date: Mon, 27 Apr 1998 09:12:25 -0500
From: Yong Huang <yong@shell.com>
Subject: Re:How to save an external program output in a var? Thanks Tom Phoenix & Jim
Message-Id: <35449249.6BBD5CB9@shell.com>
Thanks, gentlemen. Both your solutions work for simple external programs
like this:
#Tom's method
$tmp=qx/ls/; #or $tmp=`ls`;
print $tmp;
or
#I believe this is Jim's
open TMP, "ls|";
while (<TMP>)
{ print;
}
close TMP;
The problem is, what if the command is not a simple ls, instead it's sqlplus
(or if you're not familiar with this database command, think of ftp and
assume there's no Net::FTP
module)? sqlplus or ftp has its own commands to be executed inside its own
environment.
There're two ways to do this in one single script: use here documents (ftp
somewhere.com <<END...END) and use the Perl pipe open (open TMP, "|ftp".)
Since
ftp or sqlplus already uses pipe open, I can't figure out how to combine
this with another
layer of pipe open like we do for "ls" (open TMP, "ls|";). Any more advice?
Thanks.
Yong Huang
--------------------------------------------------------------------------------------
Yong Huang wrote:
Suppose I want to check user login to sqlplus (a program to let you
login to Oracle database):
open SAVEOUT, ">&STDOUT";
open STDOUT, ">mytmpfile" or die "Can't do it"; #Can I not open a file?
open SQL, " | sqlplus $user/$passwd" or die "Can't run it";
...
close SQL; #followed by restore STDOUT...
...
Then I can check the file mytmpfile to see if it contains "Invalid
username". But I want to optimize the code so the string "Invalid
username" is not saved in an external file (which takes time in I/O) but
in a Perl variable. How can I do it? Thanks for any advice.
Yong Huang
Email:yong@shell.com
------------------------------
Date: Mon, 27 Apr 1998 13:37:30 GMT
From: mm@c64.org (Mattias Pihlstrvm)
Subject: Re: removing spaces
Message-Id: <354489e2.24168011@news.ericsson.se>
>--
>Quentin Fennessy AMD, Austin Texas
>Secret hacker rule #11 - hackers read manuals
That was the lamest thing I ever have seen.....
HACKERS do NOT read manauls...
Hackers create the sollutions themselves...
In my eyes you are a lamer...
------------------------------
Date: Mon, 27 Apr 1998 14:36:48 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: removing spaces
Message-Id: <35449659.E39F28D0@fccjmail.fccj.org>
Mattias Pihlstrvm wrote:
>
> >--
> >Quentin Fennessy AMD, Austin Texas
>
> >Secret hacker rule #11 - hackers read manuals
>
> That was the lamest thing I ever have seen.....
> HACKERS do NOT read manauls...
> Hackers create the sollutions themselves...
>
> In my eyes you are a lamer...
Lamer, huh? Hacker's don't read manuals, huh?
The best hackers must be clairevoyent? Huh :-)
Must be nice to just 'know', huh.
In my eyes you are a dreamer...
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
------------------------------
Date: 27 Apr 1998 22:58:35 +1000
From: nathanh@chirp.com.au
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <m3yawrs9ok.fsf@stoli.spirits.org.au>
eugene@cs.umb.edu (Eugene O'Neil) writes:
> In article <m3iuoam7w5.fsf@stoli.spirits.org.au>, nathanh@chirp.com.au wrote:
> >
> >You have allowed commercial software to continue to exist, when in
> >all probability the free software would have eventually caught and
> >surpassed the commercial equivalents. You have allowed an inferior
> >parasitic form of software to survive when it should have died.
> But commercial software is only a small part of a much larger
> problem: We must destroy commercialism itself, to be truly free of
> commercial software! Once the workers control the means of
> production, we will have a glorious Revolution in software
> productivity! Kill the capitalist lacky running dogs! All hail the
> Revolution, comrade!
Ho ho ho. How droll.
> >Supposedly "free" licenses that allow commercial parasites to take
> >without giving are unfairly slanting the playing field away from a
> >free software society towards a commercial software society. It is
> >not conducive to the goal of software being free.
>
> The BSD license allows people to enhance software with new features, and
> actually CHARGE PEOPLE MONEY to use their improved version.
It has nothing to do with charging money. I'm all for people charging
money. I have a problem with the bugfixes not being released back for
inclusion in the original distribution.
> This fiendish practice of expecting money in exchange for work must
> be stopped! We should put all free software under the GPL, and if
> those BSD-loving bastards don't like it, they don't have to improve
> anything at all. That will make the world a better place, dammit!
Your parody is vastly amusing, but completely misguided.
> [several more pages of similarly witty repartee]
>
> NOW NOW NOW NOW!
>
> Oh, well... I'll try again tomorrow.
Please, don't bother...
--
Modern computers have advanced to the point where they are extremely
intuitive, though obviously you have to spend a lot of time learning
how to use them first.
------------------------------
Date: 27 Apr 1998 23:04:07 +1000
From: nathanh@chirp.com.au
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <m3wwcbs9fc.fsf@stoli.spirits.org.au>
eugene@cs.umb.edu (Eugene O'Neil) writes:
> In article <m3k98qmyvh.fsf@stoli.spirits.org.au>, nathanh@chirp.com.au wrote:
> >tzs@halcyon.com (Tim Smith) writes:
> >>
> >> With there now being at least five reasonable ways one could
> >> release free software (public domain, GPL, MPL, BSD/X (I'll count
> >> these as one even though many people find the differences
> >> significant), and Artistic), people should really consider very
> >> carefully the license they use. They should not automatically
> >> use GPL just because, say, they develop on Linux and most of the
> >> stuff on Linux is GPL'ed, nor should they choose BSD just because
> >> they happen to be using FreeBSD.
> >
> >You should choose GPL because none of the other license guarantees
> >that the software you write today will continue to be developed as
> >free software tomorrow.
>
> The GPL does not guarantee your software will continue to be
> developed at all!
True, I should have worded the previous sentence as: "none of the other
licenses guarantee that the software you write today won't be developed
as non-free software tomorrow". Happy?
> It certianly doesn't magically turn commercial developers into free
> software developers, it just tells the commercial developers to fuck
> off.
In two official cases it has turned commercial developers into free GPL
developers. A famous example was OBJ-C by NEXT. In particular, if these
commercial developers don't want to write free software, they can FO.
> Thus, the only guarentee you get is that large numbers of highly
> skilled, professional developers won't even look at your code.
If all these highly skilled, professional developers, are going to look
at my code but not contribute back any changes or bugfixes they make, I
have no interest in them looking at my code in the first place.
> >Your other licenses allow free code to be hoarded. The GPL takes a
> >firm *positive* stance against hoarding by requiring that GPL code
> >must never be distributed non-freely.
>
> Or you could say it takes a *negative* stance against people making
> money. The only difference is how you phrase it.
It doesn't take a negative stance against making money. It takes a very
positive (or negative depending on your POV) stance against proprietary
hoarded code. You apparently don't understand the GPL well enough.
--
Modern computers have advanced to the point where they are extremely
intuitive, though obviously you have to spend a lot of time learning
how to use them first.
------------------------------
Date: 27 Apr 1998 22:55:23 +1000
From: nathanh@chirp.com.au
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <m3zph7s9tw.fsf@stoli.spirits.org.au>
Miles O'Neal <meo@rru.com> writes:
> nathanh@chirp.com.au wrote:
> >
> > tzs@halcyon.com (Tim Smith) writes:
>
> > You should choose GPL because none of the other license guarantees
> > that the software you write today will continue to be developed as
> > free software tomorrow.
> >
> > Your other licenses allow free code to be hoarded.
>
> This simply isn't true. There are any number of ways to write a license
It was clear from the context of the post that I was alluding to
the 2 licenses (BSD and X11) that we were discussing. I am aware
that there are an infinite variety of licenses but I had naively
assumed that people would read the thread before responding...
--
Modern computers have advanced to the point where they are extremely
intuitive, though obviously you have to spend a lot of time learning
how to use them first.
------------------------------
Date: Mon, 27 Apr 1998 14:48:49 GMT
From: preston@home.com (Preston L. Bannister)
Subject: Re: win32::registry (queryvalue)
Message-Id: <lV011.29908$6z.6234051@news.rdc2.occa.home.com>
In article <35445216.0@d2o26.telia.com>, "Andreas Olsson" <seo@sorona.se> wrote:
>I wonder why the function QueryValue doesn't work under WinNT4.
>
>My code:
>
>$HKEY_LOCAL_MACHINE->Open("SOFTWARE", $hkey) || die "Can't open registry";
>$hkey->Open("Mykey", $skey) || die "Can't open registry";
>$skey->Open("MySubKey", $lkey) || die "Can't open registry";
>
>$lkey->QueryValue("Value1", $val1) || die "Error";
>$lkey->QueryValue("Value2", $val2) || die "Error";
QueryValue() is for Win3.1 compability and can only query "(Default)"
values, you want to use QueryValueEx().
--
Preston L. Bannister
preston@home.com
http://members.home.net/preston
------------------------------
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 2427
**************************************