[6356] in Perl-Users-Digest
Perl-Users Digest, Issue: 978 Volume: 7
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 20 05:07:19 1997
Date: Thu, 20 Feb 97 02:00:26 -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 Thu, 20 Feb 1997 Volume: 7 Number: 978
Today's topics:
Re: $ls = `ls $file`; but not in NT Perl (Alan Sterger)
Re: Can I set s/// with different switches determined a (Dave Thomas)
Re: Class library to make C++ more Perlish? <tchrist@mox.perl.com>
efficiency of many fixed strings vs one regex (Rahul Dhesi)
Re: efficiency of many fixed strings vs one regex (Ilya Zakharevich)
Re: GDBM_File on BSDI (Mike Heins)
Re: How to become a member ......? (Nathan V. Patwardhan)
Re: How to become a member ......? (Tad McClellan)
JAPH script with a moral. (Sean M. Burke)
Re: Length of an assoc. array? <rootbeer@teleport.com>
Re: locking files on the web? <merlyn@stonehenge.com>
Merge content from several files into one document (Jarle Aasland)
Perl 5/MS Frontpage/cgi/Win95 problem <mark.h@virgin.net>
Re: Perl and MsAccess dcon@eden.com
perl help ... <cklam@tmi.com.sg>
Re: perl help ... <dbenhur@egames.com>
Re: Perl on Windows 95 <at932@detroit.freenet.org>
Re: Perl on Windows 95 (Hans Schrader)
Re: Perl5 for Windows 95 <billc@tibinc.com>
Re: regexp's in XEmacs vs. Perl <vladimir@cs.ualberta.ca>
Sockets and Datagrams msosteri@yesic.com
Suggestions for IPC based database? (Peter Bierman)
tail -f in perl <tor@kmd.dk>
Re: trouble with 'use strict' and 'require package.pl' <billc@tibinc.com>
using perl 5.003 on AIX4.1 (dynamic load problem) (Omer ben-shalom)
What is the best way to find an unique record in a file <kong@starnetinc.com>
Re: What is the best way to find an unique record in a <egwong@netcom.com>
Win32 substitute for chown() <boutros+@andrew.cmu.edu>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Feb 1997 22:38:03 -0700
From: sterger@primenet.com (Alan Sterger)
Subject: Re: $ls = `ls $file`; but not in NT Perl
Message-Id: <5egnvr$57i@nnrp1.news.primenet.com>
In article <3307B306.439F@bgraham.com>, bgraham@bgraham.com says...
>
>Hello,
>
>I'd like help translating this into something that the binary version
>(NT) of Perl can cope with. #$ls = `ls $file`; works in unix but not
>in Windows version of perl... How do I do this then?
>
>Thanks
>Bo Graham
Buy the NT 4.0 Resource Kit and install same. In the POSIX directory are UN*X
commands one of which is ls.
-- Alan
------------------------------
Date: 20 Feb 1997 03:10:19 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Can I set s/// with different switches determined at runtime?
Message-Id: <slrn5gnfvq.jpc.dave@fast.thomases.com>
On Wed, 19 Feb 1997 13:32:28 +0000, Charles Herold <cherold@pathfinder.com> wrote:
> I have a simple little script that changes one phrase to another in a
> file. I'd like to allow the user to use command line switches and then
> ad them to the substitution string. What I tried as an experiment,
> which didn't work but which shows what I wanted to do, is this:
Under Perl 5, you can use the (?imsx) syntax to put the switches in the
string:
subst("Hello", "L", "*", "i");
subst("HeLlO", "l", "@", "gi");
sub subst($$$$)
{ my ($what, $from, $to, $switch) = @_;
print "$what -> ";
$what =~ s/(?$switch)$from/$to/;
print "$what\n";
}
__END__
Produces:
Hello -> He*lo
HeLlO -> He@@O
Regards
Dave
--
_________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: 20 Feb 1997 08:52:37 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Class library to make C++ more Perlish?
Message-Id: <5eh3cl$9mt$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, "Charlton Barreto" <charltoN@illustra.com> writes:
:The STL already provide associative arrays
Are they 8-bit clean? Can you distinguish between a missing key and
a missing value? Do they automatically resize themselves for reasons
of efficiency? Can they hold arbitrary and heterogeneous objects?
Can those objects' types be determinable and inspectable at run time?
Do they have their memory automatically allocated and deallocated?
Can you transparently bind them to databases, like GNU DBM or Berkeley DB?
Are they garbage collected? Can you dynamically build an associative
arrays of closures with deep binding of embedded lexical variables?
:and the <vector> and
:<matrix> template classes which are far superior to the built-in Perl
:or C-type arrays.
I'm amazed to see anyone mention Perl arrays and C arrays in such
a parallel construct, considering how little they have in common.
C arrays can't hold just anything, can't be inspected post-facto about
what their types are, don't grow on demand, don't have an inspectable
length, and don't get garbage collected. C arrays are just blocks of
memory, or wild pointers thereto, with all the attendant problems such
things have in other low-level languages -- like assembler.
:Regex pattern matching is available in the standard
:libraries of most post-April-1995-DWP C++ compilers.
I'll wager that the pattern matching in those libraries is a pale and
impoverished echo of Perl's. Let's check: Is it well integrated into
the language? How many backslashes does it take to match a backslash?
Is there a general rule for rendering special characters non-special?
Does it support word-boundary and non-word-boundary assertions? Does it
have both maximal (greed) and minimal matching? Does it do lookaheads
assertions or negations? Is it 8-bit clean? Can you search things
with nulls in them? Can you select your own quoting? Can you format
your pattern in a legible fashion with indentation and line breaks?
Can you place comments in your pattern? Can character-classes have
meta-classes in them? Can substitutions take an arbitrary function on the
RHS? Are there no restrictions on the number of cached subexpressions?
Does it support case-insensitive backreferences? Can you control single-
versus multi-line matching? Is it locale-aware? Does it do exhaustive,
worst-case searching (POSIX NFA) even on early successes? Does it run
very fast?
:Perl scalars
:are strings, so you can just use C++ string classes.
No, Perl scalar can hold strings, but they are not strings. They are
scalars that can transparently hold strings, numbers, or references
and objects, all of which are automatically allocated, de-allocated,
and garbage collected. This is just one of the advantages of using
a high-level language like Perl instead of a low-level one like C++.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
if (instr(buf,sys_errlist[errno])) /* you don't see this */
--Larry Wall in eval.c from the 4.0 perl source code
------------------------------
Date: 20 Feb 1997 03:10:15 GMT
From: dhesi@22245864.trackme.com (Rahul Dhesi)
Subject: efficiency of many fixed strings vs one regex
Message-Id: <5egfan$spn@samba.rahul.net>
If I am searching the same text for several things, I always try to
combine them into a single regex for efficiency, or will perl internally
combine the searches anyway?
For example:
/\@somedomain\.com/ && &found;
/\@anotherdomain\.com/ && &found;
/\@yetanother\.com/ && &found;
/\@fourthdomain\.com/ && &found;
Is it better if I combine them into the following?
/\@(somedomain|anotherdomain|yetanother|fourthdomain)\.com/ && &found;
--
Rahul Dhesi <dhesi@spams.r.us.com>
a2i communications, a quality ISP with sophisticated anti-junkmail features
*** Now featuring Strategy C for junk-mail-proof News postings ***
|| "please ignore Dhesi" -- Mark Crispin <mrc@CAC.Washington.EDU> ||
------------------------------
Date: 20 Feb 1997 04:46:53 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: efficiency of many fixed strings vs one regex
Message-Id: <5egkvt$n31$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Rahul Dhesi
<dhesi@22245864.trackme.com>],
who wrote in article <5egfan$spn@samba.rahul.net>:
> /\@somedomain\.com/ && &found;
> /\@anotherdomain\.com/ && &found;
> /\@yetanother\.com/ && &found;
> /\@fourthdomain\.com/ && &found;
>
> Is it better if I combine them into the following?
>
> /\@(somedomain|anotherdomain|yetanother|fourthdomain)\.com/ && &found;
a) All the questions like this one should be solved by using
Benchmark.pm.
b) If you want to explain results from these tests, you may need to
read the Hip-Owl book by Jeffrey Friedl.
c) One may expect that the particular regexp above _might_ be improved
by merging, but this is very dangerous to assume anything when perl's speed
is concerned. Too many optimizations/pessimizations may be triggered
behind the scene.
Ilya
------------------------------
Date: 20 Feb 1997 09:27:01 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: GDBM_File on BSDI
Message-Id: <5eh5d5$tu@vixen.cso.uiuc.edu>
Mike Heins (mheins@prairienet.org) wrote:
: I believe I am having some locking problems with DB_File on a BSDI 2.1
: system (and probably others using DB_File). I would like to test
: with GDBM_File, which has integral locking, but can't get Perl to
: build with it.
:
: I built the library OK, though the test programs ('make progs') would
: not all compile, and a quick test with 'testgdbm' appears to work.
: But when I build the library into Perl (both 5.003_00 and 5.003_26)
: the lib/gdbm test fails on test 5 (and 6 and 7, when run manually
: from the test directory). All other tests pass.
:
: Searches for 'bsd gdbm' on DejaNews and perusal of the appropriate
: FAQs/docs appear to offer nothing. If anyone has done this successfully,
: I would appreciate some help.
:
(For benefit of archive searchers)
Solved by linking statically -- still no luck with building the
library and linking dynamically.
--
Regards, ___ ___
Mike Heins http://www.iac.net/~mikeh|_ _|____ |_ _|
Internet Robotics | || _ \ | |
This post reflects the Oxford, OH 45056 | || |_) || |
opinion of my employer. <mikeh@iac.net> |___| _ <|___|
513.523.7621 FAX 7501 |_| \_\
------------------------------
Date: 20 Feb 1997 01:09:26 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: How to become a member ......?
Message-Id: <5eg886$299@fridge-nf0.shore.net>
Baskaran Tranquebar (baskaran@isi.com) wrote:
: I would like to enroll myself in this news group. May I ask for your
: advise in how should I do that?.
You have to leave your house and run around the block two times.
Well, okay, by posting to this newsgroup, and asking/answering questions
(or just reading), you're a member! Welcome!
--
Nathan V. Patwardhan
nvp@shore.net
"What is your quest?"
------------------------------
Date: Wed, 19 Feb 1997 21:35:41 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: How to become a member ......?
Message-Id: <dqgge5.vq4.ln@localhost>
Baskaran Tranquebar (baskaran@isi.com) wrote:
: I would like to enroll myself in this news group. May I ask for your
: advise in how should I do that?.
You're in!
Welcome.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 20 Feb 1997 08:29:14 GMT
From: sburke@babel.ling.nwu.edu (Sean M. Burke)
Subject: JAPH script with a moral.
Message-Id: <5eh20q$doo@news.acns.nwu.edu>
#!/usr/bin/perl
$_ = lc(<<END);
Stal kalventu dranecult tonssak?
Litaritak, inuhannst slavatuk linesu?
Tolnsfen dets'n lad, belvens trunt,
filiradu lenish'ch renok'.
Luns fradsvats Redis Taresaval
enks talkents tretent,
blasal nentunlamt sloncha.
END
tr/a-z//cd;
s/[^aeiou][aeiou]/1/g;
tr/1/0/c;
s/(.{5})/pack("b8","${1}010")/eg;
print;
exit;
# For more fun along these lines, see /Disappearing Cryptography/,
# Peter Wayner, ISBN 0-12-738671-8
--
| Sean M. Burke sburke@ling.nwu.edu http://ling.nwu.edu/~sburke/
------------------------------
Date: Wed, 19 Feb 1997 18:40:42 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Kovacs Anita <anita@unicorn.sch.bme.hu>
Subject: Re: Length of an assoc. array?
Message-Id: <Pine.GSO.3.95q.970219183910.18400J-100000@kelly.teleport.com>
On 19 Feb 1997, Kovacs Anita wrote:
> Subject: Length of an assoc. array?
>
> Can I get it somehow?
$number_of_keys = scalar keys %my_hash;
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 19 Feb 1997 18:51:34 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Melissa Ann Buttrum <mbuttrum@indiana.edu>
Subject: Re: locking files on the web?
Message-Id: <8csp2sxn15.fsf@gadget.cscaper.com>
>>>>> "Melissa" == Melissa Ann Buttrum <mbuttrum@indiana.edu> writes:
Melissa> I'm writing a program which does the following
[essentially, open, flock, read, close, open, flock, write, close]
Melissa> If four or five people were to submit at the same
Melissa> time, some requiring appends and some requiring
Melissa> rewrites, would the above script allow ANY
Melissa> possibility of data loss?
Yes. Don't do it that way.
Melissa> the man page for flock
Melissa> says that flocks from different clients don't
Melissa> communicate with each other. Does this mean that
Melissa> people surfing my web page are different clients
Melissa> whose flocks can't communicate with each other? Is
Melissa> there any way around this?
flock *is* a communication between you and the kernel, and the kernel
ensures that only one process has an exclusive flock at a time.
Melissa> Do I need a seek statement? if so, how do it do it?
Here's the canonical "update" model with flocking:
open FILE, "+>>in-duh-vidual";
flock FILE, 2;
seek FILE, 0, 0;
@contents = <FILE>;
## process @contents to the new contents
seek FILE, 0, 0;
truncate FILE, 0;
print FILE @contents;
close FILE;
Do *not* release the flock before you close. Bad bad bad. This *is*
the way. Yes, *all* of these steps are necessary. Any deviation will
break down somewhere. You have been warned.
Also, keep the time to process @contents *very* short. Only one
process at a time can exist between the flock and the close.
Maybe I should put this into a module... hmmm....
critical "filename", sub { code to process @contents; };
Melissa> andy rumelt
Melissa? Andy? Who knows! :-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 558 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@ora.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, 20 Feb 1997 08:09:12 GMT
From: sajaa@sn.no (Jarle Aasland)
Subject: Merge content from several files into one document
Message-Id: <330c03c3.721247@news.eunet.no>
This is what I am trying to do:
I have made a script for generating individual text-files (based on
user input through html/forms), named dd-mm-y-hrs-min-sec.txt.
The next thing - this is where I'm stuck - is to retrieve the content
from the 25 NEWEST (how can I get it sorted??) files and put it all
into one html-document (index1.html).
The content of the next 25 files should be written into another
document (index2.html) and so on. These "index-files" should be
generated by the script as needed...
I am new to Perl, and I really need some tips on this one... I am
testing the script on NT, but the intention is to run it on
Unix-plattform.
Thanks in advance - Jarle Aasland, NORWAY
------------------------------
Date: 20 Feb 1997 02:20:02 GMT
From: "Mark Nicholas Henry" <mark.h@virgin.net>
Subject: Perl 5/MS Frontpage/cgi/Win95 problem
Message-Id: <01bc1ed4$5b3aa000$db40a8c2@p100>
Can anyone help me? I am trying to setup Microsoft Frontpage so it can
execute perl scripts as cgi programs.
Other cgi programs (compiled .exe) work fine, but the frontpage personal
web server seems to be having problems executing my perl scripts. The error
message I am getting suggests that the server is incorrectly configured.
I have associated .pl & .cgi file with perl.exe and the interpreter works
fine in Win95.
The Perl installation failed to associate .pl files with perlis.dll, is
this my problem?
I can't find any help on using perl with frontpage in any of the faqs I
have read.
Would very much appreciate any help.
------------------------------
Date: Thu, 20 Feb 1997 03:58:32 GMT
From: dcon@eden.com
Subject: Re: Perl and MsAccess
Message-Id: <330bcb7a.33574342@news.eden.com>
This isn't access specific, but you can check out the ODBC module.
study() CPAN at www.perl.org. The windoze port has some weird OLE
stuff that might help, too...? www.activeware.com
cadams@crrel.usace.army.mil (Chad Adams) wrote:
>Are there any modules for Win 95/NT that will allow CGI access to an MS Access
>database running on the same machine?? I have found references to Oracle.
>informix and others, but none for Access.
>
>Any help would be greatly appreciated, and I will summarize responses if
>necessary.
>
>:)
>
>Cheers!
> Chad Adams
> System Administrator
> USACRREL
>
>
------------------------------
Date: Thu, 20 Feb 1997 10:31:00 +0800
From: ck lam <cklam@tmi.com.sg>
Subject: perl help ...
Message-Id: <330BB764.6677@tmi.com.sg>
hi
can anybody know how to use perl to replace some text with new text
after matching a pattern ".subckt pdp" and do matching only
between .subckt....to ens subckt only for example
.subckt pdp012232
xm01 avs avd
xm2 1 3
xm3 3 4 5 6
.ends subckt
.subckt and2
xm12 34 4 4
xms 1 2 3 4
.ends subckt
.
.
.
.
.
.
I just want to replace the all "xm3" found in sub circuit
pdp...something and change it to xm5. So I need a perl to match
expression subckt pdp and begin replace operation until I come across
a ends subckt.
thanks
------------------------------
Date: Wed, 19 Feb 1997 22:59:37 -0800
From: Devin Ben-Hur <dbenhur@egames.com>
To: ck lam <cklam@tmi.com.sg>
Subject: Re: perl help ...
Message-Id: <330BF659.2C19@egames.com>
ck lam wrote:
: .subckt pdp012232
: xm01 avs avd
: xm2 1 3
: xm3 3 4 5 6
: .ends subckt
:
: .subckt and2
: xm12 34 4 4
: xms 1 2 3 4
: .ends subckt
: I just want to replace the all "xm3" found in sub circuit
: pdp...something and change it to xm5. So I need a perl to match
: expression subckt pdp and begin replace operation until I come across
: a ends subckt.
this should do the trick:
$dosubst = 0;
while (<>) {
if (/^\.subckt pdp/) { $dosubst = 1 }
elsif (/^\.ends subckt/) { $dosubst = 0; }
else { s/xm3/xm5/g; }
print;
}
--
Devin Ben-Hur <dbenhur@egames.com>
eGames.com, Inc. http://www.egames.com/
eMarketing, Inc. http://www.emarket.com/
"Don't run away. We are your friends." O-
------------------------------
Date: 20 Feb 1997 04:04:01 GMT
From: "Mike Conley" <at932@detroit.freenet.org>
Subject: Re: Perl on Windows 95
Message-Id: <01bc1ee2$dec49a80$9c71adce@crc3.concentric.net>
Hank LeMieux <hanklem@ibm.net> wrote in article <330B53FE.872@ibm.net>...
>
> 2) Install a server on your machine and run it locally. That's how I
> test my scripts.
>
What is an effective way to do this on win 95? I want to test scripts,
not run a Web server, so it should be really simple.
--
Mike Conley
mconley@bigfoot.com
------------------------------
Date: Thu, 20 Feb 97 06:44:07 GMT
From: hans.schrader@geol.uib.no (Hans Schrader)
Subject: Re: Perl on Windows 95
Message-Id: <5egse2$oet$1@toralf.uib.no>
In article <330B53FE.872@ibm.net>, hanklem@ibm.net wrote:
You may want to check out our perl pages-
URL="http://hjs.geol.uib.no/Perl/"
>Mark,
>
>You wrote,
>> I would like to also see how it works by loading the page into Netscape
>> locally and then running the script (like it would on a server). Is
>> this possible. When I tried clicking on the button that calls the
>> script nothing happened.
>
>Well, here are two options:
>
>1)Use Netscape's File|Open command to directly open the script. When
>netscape says it doesn't know what to do with the file, tell it to open
>it with the script interpreter (ie: if you're using perl, tell it to use
>perl.exe as the helper.) All this will do is have Netscape open the perl
>command window and run the script every time you open a .pl file. This
>won't emulate what the script will do on the server.
>
>2) Install a server on your machine and run it locally. That's how I
>test my scripts.
>
>Hank
>--
>
>Hank LeMieux
>Freelance Web Design/JavaScript/CGI
>Santa Fe, NM, USA
>(505) 986-8166
>http://members.aol.com/HankWeb/
>
>
Hans Schrader-Eureka's SySop:
"nglhs@alf.uib.no"--"http://hjs.geol.uib.no/"
------------------------------
Date: Wed, 19 Feb 1997 22:56:50 -0500
From: Bill Cowan <billc@tibinc.com>
To: Nobody <nobody@logica.com>
Subject: Re: Perl5 for Windows 95
Message-Id: <330BCB82.F93@tibinc.com>
Nobody wrote:
>
> I'm deperately trying to find a copy of perl5 for Windows 95 -
>
> Can anyone hepl ?
>
> Many Thanks
>
> Mat
Useful URLs for Win32 Perl (NT Perl)
------------------------------------
Win32 Perl for Windows NT:
http://www.activeware.com/ [also online web pages]
http://www.perl.com/CPAN/ports/win32/Perl5/
Searchable Archive for Perl-Win32-users Mailing List:
http://www.divinf.it/perl-win32/index.sht
Evangelo's Frequently Asked Questions (FAQ):
http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com> Voice:919-490-0034 Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707
------------------------------
Date: 20 Feb 1997 01:10:53 -0700
From: Vladimir Alexiev <vladimir@cs.ualberta.ca>
Subject: Re: regexp's in XEmacs vs. Perl
Message-Id: <omiv3ndhiq.fsf@tees.cs.ualberta.ca>
Hey, doesn't the other party need to have etalk too in oreder to use etalk?
------------------------------
Date: Wed, 19 Feb 1997 19:11:08 -0600
From: msosteri@yesic.com
Subject: Sockets and Datagrams
Message-Id: <856400546.7961@dejanews.com>
Does anyone out there want to give me a quick rundown on constructing a
datagram?? You an leave the socket create, bind, and connect stuff out.
Any info would be greatly appreciated
Thanks,
mike
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 19 Feb 1997 23:37:04 -0800
From: bierman@apple.com (Peter Bierman)
Subject: Suggestions for IPC based database?
Message-Id: <bierman-1902972337040001@bierpe3.apple.com>
I'm trying to create a rather large database in perl. It doesn't have to
be incredibly flexible, I'm more or less mapping fields to varriables.
But I want to run one database process, and have all sorts of clients of
this database running against it. There were a few modules in CPAN that
looked good, but they're under development. :-/ In particular, the
IPC::Globalspace module, and the IPC::RPC module.
Does anyone have an experince doing something like this? What did you use?
I guess I could resort to DBM mapping all of the varriables, and using
lockfiles to restrict write access, but I feel like there has to be a more
efficient way.
Any suggestions?
-pmb
--
bierman@apple.com
http://www.upl.cs.wisc.edu/~lunatic/ "This is MASS MADNESS you MANIACS!"
------------------------------
Date: Thu, 20 Feb 1997 09:52:59 +0100
From: Torfinn Keringen <tor@kmd.dk>
Subject: tail -f in perl
Message-Id: <330C10EB.7257@kmd.dk>
Hey, I some help,
I have this script who makes logfiles, D0220 - D0221 - DYYMM and
so on, one each day.
What I need is a script that work like tail -f, but in addition
find out if there is a new file, if there is continue reading
that file, else wait for a new file.
I think you understand the problem.
------------------------------
Date: Wed, 19 Feb 1997 23:17:34 -0500
From: Bill Cowan <billc@tibinc.com>
To: "Kenneth W. Lee" <kenlee@congo.morgan.com>
Subject: Re: trouble with 'use strict' and 'require package.pl'
Message-Id: <330BD05E.5AD@tibinc.com>
Kenneth W. Lee wrote:
>
> Hi,
>
> I'm trying to pass in two parameters to my foobar.pl from the command line
> using 'use strict' and some 'require PACKAGE.pl'. Without going into
> the gory details of how PACKAGE.pl works, it simply takes in parameters
> like "in=FOO" and "out=BAR" and returns $opt_in and $opt_out containing
> the values "FOO" and "BAR", like so:
> --- CUT ---
>
> #!/usr/local/bin/perl5
>
> use strict;
> require "PACKAGE.pl";
>
> # Main
> {
> my $rc = &getStuff('in=s','out=s');
>
> my $in = $opt_in;
> my $out = $opt_out;
>
> print "in=$in out=$out\n";
> }
>
> --- CUT ---
> But when I invoke the script I get the following error message:
>
> $ foobar.pl -in FOO -out BAR
> Global symbol "opt_in" requires explicit package name at foobar.pl line 10.
> Global symbol "opt_out" requires explicit package name at foobar.pl line 11.
> Execution of foobar.pl aborted due to compilation errors.
> $
>
> The code runs fine without 'use strict' but is there a way
> of getting this to work with strict? Perhaps using my() or
> (de)referencing?
>
> Thanks in advance,
> --
> Ken
> --
What about doing one of the following:
1. $::opt_in and $::opt_in to qualify your variables (shorter than
doing $main::opt_in).
2. Consider "use vars qw($opt_in $opt_out);" for vars.pm module.
Need at least 5.002?
I use the $::opt_in style for my command line switches with Getopt::Std
module to avoid this error message and still do "use strict".
-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com> Voice:919-490-0034 Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707
------------------------------
Date: 19 Feb 1997 07:53:10 GMT
From: omer ben-shalom@ccm.jer.intel.com (Omer ben-shalom)
Subject: using perl 5.003 on AIX4.1 (dynamic load problem)
Message-Id: <5eebh6$vqi@www.iil.intel.com>
Hi all
I managed to compile perl 5.003 on AIX4.1.5 OK when not asking for
dynamic loading.
I even managed to compile WITH dynamic load but no module using this
passed "make test".
I want to be able to compile,install and use the DBI/DBD(sybase) modules.
can anyone suggest a resolution to this problem
(either how to compile proparly for dynamic load or how to compile
the packages to work sith static load perl)
thanks to all who reply in advance.
PS - I would approciate a copy of the reply by mail if possible.
------------------------------
Date: 20 Feb 97 04:27:03 GMT
From: "Xiang Kong" <kong@starnetinc.com>
Subject: What is the best way to find an unique record in a file?
Message-Id: <01bc1ee7$3b1d8400$0d70c9d0@kong>
I have a 500,000-record file which keyed by a unique number.
I want to find record 399,999's value.
Can you tell me what the file's format should be for best way to find that
record?
Best way means the simplest and the quickest way.
Thanks for any help!
------------------------------
Date: Thu, 20 Feb 1997 06:52:46 GMT
From: Eric Wong <egwong@netcom.com>
Subject: Re: What is the best way to find an unique record in a file?
Message-Id: <egwongE5w33y.4B7@netcom.com>
Xiang Kong <kong@starnetinc.com> wrote:
: I have a 500,000-record file which keyed by a unique number.
: I want to find record 399,999's value.
: Can you tell me what the file's format should be for best way to find that
: record?
: Best way means the simplest and the quickest way.
: Thanks for any help!
If your records are of fixed lengths (or, at the very least,
have a maximum allowable length) it becomes very easy to
seek() for a particular record.
seek(FILE, $record_size * ($i - 1), 0); # if counting from 1
All you have to do is reformat your file so that all records
are the same size.
If your data is fairly static (doesn't change much) you could
make a quick index file.
Or you could download and install Berkeley DB.
Whatever works, I suppose.
------------------------------
Date: Thu, 20 Feb 1997 03:05:44 -0500
From: Sameh R Boutros <boutros+@andrew.cmu.edu>
Subject: Win32 substitute for chown()
Message-Id: <0n30LMm00iWW4Lu6li@andrew.cmu.edu>
can anyone point me to a Win32 susbstitute for chown()
THANKS!
-sam
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 V7 Issue 978
*************************************