[10334] in Perl-Users-Digest
Perl-Users Digest, Issue: 3927 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 8 10:08:05 1998
Date: Thu, 8 Oct 98 07:00:30 -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 Thu, 8 Oct 1998 Volume: 8 Number: 3927
Today's topics:
Re: "Many Jars" Mystery dave@mag-sol.com
Re: "Many Jars" Mystery (I R A Aggie)
Re: Are there any "perl.newbie" group or forum? <merlyn@stonehenge.com>
Re: Are there any "perl.newbie" group or forum? (I R A Aggie)
Re: Can't send mail via telnet programmatically <featheredfrog@geocites.com>
Re: Can't send mail via telnet programmatically <featheredfrog@geocites.com>
Re: Capturing command output in Perl dave@mag-sol.com
Re: cgi-lib.pl vs CGI.pm? (Jay Flaherty)
Re: cgi-lib.pl vs CGI.pm? (I R A Aggie)
Re: database problem..need urgent help!!!!!!! <matt@whiterabbit.co.uk>
Re: database problem..need urgent help!!!!!!! <perlguy@inlink.com>
Exporting environment variables to parent shell <halfdan@no-junkmail.please.pison.com>
Re: Exporting environment variables to parent shell (I R A Aggie)
Re: Exporting environment variables to parent shell (Tad McClellan)
Re: HELP (Sam Holden)
how can i call another CGI prog on the net ? fkoehler@num.math.uni-goettingen.de
multipart/form-data and MSIE 4.0 <simone@intesys.it>
need help refining this baillie@my-dejanews.com
Re: Parsing records from one text file to another (Bart Lateur)
PerlShop Shipping Question argyrodes@my-dejanews.com
Re: Please HELP!!!! Database search output format <matt@whiterabbit.co.uk>
Re: Please HELP!!!! Database search output format <perlguy@inlink.com>
Programmer's Text Editor <xidicone@iname.com>
Re: Q: Speed up a regular expression droby@copyright.com
RDB database driver for perl on VMS metcalfjm@my-dejanews.com
Re: send geroge reese (was Re: Call for Participation: <piet@cs.uu.nl>
Re: send geroge reese (was Re: Call for Participation: <ljz@asfast.com>
Sending Alt-F into a pipe <kasper@ww.uni-erlangen.de>
Re: Sending Alt-F into a pipe (Mark-Jason Dominus)
Re: Sending and receiving data to/from a weather server <jim.michael@gecm.com>
Sort Hash of Hashes by Inner Element <pup@pobox.com>
Re: stat() return of mode is wierd... (Mark-Jason Dominus)
Re: talking to myself (pg 343 camel book [2nd edition]) <perlguy@inlink.com>
Re: What perl modules do I have??????? (Bart Lateur)
Re: What's is wrong here? droby@copyright.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 08 Oct 1998 09:24:20 GMT
From: dave@mag-sol.com
Subject: Re: "Many Jars" Mystery
Message-Id: <6vi0c3$r4$1@nnrp1.dejanews.com>
In article <6vhi2o$63g@news1.panix.com>,
dha@panix.com (David Adler) wrote:
> On 7 Oct 1998 20:21:06 +0100, Jonathan Stowe <gellyfish@btinternet.com> wrote:
> >To bring this back somewhere into orbit around Planet Perl - The venue of
> >the recent London.pm meet had a damn fine pint of bitter at a very reasonable
> >#1.50 .
>
> Ah, but you leave out the *important* info - which pub???
>
> dave, who is planning on being in london in the next couple of months...
The Cittie of Yorke on High Holborn. Sam Smiths Old Brewery Bitter at #1.50 a
pint.
London.pm meetings are on the first Thursday of the month and have so far all
been held at the same pub. All visiting Perl Mongers will be made very welcome
(ask Chris Masto).
Dave...
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 08 Oct 1998 09:42:00 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: "Many Jars" Mystery
Message-Id: <fl_aggie-0810980942000001@aggie.coaps.fsu.edu>
In article <6vgnr2$uk3$1@nnrp1.dejanews.com>, ptimmins@netserv.unmc.edu
(Patrick Timmins) wrote:
+ What can I say? I *can* be an ass, at times. Apologies to
+ anyone I've ever offended here.
"Never apologize. Never explain." -- Dogbert
James
------------------------------
Date: Thu, 08 Oct 1998 12:54:44 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <8clnmrusbx.fsf@gadget.cscaper.com>
>>>>> "Craig" == Craig Berry <cberry@cinenet.net> writes:
Craig> And so (nearly) was Randal. I believe the original line, spoken by Lord
Craig> Dark Helmet, was "I see your schwartz is as big as mine...but do you know
Craig> how to use it?" :)
Yes, that's the line I was mismembering. :)
Oh, and Uri, you have "stealth cc's". I've killfiled people for that.
Please don't do that. (Your mail copy to me wasn't marked as "also
posted", so I replied to you privately before seeing it in the
newsgroup. Evil.)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 08 Oct 1998 09:35:23 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <fl_aggie-0810980935230001@aggie.coaps.fsu.edu>
In article <361C62CA.65EF53C7@vpservices.com>, jeff@vpservices.com wrote:
+ Let's look at this as a signal to noise ratio: for every "clueless"
+ posting on clpm, there are two or three flame resposnes to it, which
+ makes three or four worthless messages on the group. What about the
+ value of resounding silence?
Because someone less clueful will pipe up, and give an answer. An
answer that may be wrong, BTW.
James
------------------------------
Date: Thu, 08 Oct 1998 09:05:49 -0400
From: "Michael D. Hofer" <featheredfrog@geocites.com>
Subject: Re: Can't send mail via telnet programmatically
Message-Id: <361CB8AD.5146@geocites.com>
Martien Verbruggen wrote:
[a lot of snipped stuff about doing this the right way]
Listen to Martien - this is the correct, safe and rigorous way to
accomplish what you want.
There are, on occasion, times when you can't to it completely
rigorously, however. The original poster expressed concerns about the
version, etc of his perl.
Since you are already opening a pipe to telnet, it seems you could
substitute something like
$mta='/usr/ucb/mail'; #this is what I'd use on my sun box, if I
#didn't use the modules - pick an mta that
#is on the ALPHA - what program do you use
#to send mail from the command line?
@addys=('user1@foobar','user2@shoedoobie');
open (MAIL,"| $mta -s \"Email Alert\" @addys") or die "Can't open
mailpipe: $!;
print MAIL "Email alert for the XXX system\n";
close MAIL or die "Error closing mailpipe: $!";
ie: let the programs already known to be working on the system, with the
properly configured "knowledge" of getting mail to where it has to go,
do their jobs.
Downside: not portable, etc. Use the Modules if you can.
--
Cian ua'Lochan /mka/ Michael D. Hofer
I'm not a medievalist - I just play one on weekends!
http://www.geocities.com/SoHo/Lofts/9800/
------------------------------
Date: Thu, 08 Oct 1998 09:11:26 -0400
From: "Michael D. Hofer" <featheredfrog@geocites.com>
Subject: Re: Can't send mail via telnet programmatically
Message-Id: <361CB9FE.17B@geocites.com>
D*mn Cut and Paste...
I mislpaced a closing quotation mark in my original response.
$mta='/usr/ucb/mail'; #this is what I'd use on my sun box, if I
#didn't use the modules - pick an mta that
#is on the ALPHA - what program do you use
#to send mail from the command line?
@addys=('user1@foobar','user2@shoedoobie');
#this line was in error:
open (MAIL,"| $mta -s \"Email Alert\" @addys") or die "Can't open
mailpipe: $!"; #misplaced closing quote mark restored
print MAIL "Email alert for the XXX system\n";
close MAIL or die "Error closing mailpipe: $!";
Sorry!
Michael D. Hofer wrote:
>
> Martien Verbruggen wrote:
> [a lot of snipped stuff about doing this the right way]
>
> Listen to Martien - this is the correct, safe and rigorous way to
> accomplish what you want.
>
> There are, on occasion, times when you can't to it completely
> rigorously, however. The original poster expressed concerns about the
> version, etc of his perl.
>
> Since you are already opening a pipe to telnet, it seems you could
> substitute something like
>
> $mta='/usr/ucb/mail'; #this is what I'd use on my sun box, if I
> #didn't use the modules - pick an mta that
> #is on the ALPHA - what program do you use
> #to send mail from the command line?
> @addys=('user1@foobar','user2@shoedoobie');
>
> open (MAIL,"| $mta -s \"Email Alert\" @addys") or die "Can't open
> mailpipe: $!;
> print MAIL "Email alert for the XXX system\n";
> close MAIL or die "Error closing mailpipe: $!";
>
> ie: let the programs already known to be working on the system, with the
> properly configured "knowledge" of getting mail to where it has to go,
> do their jobs.
>
> Downside: not portable, etc. Use the Modules if you can.
>
> --
> Cian ua'Lochan /mka/ Michael D. Hofer
> I'm not a medievalist - I just play one on weekends!
> http://www.geocities.com/SoHo/Lofts/9800/
--
Cian ua'Lochan /mka/ Michael D. Hofer
I'm not a medievalist - I just play one on weekends!
http://www.geocities.com/SoHo/Lofts/9800/
------------------------------
Date: Thu, 08 Oct 1998 09:17:18 GMT
From: dave@mag-sol.com
Subject: Re: Capturing command output in Perl
Message-Id: <6vhvut$fp$1@nnrp1.dejanews.com>
In article <6vg2u7$uu1$1@imsp009a.netvigator.com>,
"wkchiu" <wkchiu@yahoo.com> wrote:
> I am writing a perl script in NT which runs the PING.EXE command to check a
> node (using system() or win32::create() ??) and examine the reply of
> PING.EXE to see whether the node is alive or dead. My question is how can I
> capture the output of PING.EXE in perl script to carry out the processing ?
Use qx//. You can get the details from perldoc perlop.
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 08 Oct 1998 12:47:37 GMT
From: fty@utk.edu (Jay Flaherty)
Subject: Re: cgi-lib.pl vs CGI.pm?
Message-Id: <361cb20e.251457865@alder>
On Wed, 07 Oct 1998 21:50:15 GMT, Scratchie <upsetter@ziplink.net>
wrote:
>The only main advantage I've found in using CGI.pm is the ability to run
>scripts from the command line. This is, honestly, quite useful. Now that
>CGI.pm is part of the standard distribution, I find myself using it more
>and more, but if you're happy with cgi-lib.pl, I wouldn't be in a huge
>rush to upgrade.
The main advantage to me is to dynamically create HTML (especially
form fields, and tables) using array/hash references. very sweet. It
makes elegant code when parsing data from a database query. It allows
you to easily maintain state across many page requests of a complex
form, etc..., etc...,
I agree, if all you need now is access to the http parameters passed
to your perl script, then it is not necessary to switch. But, if you
ever want to do something more complex (and you will someday), you are
going to need CGI.pm.
jay
------------------------------
Date: Thu, 08 Oct 1998 09:33:00 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: cgi-lib.pl vs CGI.pm?
Message-Id: <fl_aggie-0810980933000001@aggie.coaps.fsu.edu>
In article <rmRS1.123$P12.538430@news.shore.net>, Scratchie
<upsetter@ziplink.net> wrote:
+ I'm in the minority around here, but I say if it works, don't "fix" it.
+ There are supposedly some bugs in cgi-lib.pl, although I've never
+ encountered them. I gather that they have something to do with file
+ uploads. If (like me) you're using cgi-lib primarily to parse the input
+ from HTML forms, and it does what you need it to, I see no reason to
+ change. I have no problem printing out my own html, either. :)
Its not like changing is particularly hard, or even dangerous. Change:
require "cgi-lib.pl";
to:
use CGI qw(:cgi-lib);
and you get all the functionality of CGI.pm's compatibility mode.
James
------------------------------
Date: Thu, 08 Oct 1998 09:45:43 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
To: AMIP <sroque@man.amis.com>
Subject: Re: database problem..need urgent help!!!!!!!
Message-Id: <361C7BB7.1E26D826@whiterabbit.co.uk>
@INC is a list of directories in which perl is told to search for
modules. You have obviously specified "include database.sub" (or use?)
and the file is not where you're telling perl.
AMIP wrote:
>
> what does this error mean?
>
> Can't locate database.sub in @INC
--
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons
------------------------------
Date: Thu, 8 Oct 1998 11:16:52 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: database problem..need urgent help!!!!!!!
Message-Id: <361C9F24.72BD121A@inlink.com>
AMIP wrote:
>
> what does this error mean?
>
> Can't locate database.sub in @INC
It means that in your require statement for database.sub, Perl could not
find it.
@INC is kind of like Perl's "PATH" statement. If the file is not it the
current directory, then it looks in the locations in @INC. The
"current" directory is not always what you think, especially on Windoze
systems.
Is the file where you say it is?
Are you on a Windoze box? If so, use the full path and drive letter to
point to database.sub.
If you are using the "Simple Database" script(s) from my site, I suggest
waiting for about 2 weeks. The old scripts, well - they suck. I have a
new database that is under 350 lines and consisist of one file and a
configuration file. It will be on webreview.com first, then on my
site. The one on my site will be contiually "tweaked".
GOod luck,
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Thu, 08 Oct 1998 11:44:30 +0100
From: Halfdan Ingvarsson <halfdan@no-junkmail.please.pison.com>
Subject: Exporting environment variables to parent shell
Message-Id: <361C978E.BF59E917@no-junkmail.please.pison.com>
Is there any way of exporting environment variables, set in a perl
script, out to the parent environment. (I'm probably missing something
amazingly obvious).
Ciao,
H.
-==["The only decent thing to do behind a persons back is to pat it"]==-
- Sleep? Isn't that some inferior substitute for caffeine? -
- Unspam: remove the 'no-junkmail.please.' bit -
------------------------------
Date: Thu, 08 Oct 1998 09:26:01 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Exporting environment variables to parent shell
Message-Id: <fl_aggie-0810980926010001@aggie.coaps.fsu.edu>
In article <361C978E.BF59E917@no-junkmail.please.pison.com>, Halfdan
Ingvarsson <halfdan@no-junkmail.please.pison.com> wrote:
+ Is there any way of exporting environment variables, set in a perl
+ script, out to the parent environment. (I'm probably missing something
+ amazingly obvious).
That would be a security flaw, and can not be done. Would you really
want a program to reset your environment?
James
------------------------------
Date: Thu, 8 Oct 1998 08:37:41 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Exporting environment variables to parent shell
Message-Id: <57fiv6.pcd.ln@flash.net>
Halfdan Ingvarsson (halfdan@no-junkmail.please.pison.com) wrote:
: Is there any way of exporting environment variables, set in a perl
: script, out to the parent environment.
Perl FAQ, part 8:
"I {changed directory, modified my environment} in a perl script.
How come the change disappeared when I exited the script?
How do I get my changes to be visible?"
: (I'm probably missing something
: amazingly obvious).
So you already suspected that it was a Frequently Asked Question,
yet you posted anyway?
That is Not Good...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Oct 1998 08:22:57 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: HELP
Message-Id: <slrn71otj1.ro.sholden@pgrad.cs.usyd.edu.au>
On Wed, 07 Oct 1998 23:44:35 -0700, Jane Vermont
<csqy65@postoffice.pacbell.net> wrote:
>How to use perl to remove <!-- html comment --> and <tags>
> thank
>
One reads the documentation that comes with perl
--
Sam
testing? What's that? If it compiles, it is good, if it boots up it is
perfect.
--Linus Torvalds
------------------------------
Date: Thu, 08 Oct 1998 09:01:23 GMT
From: fkoehler@num.math.uni-goettingen.de
Subject: how can i call another CGI prog on the net ?
Message-Id: <6vhv12$ujj$1@nnrp1.dejanews.com>
Hello,
i have the following problem: I would like to start another CGI prog from
within mz perl prog which is located on some server on the net and I would
like to pass paramters to it. How can i do this ? I think I have to use
something likea HTTP command or NET command..... How can realize this in PERL
? Anybody can help ?
Thank you,
Fabian
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 08 Oct 1998 12:14:36 +0100
From: Simone Mura <simone@intesys.it>
Subject: multipart/form-data and MSIE 4.0
Message-Id: <361C9E9B.BF3070AB@intesys.it>
Hi ,
I've a problem with HTML FORM:
<FORM NAME="form"
ENCTYPE="multipart/form-data"
ACTION="my.pl" METHOD="post">
with multipart/form-data and MSIE 4.0 there is a inifinite cycle in the
connection with server.
I work on MS NT 4.0 with IIS.
In my.pl I use: binmode STDIN;
I've not problem with Netscape Comunicator 4.03.
Any help would be appreciated!!!!
Simone Mura
--
-----------------------------
Simone Mura
Intesys srl -Internet Provider-
tel. +39-45956777 FAX +39-45956901
email simone@intesys.it
------------------------------
Date: Thu, 08 Oct 1998 12:11:44 GMT
From: baillie@my-dejanews.com
Subject: need help refining this
Message-Id: <6via61$d0u$1@nnrp1.dejanews.com>
I was hoping someone could help me to refine this script (to make it a little
more perl-like and a little less shell-like). If you'd like to run it to see
how it works there's a file that accompanies it which I'll send on request,
but here is the program(script, whatever):
Basically, this is my first perl program, and I'd like to have it more compact
(in the tradition of perl), as well as optimize it some. Any help would be
appreciated!
#!/usr/bin/perl -w
# figure out what host we're acting on and
# run the command to an output file from that host
if(defined($ARGV[0])) {
$host=$ARGV[0];
system "rsh $host alex-sched -LP 0 > /tmp/opck.cache";
} else {
$host='localhost';
system "alex-sched -LP 0 > /tmp/opck.cache";
}
open(FILE, "/tmp/opck.cache") or die "Can't access file: $!";
$i=0;
# Find the only instance of Total..Backup and
# the last (can someone tell me how to get only
# the last without saving an @ and referencing
# the final value) instance of Current..Stored
while(<FILE>) {
if(/^Total Bytes to Backup/) {
chomp($to_store=$_);
$to_store=~tr/[a-z A-Z:]//d;
$to_store/=1024;
}
if(/^Current KBytes Stored/) {
chomp($store_array[$i]=$_);
$i++;
}
}
close(FILE) or die "Couldn't close file: $!";
unlink("/tmp/opck.cache") or warn "Couldn't remove file: $!";
# Use the last value of the array for the current
# amount of data that's been stored
$amount_stored=$store_array[$#store_array];
# Is this (below) right?..to grep out only the numbers
$amount_stored=~tr/[a-z A-Z:]//d;
undef(@store_array);
undef($i);
$cntr=2;
$screen_width=`tput cols`;
$percentage=($amount_stored/$to_store)*100;
$vis_disp=($amount_stored/$to_store)*$screen_width;
printf "\t$host amount to store\t=\t%.0f\n", $to_store;
print "\t\tamount stored\t\t=\t$amount_stored\n";
system "tput smso"; # Is there a better way to do this (curses)?
for($cntr=0; $cntr<=$vis_disp; $cntr++) {
print "=";
}
print ">\n";
system "tput rmso";
system "tput bold";
printf "\t\t\t\t\tOpcard is%2d", $percentage;
system "tput rmso";
print "% complete\n\n";
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 08 Oct 1998 10:29:21 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: Parsing records from one text file to another
Message-Id: <362a8ca7.7889866@news.ping.be>
Marx wrote:
>I have a text file that looks like this:
>
>REC ITEMS~2~4~4~EACH~250.00~~1000.00~PRODUCT DESCRIPTION~ADDITIONAL
>COMMENTS
>REC HEAD~016969~19980630~709~020449~099~19980630~MERCER FREIGHT
>REC ITEMS~1~1~1~EACH~2000.00~~2000.00~PRODUCT DESCRIPTION~ADDITIONAL
>COMMENTS
>
>I want to perform some sort of loop that says: if field one of my text
>file is equal to "REC ITEMS" then print field one and the associatied
>fields with it to another file. The file would hold all "REC ITEMS"
>records in it.
>
>For example,
>REC ITEMS~2~4~4~EACH~250.00~~1000.00~PRODUCT DESCRIPTION~ADDITIONAL
>COMMENTS
>REC ITEMS~1~1~1~EACH~2000.00~~2000.00~PRODUCT DESCRIPTION~ADDITIONAL
>COMMENTS
>Anyone know a good way to do this?
I guess your fields are separated with "~"?
while (<>) {
if ((split/~/)[0] eq "REC ITEMS") {
print;
}
}
That's one. It's more extensible than just printing the line if there's
a match, in case you decide to reformat the line as well. Another:
while (<>) {
/^REC ITEMS~/ or next;
print;
}
That's two. It skips the rest of the loop if the line doesn't start with
"REC ITEMS~". Again, it's easy to extend.
And here's a really compact one, which reads all lines in the file at
once, filters them, and prints just the selection:
print grep { /^REC ITEMS~/ } <>;
Not quite as extensible.
Bart.
------------------------------
Date: Thu, 08 Oct 1998 13:44:18 GMT
From: argyrodes@my-dejanews.com
Subject: PerlShop Shipping Question
Message-Id: <6vifji$krq$1@nnrp1.dejanews.com>
Has anyone had any success getting the shipping charges table to accept
anything other than UPS, and FedEx in PerlShop? I`m from Canada, and I would
like to list my carrier as CanPar, but as soon as I make this alteration to
the shipping charges table, I get a "document contains no data" error back
when I hit submit on the order form.
Any help would be greatly appreciated.
Norm.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 08 Oct 1998 09:42:44 +0100
From: Matt Pryor <matt@whiterabbit.co.uk>
To: AMIP <sroque@man.amis.com>
Subject: Re: Please HELP!!!! Database search output format
Message-Id: <361C7B03.445861FD@whiterabbit.co.uk>
This post should be directed to ciwa.html, not perl. It's an HTML
query.
You cannot have rows and columns of data properly alligned in HTML
without using tables. All white space is truncated to one space
character, so
1234 4321
will be displayed as 1234 4321. Tabs are exactly the same.
AMIP wrote:
>
> Hi!
> I made a perl script that will search a flat file database. My problem is
> configuring the output. I don't want to use tables. I have four fields as
> result to searching but these are so close together (no space at all). But
> when I select View Source, they are properly justified. What do you think
> shal I do. I used FORMAT statement. Please help!!!
--
Matt's daily comic strip
Porridge and Fartcakes
http://www.whiterabbit.co.uk/cartoons
------------------------------
Date: Thu, 8 Oct 1998 11:09:07 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Please HELP!!!! Database search output format
Message-Id: <361C9D53.DB3A2FEA@inlink.com>
Try the <PRE></PRE> tag for lining up your data.
HTH
--
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Thu, 08 Oct 1998 19:49:56 +1100
From: Jussi Jumppanen <xidicone@iname.com>
Subject: Programmer's Text Editor
Message-Id: <361C7CB4.5708@iname.com>
The latest version of the Zeus programmer's editor is now available:
Zeus for Windows 3.x or Win32
A powerful text editor/ integrated development environment. Features
include Brief, Epsilon, Emacs or Wordstar emulation, status bar,
toolbar, configurable syntax colorizing, background compiler, inline
error correction, unlimited undo/redo, keyboard macros, scripting
language, templates and more.
Version: 2.70 Platforms: Windows 3.x, Windows 95 or NT Size: 1100k
For more details and even some nice screen shots of Zeus in action
check out the following web page:
http://ourworld.compuserve.com/homepages/jussi/zMain.htm
------------------------------
Date: Thu, 08 Oct 1998 13:06:25 GMT
From: droby@copyright.com
Subject: Re: Q: Speed up a regular expression
Message-Id: <6vidch$huo$1@nnrp1.dejanews.com>
In article <6vgnbd$te2$1@nnrp1.dejanews.com>,
bhoylma@uswest.com wrote:
> In article <1dgizeo.u7o9yz1yw0p8gN@roxboro0-005.dyn.interpath.net>,
> phenix@interpath.com (John Moreno) wrote:
> > Larry Rosler <lr@hpl.hp.com> wrote:
> [...]
> > > Benchmark: timing 262144 iterations of one_regex0, one_regex1,
> > > one_regex2, two_regex0, two_regex1, two_regex2...
> > > one_regex0: 14 wallclock secs (14.33 usr + 0.00 sys = 14.33 CPU)
> > > one_regex1: 12 wallclock secs (12.29 usr + 0.00 sys = 12.29 CPU)
> > > one_regex2: 13 wallclock secs (13.40 usr + 0.00 sys = 13.40 CPU)
> > > two_regex0: 8 wallclock secs ( 8.57 usr + 0.00 sys = 8.57 CPU)
> > > two_regex1: 12 wallclock secs (11.80 usr + 0.00 sys = 11.80 CPU)
> > > two_regex2: 11 wallclock secs ( 9.29 usr + 0.00 sys = 9.29 CPU)
> [...]
> > > This is perl 5.005_02 on Wintel.
> >
> > Benchmark: timing 262144 iterations of one_regex0, one_regex1,
> > one_regex2, two_regex0, two_regex1, two_regex2...
> > one_regex0: 9 secs ( 9.60 usr 0.00 sys = 9.60 cpu)
> > one_regex1: 12 secs (13.22 usr 0.00 sys = 13.22 cpu)
> > one_regex2: 14 secs (14.37 usr 0.00 sys = 14.37 cpu)
> > two_regex0: 14 secs (12.80 usr 0.00 sys = 12.80 cpu)
> > two_regex1: 15 secs (12.33 usr 0.00 sys = 12.33 cpu)
> > two_regex2: 18 secs (15.98 usr 0.00 sys = 15.98 cpu)
> >
> > This is perl 5.004 on the Mac.
> >
> Benchmark: timing 262144 iterations of one_regex0, one_regex1, one_regex2,
> two_regex0, two_regex1, two_regex2...
> one_regex0: 8 secs ( 7.23 usr 0.00 sys = 7.23 cpu)
> one_regex1: 12 secs (11.18 usr 0.00 sys = 11.18 cpu)
> one_regex2: 11 secs (11.83 usr 0.00 sys = 11.83 cpu)
> two_regex0: 11 secs (11.05 usr 0.00 sys = 11.05 cpu)
> two_regex1: 10 secs (10.64 usr 0.01 sys = 10.65 cpu)
> two_regex2: 13 secs (13.29 usr 0.00 sys = 13.29 cpu)
>
> perl 5.004_4, SunSolaris 2.5.1, SparcServer 1000
>
> Interesting results, huh!
>
Benchmark: timing 262144 iterations of one_regex0, one_regex1, one_regex2,
two_regex0, two_regex1, two_regex2...
one_regex0: 1 secs ( 1.05 usr 0.00 sys = 1.05 cpu)
one_regex1: 2 secs ( 1.39 usr 0.01 sys = 1.40 cpu)
one_regex2: 2 secs ( 1.51 usr 0.01 sys = 1.52 cpu)
two_regex0: 2 secs ( 1.30 usr 0.00 sys = 1.30 cpu)
two_regex1: 4 secs ( 1.28 usr 0.00 sys = 1.28 cpu)
two_regex2: 3 secs ( 1.53 usr 0.00 sys = 1.53 cpu)
Perl 5.004_04, Linux 2.0.32, Pentium 266.
Benchmark: timing 262144 iterations of one_regex0, one_regex1, one_regex2,
two_regex0, two_regex1, two_regex2...
one_regex0: 11 secs (11.52 usr 0.00 sys = 11.52 cpu)
one_regex1: 20 secs (17.02 usr 0.00 sys = 17.02 cpu)
one_regex2: 17 secs (16.99 usr 0.00 sys = 16.99 cpu)
two_regex0: 14 secs (13.98 usr 0.00 sys = 13.98 cpu)
two_regex1: 16 secs (16.60 usr 0.00 sys = 16.60 cpu)
two_regex2: 17 secs (17.70 usr 0.00 sys = 17.70 cpu)
Perl 5.004_04, Solaris 2.6, Sparc4
Benchmark: timing 262144 iterations of one_regex0, one_regex1, one_regex2,
two_regex0, two_regex1, two_regex2...
one_regex0: 5 secs ( 4.28 usr 0.02 sys = 4.30 cpu)
one_regex1: 6 secs ( 6.07 usr 0.05 sys = 6.12 cpu)
one_regex2: 7 secs ( 6.70 usr 0.03 sys = 6.73 cpu)
two_regex0: 5 secs ( 5.27 usr 0.02 sys = 5.28 cpu)
two_regex1: 7 secs ( 6.20 usr 0.02 sys = 6.22 cpu)
two_regex2: 7 secs ( 6.67 usr 0.03 sys = 6.70 cpu)
Perl 5.004_04, Digital Unix 4.0D, AlphaServer 1000A (4/233)
And my interpretation:
1) Linux rules!
2) We'll need a bigger box than an AlphaServer 1000A if we move our database
to Unix. Hmmm. Maybe I have to install Perl on VMS and run the benchmark
there. Or get someone else to run the benchmark on VMS. ;-)
3) There's probably not much real statistical difference between these
algorithms.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 08 Oct 1998 12:40:31 GMT
From: metcalfjm@my-dejanews.com
Subject: RDB database driver for perl on VMS
Message-Id: <6vibs0$fdo$1@nnrp1.dejanews.com>
Hi All,
I was wondering if anyone has done some perl scripting on
VMS/VAX interacting with an RDB database on these systems.
I am looking for object oriented drivers similar to those
in the DBD::* CPAN modules, like those for Oracle and
Informix. I believe that the RDB database on VMS systems
is different from the RDB for which Walt Hobbs wrote his
perl module in CPAN.
Please feel free to correct any inaccuracies in my under-
standing; I don't pretend to be a VMS guru.
Thank You,
JM
--
----
Jeffrey M. Metcalf
metcalfjm@my-dejanews.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 08 Oct 1998 10:20:59 +0200
From: Piet van Oostrum <piet@cs.uu.nl>
Subject: Re: send geroge reese (was Re: Call for Participation: Python Conference)
Message-Id: <wz67dvh3bo.fsf@kemmel.cs.uu.nl>
>>>>> Ken Manheimer <klm@cnri.reston.va.us> (KM) writes:
KM> I sent something directly to zenin, but with this latest followup i'm
KM> now sending something to you and anyone participating in this thread.
KM> Why are you continuing to include comp.lang.python in this discussion?
KM> If you have no good reason, would you please stop? (If you think you do
KM> have a good reason, think again - and be considerate of the rest of us.
KM> *Then* stop.)
And why are you posting this to comp.lang.python. Those who do read
comp.lang.python and followup to these messages without removing
comp.lang.python may have a reason to do so. But those that do not read
comp.lang.python will never see your message.
--
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: Piet.van.Oostrum@gironet.nl
------------------------------
Date: 08 Oct 1998 08:33:37 -0400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: send geroge reese (was Re: Call for Participation: Python Conference)
Message-Id: <ltyaqrgrmm.fsf@asfast.com>
abigail@fnx.com (Abigail) writes:
> Zenin (zenin@bawdycaste.org) wrote on MDCCCLXIII September MCMXCIII in
>
> [ ... ]
>
> ++ : Just because it's flexible doesn't mean it isn't a hack.
> ++
> ++ True. IMHO however, it's the most perlish object model that
> ++ probably could have been constructed. It's not perfect, but
> ++ it's getting better.
> ++
> ++ "All languages suck, some just suck less". IMHO Perl's object
> ++ model in combination with Perl's other features is far lower on
> ++ the suck meter then most other languages, and far more practical.
>
> Odd. I find Perl's OO model very *impractical* because it leaves the
> programmer which to many things to do and worry about. Quite opposite
> from the rest of Perl. The way Perl does OO is very alien compared to
> the rest of Perl.
I agree. There's a parallel here with C and C++:
C++ was specifically designed to add OO constructs to the C
language in a manner that would break the bare minimum of existing C
programs. The result is a very useful language, but with a few
somewhat painful-to-use constructs in its OO model. The same appears
to be true for Perl: its OO model seems to have been designed to break
a minimum of existing Perl programs, and the result also contains some
rather messy OO constructs ... and quite a bit messier than those in
C++, in my opinion.
Of couse, that begs the question of what could be done about this. In
the C/C++ case, a new C-like OO language was developed that no longer
was intended to be upward-compatible with C, and this allowed the
designers of this language (Java) to clean up the object model and
make it much easier to use than that of C++. Is such a step called
for in the case of Perl? Is it necessary at all to create a new,
Perl-like OO language, or can Perl's object model be cleaned up in
future revisions without breaking too much existing code?
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: Thu, 08 Oct 1998 11:35:30 +0200
From: Achim Kasper <kasper@ww.uni-erlangen.de>
Subject: Sending Alt-F into a pipe
Message-Id: <361C8762.1994EC45@ww.uni-erlangen.de>
Hello!
I have a Programm that opens a file, if I type "Alt-f o <filename> Ret"
and
so on, like most mouse-oriented programms do.
Now I want to do somthing like:
open PROGRAM "|<that_program>" || die "can't open program: $!";
...
print PROGRAM "<Something for Alt-f>o<filename>\n";
but what should I use for <Something for Alt-f> ?
Or is there any other way to get, what I wish?
Thanks for any help
Achim
ps: I am working on a linux PC
------------------------------
Date: 8 Oct 1998 09:40:15 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Sending Alt-F into a pipe
Message-Id: <6vifbv$s7n$1@monet.op.net>
In article <361C8762.1994EC45@ww.uni-erlangen.de>,
Achim Kasper <kasper@ww.uni-erlangen.de> wrote:
>but what should I use for <Something for Alt-f> ?
print PROGRAM ('f' | 0x80);
------------------------------
Date: Mon, 05 Oct 1998 08:00:58 -0400
From: Jim Michael <jim.michael@gecm.com>
Subject: Re: Sending and receiving data to/from a weather server?
Message-Id: <3618B4FA.2C0F@gecm.com>
V. M. Padua wrote:
> Now what I'm looking for are some pointers on how to query a weather
> server with a selected city and return the current temperature in that
> airport/city using Perl. Now I'm not a Perl programmer (I didn't even
> write the Perl script the program calls) and I've checked some of the
> FAQ's and figured that I'd probably have to do something with CGI, but
> I'm looking for an example or discussion regarding a similar problem.
If the weather servers serve data via http then you might look into
using the LWP module to retrieve the data, then use a regular expression
to select the airport temp data. If you are doing this as something to
serve from your website then you could run this as a cgi script. A good
reference for using LWP is 'Web Client Programming With Perl' O'Reilly &
Associates; ISBN: 156592214X. A good reference for using the CGI.pm
module is 'Official Guide to Programming With Cgi.Pm' by Lincoln Stein;
John Wiley & Sons; ISBN: 0471247448. HTH.
Cheers,
Jim
------------------------------
Date: Thu, 8 Oct 1998 10:01:36 -0400
From: "Joel Burton" <pup@pobox.com>
Subject: Sort Hash of Hashes by Inner Element
Message-Id: <6vige7$70f$1@winter.news.erols.com>
Using the perldsc data:
%HoH = (
flintstones => {
lead => "fred",
pal => "barney",
},
jetsons => {
lead => "george",
wife => "jane",
"his boy" => "elroy",
},
simpsons => {
lead => "homer",
wife => "marge",
kid => "bart",
},
);
How can I iterate through the list using an *inner element* for my sort,
such as sorting by lead?
I'm trying something like:
foreach $show (sort { %{$HoH{$b}{lead}} <=> %{$HoH{$a}{lead}} } keys %HoH) {
print "\n$show: $HoH{$show}{lead}";
};
... but without any success.
I appreciate any help.
Cheers,
Joel
------------------------------
Date: 8 Oct 1998 09:36:19 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: stat() return of mode is wierd...
Message-Id: <6vif4j$s5n$1@monet.op.net>
In article <ylzpb7bisj.fsf@windlord.stanford.edu>,
Russ Allbery <rra@stanford.edu> wrote:
>kevin <kevin@zippy.tnet.com> writes:
>> The man pages say to refer to mknod but even there I can't figure out
>> how to get a number of 36333 which is anything close to what the real
>> permissions are for that file.
>
>windlord:~> perl -e 'printf ("%o\n", 36333)'
>106755
Possibly useful here:
use Stat::lsMode;
print format_mode(36333) ,"\n";
# Prints -rwsr-sr-x
http://www.plover.com/~mjd/perl/lsMode/
------------------------------
Date: Thu, 8 Oct 1998 11:34:53 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: talking to myself (pg 343 camel book [2nd edition])
Message-Id: <361CA35D.93846356@inlink.com>
Take a look at:
http://www.perl.com/CPAN-local/doc/FAQs/nt/Perl_for_Win32_FAQ_5.html#5_1
The FAQ's are VERY useful, I suggest using them because you will find
most answer to your questions there. RTFFAQ :-)
Basically, it doesn't forking work! Or should I say forking doesn't
work?
Either way, fork() is not implemented on Win32 systems.
I better get back to my forking job...
Brent
--
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Thu, 08 Oct 1998 10:29:24 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: What perl modules do I have???????
Message-Id: <362b8fd6.8705282@news.ping.be>
Ken Williams wrote:
>How do I find out what perl modules I have installed? Is there a switch or
>something? perl -v just tells me the version number. I running 5.004 on
>Linux 2.0.35.
You can look inside the "lib" subdirectory.
HTH,
Bart.
------------------------------
Date: Thu, 08 Oct 1998 11:42:45 GMT
From: droby@copyright.com
Subject: Re: What's is wrong here?
Message-Id: <6vi8fl$aq1$1@nnrp1.dejanews.com>
In article <361b56f6.0@news.cyberway.com.sg>,
"Xu Hongwei" <howel88@cyberway.com.sg> wrote:
> $cnt = $foo =~ tr#\/##;
>
No.
That will count a few extras on Unix if you have oddly named files. The
backslash can be used in filenames.
There are also OSes other than DOS and Unix, with other path separators.
The correct solutions have been posted several other places in this thread.
Use eval with tr or use s instead of tr. That makes the interpolation of $sep
happen so that you're counting only the correct separator for the OS.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3927
**************************************