[8541] in Perl-Users-Digest
Perl-Users Digest, Issue: 2158 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 22 16:07:22 1998
Date: Sun, 22 Mar 98 13:00:39 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 22 Mar 1998 Volume: 8 Number: 2158
Today's topics:
Re: A siomple question of asthetics. <sfarrell+usenet@farrell.org>
Re: Another novice needing RegExpr help.... (stephen benson)
Bigfloat's representation of an object <dcameron@nospam.bcs.org.uk>
CGI.pm/MAC HTML File Upload Ques... squid@fish.net
client/server socket deadlock <dan.hurley@worldnet.att.net>
Re: client/server socket deadlock <agr30@uni-koeln.de>
Re: compiling perl <Cory-M@usa.net>
Re: Destroying objects and their memory? (Jason Gloudon)
Die won't die! pleez help <mark@imp.net>
Re: Die won't die! pleez help <webmaster@fccjmail.fccj.cc.fl.us>
Directory listing question?? <mark@imp.net>
Re: Directory listing question?? (A. Deckers)
Re: Directory listing question?? felicity+spam@kluge.net
Re: Help with Selena Sol Classified Script <sdunnam@nospam-flyfishingjournal.com>
multi-line matching problem <xkn14@dial.pipex.com>
Parse::RecDescent Anybody using it in anger? <bruce@cenderis.demon.co.uk>
Perl *is* programming (was Re: Is there a "Newsgroup" f <merlyn@stonehenge.com>
Re: Perl + Tk? (A. Deckers)
Re: perl databases ?? (Mike Linksvayer)
Re: Perl for Win32 {NT4.0 sp3} simple scripting probs.. (Nick Tonkin)
Re: Perl for Win32 {NT4.0 sp3} simple scripting probs.. (Andrew M. Langmead)
Re: PerlRing??? (Andrew M. Langmead)
Re: PerlRing??? (Andrew M. Langmead)
Re: PerlRing??? <bcoleman@mindspring.com>
Re: Squelching STDIN (Andrew M. Langmead)
Re: Using perl code as a config file syntax? (Or, can r <mgregory@asc.sps.mot.com>
Re: Wierd redirection problem with Location: tim@maroney.org
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 22 Mar 1998 17:44:26 GMT
From: stephen farrell <sfarrell+usenet@farrell.org>
Subject: Re: A siomple question of asthetics.
Message-Id: <87pvjehb7p.fsf@phaedrus.uchicago.edu>
"Russ White" <russwyte@pcisys.net> writes:
> I have an array of string scalars that will be printed to a file. They are
> coming from an unformated file with no line breaks at all. I would like to
> use a short piece of code to insert line breaks on whitespace between words
> when a lines length gets to be about 60 character.
You might want to check out using format for this.
--sf
------------------------------
Date: Sun, 22 Mar 1998 20:52:18 GMT
From: stephenb@scribendum.win-uk.net (stephen benson)
Subject: Re: Another novice needing RegExpr help....
Message-Id: <351573c6.43198205@nntp.ibmpcug.co.uk>
I fear I'll bore everyone with th8is thread before anyone else posts
to it....
/<strong>(WW Notes* to).*(\d*\.\d+)<\/strong>/s
as in:
open(TESTFILE, "testPN_n.html") or die "Can't open testfile: $!\n";
while ($line = <TESTFILE>) {
if ($line =~ /<strong>(WW Notes* to).*(\d*\.\d+)<\/strong>/s) {
print "line number: $.";
print "\n";
print "line = $line\n";
print "1 = $1\n";
print "2 = $2\n";
print "\<A HREF=\"$1\"\>$1 $2\</A\>";
print "\n__________________________\n\n";
}
}
is my best guess (also done it with one paren and backref var); it
doesn't work. BTW the multiline /s is because I want to rip out a big
chunk of text, extract this couple of fields and write them into its
place -- not just for the line break in this example, which is just
the middle part of the process. The beginning and end work, but need
to be integrated into the whole:
/^\<!--webbot bot=\"Include\" u-include=\"(\w+\.html*)\" tag=\"BODY\"
startspan/
/^\<!--webbot bot=\"Include\" endspan i-checksum=\"(\d+)\"/
Once I work out his multiline thing. This is my first use of Perl in
anger, really.
-- stephen benson
stephenb@scribendum.win-uk.net || stephen_benson@watsonwyatt.co.uk
http://www.ibmpcug.co.uk/~2i/ || http://www.scribendum.win-uk.net/
__________________________________________________________________
------------------------------
Date: 22 Mar 1998 19:56:51 GMT
From: "Duncan Cameron" <dcameron@nospam.bcs.org.uk>
Subject: Bigfloat's representation of an object
Message-Id: <01bd55cc$5e8c8a40$2e3363c3@dns.btinternet.com>
A recent post asked about the use of Bigfloat. I wrote a short script to
test some of the functions and then realised that my knowledge of objects
is not what it could be. In particular:
use Math::BigFloat;
$f1 = Math::BigFloat->new("123 456.789 012");
print $f1, "\n";
gives output of 123456.789012 whereas I would expect a reference to the
value. The new function of Bigfloat is:
sub new {
my ($class) = shift;
my ($foo) = fnorm(shift);
panic("Not a number initialized to Math::BigFloat") if $foo eq "NaN";
bless \$foo, $class;
}
Another puzzle is that, using the debugger, I can see that $foo actually
contains the normalised version of the number, i.e. 123456789012E-6 but
that value is not being returned.
I've read Programming Perl, the Objects part of Chapter 5, and scanned the
FAQ but can't see anything which explains what is going on here. A
relevant factor may be that Bigfloat also overloads some operators.
Can anyone point me at some further information about what the module is
doing?
Thanks
Duncan Cameron
--
Remove 'nospam.' to get my return address.
------------------------------
Date: Sun, 22 Mar 1998 20:17:27 GMT
From: squid@fish.net
Subject: CGI.pm/MAC HTML File Upload Ques...
Message-Id: <35156cc7.11977644@news.earthlink.net>
Any help would be appreciated with this one:
PERL 5.004 on SCO w/ Netscape FastTrack 2.0
Scenario: I have a script that parses an HTML form and upload file and
writes this to an upload directory. I am using CGI.pm for the actual
file and text extract/parse/save routine.
Process: User fills out form and chooses file for upload (using
type=file multipart/form-data). Users will be on either MAC or PC.
File is either JPG,TIFF,GIF or Proprietary (Quark Express and Multi-Ad
Creator on Macintosh) User than submits the form and the script saves
the file into its proper filename and the text is placed into a text
file. This seems to be working O.K. until:
Problem: Everything seems O.K. until I try to view the 'uploaded from
a MAC' files on a MAC again. Fetch is used to retrieve the files from
the upload directory and when you go to view them, corrupt file. I can
view the JPG/TIFF/GIF files fine when I ftp them back to my PC(Win95)
but when brought to the MAC, failure. The proprietary files seem to be
about a fifth of the size of what they wre when they were uploaded via
the same MAC. Is this a MAC file fork problem? Binhex? File header? I
know nothing about the MAC file system (except for the nifty terms in
the previous sentence that I read about looking for an answer) and am
rather stumped.
------------------------------
Date: Sun, 22 Mar 1998 13:44:24 -0500
From: Dan Hurley <dan.hurley@worldnet.att.net>
Subject: client/server socket deadlock
Message-Id: <6f3ln1$8l6@bgtnsc02.worldnet.att.net>
I want to create a simple server that takes a request from a client and
responds back to client.
Server has no trouble receiving client message but client & server seem
to hang if the server tries to respond back to the client on the same
socket after receiving the client message. See code below.
I know I am missing something fundamental here.
Any advice?
thanks,
Dan Hurley
----------------- client.pl --------------------------
use IO::Socket;
$sock = new IO::Socket::INET (
PeerAddr => 'gargoyle',
PeerPort => 1200,
Proto => 'tcp'
);
die "Socket could not be created. Reason: $!" unless $sock;
#send server message ...
foreach (1 .. 5) {
print $sock "Message $_ \n";
}
# and then read the response ...
@response = <$sock>;
foreach $line (@response) {
print $line;
}
close $sock;
----------------- server.pl --------------------------
use IO::Socket;
$sock = new IO::Socket::INET (
LocalHost => 'gargoyle',
LocalPort => 1200,
Proto => 'tcp',
Listen => 5,
Reuse => 1,
);
die "Couldn't connect: $!" unless $sock;
while ($new_sock = $sock->accept()) {
@request = <$new_sock>; #READ CLIENT REQUEST
foreach $line (@request) {
print $line; #PRINT LOCALLY
}
print $new_sock 'Hello from the server.'; # SEND MESSAGE BACK TO
CLIENT
}
close $sock;
------------------------------
Date: 22 Mar 1998 20:55:30 +0100
From: Martin Bialasinski <agr30@uni-koeln.de>
Subject: Re: client/server socket deadlock
Message-Id: <873ega8pql.fsf@haitech.martin.home>
Dan Hurley <dan.hurley@worldnet.att.net> writes:
> Server has no trouble receiving client message but client & server seem
> to hang if the server tries to respond back to the client on the same
> socket after receiving the client message. See code below.
[...]
Where is the autoflush ? Check perldoc perlipc about this.
Ciao,
Martin
------------------------------
Date: Sun, 22 Mar 1998 14:19:52 -0600
From: "Cory S. Moll" <Cory-M@usa.net>
Subject: Re: compiling perl
Message-Id: <6f3rp3$870$1@news2.alpha.net>
Oh heh. I remember this program. It made huge exe files when it was done.. a
simple 6K perl script was turned into a 6M executable. I'm not sure why
anybody would want to compile it to begin with. But then again, I'm not that
experienced with Perl yet, so in essense, who am I to complain? Thanx
Cory Moll
CSM Internet - Affordable Web Publication Services
http://cnet.yikes.com/
----------
In article <6eu194$ca7$1@nntp2.uunet.ca>, "Indy Singh"
<indy@NOSPAMdemobuilder.com> wrote:
>
>Matthew MacGibbon wrote in message <3510178C.5F0F@corp.airmedia.com>...
>>I remember a while back someone had come up with something that allowed
>>you to create an executable from a perl script. Does anyone know
>>anything about that? (or a perl 2 c converter?)
>
>Check out http://www.demobuilder.com/perl2exe.htm
>
>
>
>
------------------------------
Date: Sun, 22 Mar 1998 17:59:44 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: Destroying objects and their memory?
Message-Id: <slrn6hak9u.5sm.jgloudon@manitoba.bbn.com>
Wade Williams <wwilliam@cisco.com> wrote:
>I've got a program that makes heavy use of the GIFgraph.pm module.
<text removed
>I only create the object once. So, apparantly there's a bug in the
>GIFgraph code which is not releasing memory.
You really need to get the author to fix his memory leak then,
if it is really allocating memory and not freeing it at the approriate time.
How quickly the program frees memory it is using depends on what mechanism
it is using to allocate memory. Perl's version of malloc ? Os version of malloc?
perl -V will indicate what is in use.
>If I simply undef the object, will that destroy it and release any memory
>it's using? It doesn't seem to.
No. A call to undef does not necessarily result in a release of memory.
Existing references to an object may prevent it from ever being deallocated,
and in the case of an extension module, perl may not know what memory a module
has allocated, and it is up to the module writer to keep track of memory
allocation.
--
Jason Gloudon
------------------------------
Date: Sun, 22 Mar 1998 12:49:08 -0500
From: "Mark Polakow" <mark@imp.net>
Subject: Die won't die! pleez help
Message-Id: <6f3jvj$fjv$1@viper.america.net>
One thing, my "die" isn't dying and I don't know why? as in
this statement:
mkdir "$root/$dir/$xfile", 0777
or die "Unable to create $xfile in $dir, $!";
I am using Perl on NT I don't know if this makes a difference or not?
Thanks again and agian!
------------------------------
Date: Sun, 22 Mar 1998 19:19:55 GMT
From: Webmaster <webmaster@fccjmail.fccj.cc.fl.us>
Subject: Re: Die won't die! pleez help
Message-Id: <35156300.57064D78@fccjmail.fccj.cc.fl.us>
Mark Polakow wrote:
> One thing, my "die" isn't dying and I don't know why? as in
> this statement:
>
> mkdir "$root/$dir/$xfile", 0777
> or die "Unable to create $xfile in $dir, $!";
>
> I am using Perl on NT I don't know if this makes a difference or not?
>
> Thanks again and agian!
Try this way -
mkdir ("$root/$dir/$xfile", 0777) or die "Unable to create $xfile in
$dir, $!";
Or better still -
$erc = mkdir("$root/$dir/$xfile", 0777) if (-d $dir);
die "Unable to create $xfile in $dir, $!" if $erc;
HTH,
Sneex :-)
------------------------------
Date: Sun, 22 Mar 1998 12:50:47 -0500
From: "Mark Polakow" <mark@imp.net>
Subject: Directory listing question??
Message-Id: <6f3k2p$fkj$1@viper.america.net>
I put in a list directory feature in this script I am working on with Perl
on NT:
Does anyone know of any way I can have Perl differentiate between files and
directories when it lists the content of a directory. My statement looks
like this now:
sub Listdir{
opendir(MYDIR, "$root$dir");
@files = readdir MYDIR;
foreach $file (@files) {
print $file, "\n";
}
}
As always, thanks greatly in advance for all your help!
------------------------------
Date: 22 Mar 1998 18:09:38 GMT
From: Alain.Deckers@man.ac.uk (A. Deckers)
Subject: Re: Directory listing question??
Message-Id: <slrn6hakv2.hhc.Alain.Deckers@bashful.rediris.es>
In <6f3k2p$fkj$1@viper.america.net>,
Mark Polakow <mark@imp.net> wrote:
>I put in a list directory feature in this script I am working on with Perl
>on NT:
>Does anyone know of any way I can have Perl differentiate between files and
>directories when it lists the content of a directory. My statement looks
>like this now:
Doesn't -f $file and -d $file work on win32 Perl?
Alain
--
Perl reference: <URL:http://reference.perl.com/>
Perl language: <URL:http://language.perl.com/>
Perl archive: <URL:http://www.perl.com/CPAN/>
Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
------------------------------
Date: 22 Mar 1998 18:02:15 GMT
From: felicity+spam@kluge.net
Subject: Re: Directory listing question??
Message-Id: <6f3jn7$4ra$6@bigboote.WPI.EDU>
Mark Polakow <mark@imp.net> wrote:
> Does anyone know of any way I can have Perl differentiate between files and
> directories when it lists the content of a directory. My statement looks
> like this now:
use the "-f" and "-d" test flags. ie:
> sub Listdir{
> opendir(MYDIR, "$root$dir");
> @files = readdir MYDIR;
> foreach $file (@files) {
print "File: " if ( -f "$root$dir/$file" );
print "Directory: " if ( -d "$root$dir/$file" );
> print $file, "\n";
> }
------------------------------
Date: Sun, 22 Mar 1998 11:41:32 -0600
From: "Sherman Dunnam" <sdunnam@nospam-flyfishingjournal.com>
Subject: Re: Help with Selena Sol Classified Script
Message-Id: <6f3lj8$2u7$1@fox.dpliv.com>
Never mind. The problem turns out not to be the temp and lock file thing
but a matter of testing equality.
The original script was testing a numeric value using a string operator. I
thought this sort of thing was allowed in PERL but when I changed the
operator from "eq" to "==" voila!!!.
So I have learned something new and have wasted some of your time. I
apologize.
--
---
Sherman
www.flyfishingjournal.com
Sherman Dunnam wrote in message <6f3hph$pu$1@fox.dpliv.com>...
>I am having trouble with the Selena Sol Classified Ad Manager script and am
>hoping someone can help. The script I am using is the one from the book
>"Instant Web Scripts with CGI/Perl" not the one posted on his web page.
>(Although I tried that one with exactly the same symptoms.)
>
>I am a PERL newbie, and a relative UNIX newbie though I have been
>programming in the DOS/Windows world for about 11 years.
>
>I have installed the script on my server and have it running. When adding
>items to the datafile it works perfectly. However when either deleting
>items or modifying items it does not work. Here are the symptoms-
>
>When deleting-
>the search function to find the records the user is allowed to delete works
>fine then apparently nothing happens, I get the message that the item had
>been deleted but it is still there.
>
>When modifying-
>again the search function to find records the user is allowed to modify
>works fine but instead of a modification to the original line in the
>datafile, I get a new line appended that contains only the modified
>field(s), the delimiting pipe symbols are there but there is no data
between
>them and the original record is still in the file.
>
>Suspicions-
>I suspect the problem is in some way related to the scripts use of a temp
>file to copy the database info into as this is what both Delete and Modify
>have in common that Add does not. Other than that I am stumped.
>
>--
>---
>Sherman
>www.flyfishingjournal.com
>
>
>
------------------------------
Date: 22 Mar 1998 19:34:49 GMT
From: "Jon Marshall" <xkn14@dial.pipex.com>
Subject: multi-line matching problem
Message-Id: <01bd55c8$969c7ca0$385395c1@default>
i'm having a problem with the following - if i run this script on the file
ifcon the result is:- hme0 *** 1.0.1.110 *** 1.255.255.255 ***
8:0:20:80:47:ef which is what i want - when i run it on the file ifcn i get
the same line only the ether entry is the one for hme4. what is happening ?
- i'm trying to get a similar entry to the one above for all the interface
cards - i've read the FAQ and still can't understand what is wrong. Any
help is much appreciated
Jon
#/usr/bin/perl -w
#
$/ = '';
open(F, "ifcn") or die "Can't open ifcn for reading $!\n";
while (<F>) {
if ( /^hme\d:/ ) {
($int,$ip,$net,$bro,$ether) =
m/^(hme\d):.*?inet\s+(\S+)\s+\w+\s+(\S+)\s+\w+\s+(\S+).*?ether\s+(\S+)$/s;
}
print "$int *** $ip *** $net *** $bro **** $ether\n";
next;
}
close(F);
file - ifcon
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 1.0.1.110 netmask ff000000 broadcast 1.255.255.255
ether 8:0:20:80:47:ef
file - ifcn
hme0: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 1.0.1.110 netmask ff000000 broadcast 1.255.255.255
ether 8:0:20:80:47:ef
hme1: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 10.71.1.110 netmask ffff0000 broadcast 10.71.255.255
ether 8:0:20:0:0:1
hme2: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 10.72.1.110 netmask ffff0000 broadcast 10.72.255.255
ether 8:0:20:0:0:2
hme3: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 10.73.1.110 netmask ffff0000 broadcast 10.73.255.255
ether 8:0:20:0:0:3
hme4: flags=863<UP,BROADCAST,NOTRAILERS,RUNNING,MULTICAST> mtu 1500
inet 10.74.1.110 netmask ffff0000 broadcast 10.74.255.255
ether 8:0:20:0:0:4
------------------------------
Date: 22 Mar 1998 20:11:29 +0000
From: Bruce Stephens <bruce@cenderis.demon.co.uk>
Subject: Parse::RecDescent Anybody using it in anger?
Message-Id: <m3hg4qbi4u.fsf@cenderis.demon.co.uk>
I have a plan: produce lots of (free) scanners of various sorts (for
various languages) which put some output into some free relational
database (PostgreSQL, probably). Provide retrieval programs to
produce call graphs, class hierarchies, definitions of symbols,
locations of assignments to variables, etc.
The idea is to produce a source navigator type tool. An example of a
scanner would be a parser for TAGS files. Another one would be a
parser for the output of nm. A simple user of this kind of
information might be replacements for an emacs find-tag.
(People thinking of asking for betas for testing should restraing
themselves: this is pre-vapourware. So far, I've written 0 lines of
code, although I have already received a contribution!)
So, some kinds of information is easy to get at: gcc -M (-MM, etc.) or
whatever that Perl module is would give me include file information.
What I'd really like is some free parsers for C and C++, and I'd like
them to be really easy to fiddle with. In fact, parsers written with
Parse::RecDescent would be pretty much ideal (since Perl has nice
modules for interacting with databases too). They should also be
extremely easy to understand, brilliantly documented, and extremely
fast, requiring almost negligable memory even for enormous source
files; I'm willing to compromise a bit, though.
------------------------------
Date: 22 Mar 1998 13:14:28 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Mark Stackhouse <stackhou@execpc.com>
Subject: Perl *is* programming (was Re: Is there a "Newsgroup" for Newbies to Perl?)
Message-Id: <8c1zvusct7.fsf_-_@gadget.cscaper.com>
>>>>> "Mark" == Mark Stackhouse <stackhou@execpc.com> writes:
Mark> I am not a programmer, [...]
And that's your problem. Writing Perl programs is *programming*.
If you don't consider yourself in the class of people that can
program, please don't use Perl.
I'm clearly not an automechanic. I know where the gas goes in, and
how to drive, but under the hood is a complete mystery to me. It's
just as silly for me to tinker under the hood as it is for you to use
Perl. And a lot more dangerous, I might add. It's especially
dangerous for me to advise others on how to tune my engine, because I
don't know how much I don't know! Similarly, you shouldn't be writing
a FAQ. You're off base there. And Abigail rightfully flamed you for
it (not to mention the bad netiquette of stealing other people's works
without permission).
When you decide that you are going to be a programmer, come look at
Perl again. Until then, *hire* a programmer, and stay away from
coding.
Programming is a science, and an art. I've been doing it since I was
9 (roughly a quarter of a century ago). It's something you're either
up for, or not. There's no real "half way". I see a lot of people
taking Perl in my classes that look like they selected the wrong
profession. I bend over backwards to help them, but I fear it's a
lost cause. Leave. Get out of the profession. There's plenty of
people that can do programming in their sleep to take your place.
That's what I want to tell them. :)
Anyway, sorry for rambling, but I hope you catch what I'm saying.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 162 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
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: 22 Mar 1998 17:42:58 GMT
From: alain.deckers@man.ac.uk (A. Deckers)
Subject: Re: Perl + Tk?
Message-Id: <slrn6hajd2.9od.alain.deckers@nessie.mcc.ac.uk>
In <6f3dg0$j0p@nntp02.primenet.com>,
Ken Knecht <kenk@primenet.com> wrote:
>Could someone point me to information about using Tk in Perl, or vice-versa,
>as mentioned in another thread here? None of my Perl books mention Tk in the
>index, and my Tk-Tcl book doesn't mention Perl.
>
>TIA.
news:comp.lang.perl.tk
<URL:http://www.perl.com/CPAN/doc/FAQs/tk/ptkFAQ.html>
Alain
--
Perl Language: <URL:http://language.perl.com/perl/>
Perl Reference: <URL:http://reference.perl.com/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl Archive: <URL:http://www.perl.com/CPAN/>
------------------------------
Date: 22 Mar 1998 12:07:36 -0800
From: ml@gondwanaland.com (Mike Linksvayer)
Subject: Re: perl databases ??
Message-Id: <6f3r28$6kc$1@shell3.ba.best.com>
In article <35153f56.126778213@news.willinet.net>, Ryan <ryan@remove-this-mmainteractive.com> wrote:
>Hello. I have an account at a hosting provider, and I'd like to set up
>a perl database there. I know perl pretty well, and I've done some
>database programming in other languages. But I still don't know where
>to start. I've been to perl.com, and done lots of searching. The perl5
>modules I have available to me on this acount are listed below. With
>this in mind, what type of database should I use, and where do I
>start? I plan to have a few hundred records, with less than 10 fields
>in each record. One field will be user updateable through the web
>page. Thanks a lot for any help.
For a small database like this you can use dbm files very effectively.
See the docs for DB_File, with which you can use a tie'd hash or
array as you'd use any hash or array except that you read it from
disk and changes get magically saved.
Based on the module list you posted, your ISP probably has mSQL
installed, so if you want to use a "real" database you have that
option, though you will probably have to pay them an extra fee to
use it. See the documentation for DBI for how to talk to mSQL from
Perl.
--
Mike Linksvayer http://gondwanaland.com/ml/
------------------------------
Date: Sun, 22 Mar 1998 17:56:04 GMT
From: nick@NOSPAMTHANKSciof.sbcc.net (Nick Tonkin)
Subject: Re: Perl for Win32 {NT4.0 sp3} simple scripting probs...
Message-Id: <35154a01.73246392@news.silcom.com>
On Sun, 22 Mar 1998 14:59:08 +0900, "Troy Coulombe"
<troy.c@scsi-online.net> wrote:
>REF: Learning Perl page 87 --> $sentence=~/$what/
>
>Having RTF[M,FAQ]
>
>I realize that PERL is native to UNIX, and I am not
>using UNIX but
>NT4.0 SP3 & a precompiled version of PERL... .
>The script runs {ie: no syntax error] but I can not get
>my hack
>[listed below] or the example in the book to work
>correctly
>
>$OPTION=qw(0 1 2 3 4);
>do
{
>
> print "0 : Quit \n";
> print "1 : $CHOICE1\n";
If you had used -w you would see that Perl thinks you have a var
called $CHOICE1 now
> chomp ($CHOICE=<stdin>); }
>until ($OPTION =~ /$CHOICE/);
>
>
Maybe this is what you want?
________________________________________________
use strict;
my ($result,@OPTION,$CHOICE);
push (@OPTION,0..4);
chomp ($CHOICE=<stdin>);
foreach (@OPTION) {
$result = (/$CHOICE/) ? "Choice = $_" : "No match"; ## [1]
last if $result =~ /^C/;
}
print "$result\n";
_________________________________________________
[1] Nifty construct that says:
1 = 2 ? 3 : 4
1 gets 3 if 2 is true, or 4 if 2 is false
Always use -w !!
HTH
Nick
>Neither my hack, nor the book's hack seems to work...
>What did I miss? Don't mind doing the reading, just
>haven't been able to find anything about this...
>
>Basically: how do I compare a scalar to an entire list?
>TIA
>
>--
>Troy C
>Please remove the dot from between the troy and the c
>when replying!
>
>
>
------------------------------
Date: Sun, 22 Mar 1998 19:29:22 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Perl for Win32 {NT4.0 sp3} simple scripting probs...
Message-Id: <Eq8JGy.7vv@world.std.com>
"Troy Coulombe" <troy.c@scsi-online.net> writes:
>$OPTION=qw(0 1 2 3 4);
$OPTION is a scalar, the result of qw(0 1 2 3 4) is a list. What does
"$OPTION" contain after it hits that line? (check with the debugger to
find out.) Did you run the script with the "-w" flag? If so, didn't
the message from that line seem a bit odd? If you didn't run the
script with the "-w" option, why not?
> chomp ($CHOICE=<stdin>); }
>until ($OPTION =~ /$CHOICE/);
This seems a bit strange as well. reading a new value into $CHOICE
each time, and comparing that, as a regular expression, against the
value in $OPTION, which remains constant.
Most importantly, how do you expect your "hack" to do? I have my
guesses, but without your input into what you expect the result to be,
its hard to be sure that any modifications to your code will be
leading towards the correct results.
Sometimes, if you reread or rewrite (or create) some sort of
specification, (with as much formality as the project requires) it
will point out problems in the implementation.
--
Andrew Langmead
------------------------------
Date: Sun, 22 Mar 1998 19:09:23 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: PerlRing???
Message-Id: <Eq8IJn.MLD@world.std.com>
nvp@shore.net (Nathan V. Patwardhan) writes:
>the AS port didn't seem to include any this doc with the
>distribution. Nor did it include the pod2<whatever> converters.
All the versions of thw ActiveState port of perl that I looked at had
a "docs" subdirectory, which included HTML-ized versions of the basic
perl documentation and docs for their own Win32 modules. (None of the
modules docs though.)
--
Andrew Langmead
------------------------------
Date: Sun, 22 Mar 1998 19:17:04 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: PerlRing???
Message-Id: <Eq8IwG.34t@world.std.com>
joergen.lang@schwaben.de (Joergen W. Lang) writes:
>Nathan V. Patwardhan <nvp@shore.net> wrote:
>> Seriously, when you build/install the win32 standard port, you should
>> be asked if you want to install HTML docs. Just say yes.
>Now, after saying "Yes" about two hundred times, my neighbours start
>giving me these weird looks but I still don't get asked if I want to
>install HTML docs....
>Maybe that's because I'm on a Mac... ;-))
The mac, has a great tool for looking at the perl documentation. It is
a program called "Shuck" that reads files in POD format. The MacPerl
IDE has pointers in the "Help" menu to most of the installed
documentation and will fire up "Shuck" with the correct file.
It also installs the pod2* scripts in the "pod" folder.
--
Andrew Langmead
------------------------------
Date: Sun, 22 Mar 98 15:41:13 +0400
From: "Ben Coleman" <bcoleman@mindspring.com>
Subject: Re: PerlRing???
Message-Id: <itaruyamkzitceu.pminews@user-37kbvvi.dialup.mindspring.com>
On Sun, 22 Mar 1998 19:09:23 GMT, Andrew M. Langmead wrote:
>All the versions of thw ActiveState port of perl that I looked at had
>a "docs" subdirectory, which included HTML-ized versions of the basic
>perl documentation and docs for their own Win32 modules. (None of the
>modules docs though.)
And a lot of newbies fail to find them.
I wonder if it would help if the Win32 binary distributions would, as
part of the install procedure, create a 'Perl docs' program group(or
whatever the proper terminology is for Start menu folders) containing
shortcuts to those docs?
Ben
--
Ben Coleman NJ8J | The attempt to legislatively
Internet: bcoleman@mindspring.com | micromanage equality results, at
http://bcoleman.home.mindspring.com/ | best, in equal misery for all.
------------------------------
Date: Sun, 22 Mar 1998 19:02:40 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Squelching STDIN
Message-Id: <Eq8I8H.Jz6@world.std.com>
Jamie Fullerton <jfullert@csdept.keene.edu> writes:
>A script to further authenticate a secure login to a server will prompt
>the user for a key.
>I wish to "squelch" stdin so that the key entered is not verbosed to the
>screen,
Have you seen the entry in the FAQ "How do I ask the user for a
password?" <URL:http://www.perl.com/CPAN/doc/manual/html/pod/
perlfaq8/How_do_I_ask_the_user_for_a_pas.html>
--
Andrew Langmead
------------------------------
Date: 22 Mar 1998 00:52:47 -0800
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: Using perl code as a config file syntax? (Or, can require return more then one value?)
Message-Id: <r8ogyzcdk0.fsf@asc.sps.mot.com>
Zenin <zenin@archive.rhps.org> writes:
> I'm trying to use a perl file as a config file. The file would look
> something like this:
>
> (
> FOO => [ 'some', 'foo', 'options' ],
> BAR => [ 'some', 'bar', 'options' ],
> );
>
> And be read with simply:
>
> my %config = require 'some.config';
> [...] it seems there really, really must be a Better
> Way[tm]. Is there any way to read a perl data stuct out of a file without
> assigning it to a variable or using this sub ref kluge? -I'm tring to avoid
> writing my own config code parser, because perl already does a much, much
> better job of it then I could ever do. :-)
Although a numbr of solutions to the question of 'how to do this with
require' have been suggested, there is indeed a "Better Way(TM)". Use
a package:
Declare, in Utility/Config.pm:
#----------------------------------------------------------------------
package Utility::Config;
require 5.004;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = ();
# Export the config variable only if asked to do so...
@EXPORT_OK = ('%ConfigInfo');
use vars '%ConfigInfo';
%ConfigInfo = ('Keyword' => ['some', 'options']);
#----------------------------------------------------------------------
and use it thusly
#----------------------------------------------------------------------
# import...
use Utility::Config('%ConfigInfo');
# One way to use it:
%ThisCopy = %Utility::ConfigInfo;
# another...
use vars '%ConfigInfo';
%ThisCopy = %ConfigInfo;
#----------------------------------------------------------------------
HTH! (let me know if it does or doesn't!)
Martin.
------------------------------
Date: Sun, 22 Mar 1998 12:39:09 -0600
From: tim@maroney.org
Subject: Re: Wierd redirection problem with Location:
Message-Id: <6f3lo1$oij$1@nnrp1.dejanews.com>
In article <35070e3f.160314962@news.deltanet.com>,
fallout@deltanet.com_remove_ (Fallout23) wrote:
> If you are using PWS or IIS, it is also REQUIRED that you return the
> status code 301 too. took me a while to figure that one out on my own.
Aha. So that's why my transparent redirects don't do anything, though I'm
using Apache. Is this just the return code from exit, that is, would the perl
code be simply:
exit 301;
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
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 2158
**************************************