[10242] in Perl-Users-Digest
Perl-Users Digest, Issue: 3835 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 27 08:08:22 1998
Date: Sun, 27 Sep 98 05:00:39 -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 Sun, 27 Sep 1998 Volume: 8 Number: 3835
Today's topics:
Re: /etc/passwd file (Bart Lateur)
<*> in cgi <wallsr@jcave.com>
Re: <*> in cgi <admin@hatsoft.com>
Re: <*> in cgi <gellyfish@gellyfish.btinternet.com>
? Re: Porting Unix perl script to winNT servers <new_email@see.web.page>
help a newbie cim@online.ee
Re: help a newbie <admin@hatsoft.com>
Re: help a newbie <gellyfish@gellyfish.btinternet.com>
Re: How do i unpack a 64-bit long? (Honza Pazdziora)
Re: How to read contents of all *.TXT files in director (Bart Lateur)
Re: How to strip binary data from a file (Bart Lateur)
How Too?? File Copy from 1 server to the scripts serve <admin@hatsoft.com>
Re: How Too?? File Copy from 1 server to the scripts s <gellyfish@gellyfish.btinternet.com>
Re: is perl better for these? <eashton@bbnplanet.com>
Re: is perl better for these? (Bart Lateur)
Re: M/// problem again... (Bart Lateur)
Re: Multiple perlscripts editing same file (Craig Berry)
Need help with $1 pattern melLA@west.net
Re: newbie DATE question (Peter J. Kernan)
Re: newbie Perl Program help <caustic@causticinteractive.nospam.com>
Re: newbie Perl Program help (Larry Rosler)
Re: newbie Perl Program help <ajohnson@gpu.srv.ualberta.ca>
Re: newbie Perl Program help <gellyfish@gellyfish.btinternet.com>
opening and locking a file from other access <95ncp@eng.cam.ac.uk>
Re: opening and locking a file from other access (Larry Rosler)
Perl , Java, Cold Fusion or Net Fusion? <c.knight@usa.net>
Re: Perl , Java, Cold Fusion or Net Fusion? <eashton@bbnplanet.com>
perl 5 on Freebsd - dbm Problems <kliquori@ix.netcom.com>
Re: Perl not terminating <eashton@bbnplanet.com>
Re: Perl not terminating <gellyfish@gellyfish.btinternet.com>
Re: removing a-z from a string. (Craig Berry)
Re: removing a-z from a string. (Bart Lateur)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 27 Sep 1998 12:07:51 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: /etc/passwd file
Message-Id: <36162559.3124353@news.ping.be>
Elaine -HappyFunBall- Ashton wrote:
>> 2. The procedure of removing all files and references associated with a UID
>> and username can be daunting task and should not be handled by inexperienced
>> admins. (yes I have removed users usually by hand)
>
>Well, how else are you to learn than to make a mistake? Obviously this
>is a very lazy beginner who perhaps could use to learn how to screw-up
>and then extract himself from that.
Now now now.
The original poster did not ask how to REMOVE an old user, but how to
ADD a new one. So all this rambling is useless.
And he decides to get some good advice from experienced people, because
he understands the risk.
Now, what makes you think he's just a lazy slob? He didn't ask for a
complete script, he asked about the file format. He obviously intends to
write the whole thing himself. Nothing lazy about that.
Bart.
------------------------------
Date: Sat, 26 Sep 1998 23:24:11 -0600
From: "Rob W. Walls" <wallsr@jcave.com>
Subject: <*> in cgi
Message-Id: <6uki99$8jq$1@news.xmission.com>
Hi,
I am writing an app that requires a list of files in a particular
directory on each run. I use:
@FileList=<*.txt>;
This works great from the command line, but will not work in a cgi
program. Presumably, this is a 'feature' for security, but there must be
some way to get a directory listing in a cgi environment?!?
Does anyone have a solution?
Thanks,
wallsr@jcave.com
------------------------------
Date: Sat, 26 Sep 1998 23:54:27 -0700
From: "Henry Wolff" <admin@hatsoft.com>
Subject: Re: <*> in cgi
Message-Id: <360de0cc.0@news.greatbasin.net>
Something to the effect of:
$dir = "textfiles";
opendir(DH,$dir);
@textfiles = readdir(DH);
closedir(DH);
Henry Wolff
Send Some Virtual Postcards - FREE
http://www.hatsoft.com/webcard/index.html
Rob W. Walls wrote in message <6uki99$8jq$1@news.xmission.com>...
>Hi,
> I am writing an app that requires a list of files in a particular
>directory on each run. I use:
>
> @FileList=<*.txt>;
>
> This works great from the command line, but will not work in a cgi
>program. Presumably, this is a 'feature' for security, but there must be
>some way to get a directory listing in a cgi environment?!?
>Does anyone have a solution?
>Thanks,
>wallsr@jcave.com
>
>
------------------------------
Date: 27 Sep 1998 11:45:53 -0000
From: Jonathan Stowe <gellyfish@gellyfish.btinternet.com>
Subject: Re: <*> in cgi
Message-Id: <6ul8hh$8kb$1@gellyfish.btinternet.com>
On Sat, 26 Sep 1998 23:24:11 -0600 Rob W. Walls <wallsr@jcave.com> wrote:
> Hi,
> I am writing an app that requires a list of files in a particular
> directory on each run. I use:
> @FileList=<*.txt>;
> This works great from the command line, but will not work in a cgi
> program. Presumably, this is a 'feature' for security, but there must be
> some way to get a directory listing in a cgi environment?!?
There are several possibilities here none of them have much to do
with Perl.
1) Your CGI program is running with a different current directory to
the one you think it has.
2) Depending on what servr you are using (I'm thinking IIS here) the
script is running as a user that has no permission to do that - In
which case it is possible that any solution using opendir/readdir
wouldnt work.
3) Your Perl requires dosglob.exe to do that and that file cant be found.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 26 Sep 1998 21:25:12 PDT
From: "Phlip" <new_email@see.web.page>
Subject: ? Re: Porting Unix perl script to winNT servers
Message-Id: <6uken8$k2e@journal.concentric.net>
Larry Rosler wrote in message ...
>[Posted to comp.lang.perl.misc and copy mailed.]
>
>In article <360d5e21.29780689@news.mindspring.com> on Sat, 26 Sep 1998
>21:38:50 GMT, Belle <Sweets@sugarhigh.com> says...
>> After several hours of hunting a good shopping cart script, I finally
>> found one that looked PERFECT for me. Unfortunately, the script was
>> for Unix based servers and may not run on NT servers, which is what
my
>> host uses. Could someone tell me if it's possible to edit this
script
>> (http://www.virtualcenter.com/scripts2/WWWOrder2.html) for NT? Any
>> help would be appreciated.
>
>The best help I can give is to suggest that you try it. It is too much
>trouble to download and examine the program from the URL you have
>provided.
>
>The CGI protocol is portable, and so is Perl. Unless the program
invokes
>command support via system() or qx// etc., or plays fast and loose with
>file names, everything should work 'out of the box'.
What about dB interaction? I'm looking at a script that reads a dB with
these lines:
uses DBI;
$dbh = DBI->connect("dbi:$wm_dbserver:$wm_dbname",
$wm_username,
$wm_password)
|| return 0;
This may look familiar to you PERLers - if this DBI thing is a common
library, are ports to ODBC available?
-- Phlip (no replies - address munged)
======= http://users.deltanet.com/~tegan/home.html =======
------------------------------
Date: Sun, 27 Sep 1998 09:48:30 GMT
From: cim@online.ee
Subject: help a newbie
Message-Id: <360e088e.2618846@news.online.ee>
i know how to put a <BR> after each line:
foreach $line(@file) {
#$line =~ s/\n/<BR>/;
...
but i need to put a <P> where there is a newline with no chars.:
example:
this is a just an example.
this is just another example
this is just an example
<-- this is were <P> should be
this is a just an example.
this is just another example
this is just an example
actually, if i could put each paragraph inside <P>...</P> would be the
best for me.
help me! please
------------------------------
Date: Sun, 27 Sep 1998 02:34:14 -0700
From: "Henry Wolff" <admin@hatsoft.com>
Subject: Re: help a newbie
Message-Id: <360e065b.0@news.greatbasin.net>
maybe this?
foreach $line(@file) {
$line =~ s/\n/<BR>/;
$line = "<p>" if ($line eq "");
Henry Wolff
HAT'Soft Banner Exchange
Now with multi-account credit transfers and 'Credit Bank'
http://www.hatsoft.com/featured/index.html
cim@online.ee wrote in message <360e088e.2618846@news.online.ee>...
>i know how to put a <BR> after each line:
>
>foreach $line(@file) {
>#$line =~ s/\n/<BR>/;
>...
>
>but i need to put a <P> where there is a newline with no chars.:
>example:
>
>this is a just an example.
>this is just another example
>this is just an example
> <-- this is were <P> should be
>this is a just an example.
>this is just another example
>this is just an example
>
>
>actually, if i could put each paragraph inside <P>...</P> would be the
>best for me.
>help me! please
------------------------------
Date: 27 Sep 1998 11:40:28 -0000
From: Jonathan Stowe <gellyfish@gellyfish.btinternet.com>
Subject: Re: help a newbie
Message-Id: <6ul87c$8jm$1@gellyfish.btinternet.com>
On Sun, 27 Sep 1998 09:48:30 GMT cim@online.ee wrote:
> i know how to put a <BR> after each line:
> foreach $line(@file) {
> #$line =~ s/\n/<BR>/;
> ...
> but i need to put a <P> where there is a newline with no chars.:
> example:
This does it for me:
#!/usr/bin/perl
@file = <>;
foreach (@file)
{
s/\n$/<BR>\n/s unless s/^$/<P>/;
print;
}
> actually, if i could put each paragraph inside <P>...</P> would be the
> best for me.
I'm sure you can work it out from there - the only slight difficulty
is with the first <P>;
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 27 Sep 1998 11:30:25 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How do i unpack a 64-bit long?
Message-Id: <slrn70s8eh.f1t.adelton@aisa.fi.muni.cz>
On Fri, 25 Sep 1998 21:53:48 GMT, harry@my-dejanews.com <harry@my-dejanews.com> wrote:
> How can I read and unpack a 64-bit long integer from a file?
Hardly.
$ perl -e 'my $i = 1<<32; print "$i\n";'
1
On most platforms you do not have 64 bit integers to work with.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Sun, 27 Sep 1998 12:07:59 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: How to read contents of all *.TXT files in directory into one file?
Message-Id: <361d29dc.4278822@news.ping.be>
Michael Yevdokimov wrote:
>
>How to read contents of all *.TXT files in directory into one file using
>Perl?
perl -p *.TXT >output.all
Yup, this is a command line. No script necessary.
Bart.
------------------------------
Date: Sun, 27 Sep 1998 12:07:53 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: How to strip binary data from a file
Message-Id: <36172663.3389641@news.ping.be>
Larry Rosler wrote:
>You must be using a Windows/DOS system, which has the unfortunate
>characteristic of distinguishing 'binary' data from 'text' data. There
>must be a control-Z character in your data that is interrupting the
>'read'.
>
>To fix this, see `perldoc -f binmode`. Then the reads will continue, and
>you can deal with lines you don't like any way you wish.
Just a friendly caution.
Note that on DOS and related systems, binmode makes your line endings
behave differently. The automatic conversion of "\015\012" (AKA CRLF) tp
"\n" no longer works.
Bart.
------------------------------
Date: Sat, 26 Sep 1998 23:33:04 -0700
From: "Henry Wolff" <admin@hatsoft.com>
Subject: How Too?? File Copy from 1 server to the scripts server
Message-Id: <360ddbc9.0@news.greatbasin.net>
I have been trying to figure this out with no success.
>From a submitted form input field is a url like http://server1.com/image.gif
I need to take that file (either .gif or .jpg) and copy it from the
specified server/directory into a temp directory under the current scripts
directory.
Any help?
Henry Wolff
Send Some Virtual Postcards - FREE
http://www.hatsoft.com/webcard/index.html
------------------------------
Date: 27 Sep 1998 12:18:23 -0000
From: Jonathan Stowe <gellyfish@gellyfish.btinternet.com>
Subject: Re: How Too?? File Copy from 1 server to the scripts server
Message-Id: <6ulaef$8ol$1@gellyfish.btinternet.com>
On Sat, 26 Sep 1998 23:33:04 -0700 Henry Wolff <admin@hatsoft.com> wrote:
> I have been trying to figure this out with no success.
> From a submitted form input field is a url like http://server1.com/image.gif
> I need to take that file (either .gif or .jpg) and copy it from the
> specified server/directory into a temp directory under the current scripts
> directory.
You would probably want to use the LWP::UserAgent Module to retrieve
the file. Not forgetting of course to binmode the output file if you
are on a system that requires it.
This is an example from the lwpcook manpage:
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("$0/0.1 " . $ua->agent);
# $ua->agent("Mozilla/8.0") # pretend we are very capable browser
$req = new HTTP::Request 'GET' => 'http://www.sn.no/libwww-perl';
$req->header('Accept' => 'text/html');
# send request
$res = $ua->request($req);
if ($res->is_success) {
print $res->content;
} else {
print "Error: " . $res->status_line . "\n";
}
You will of course need to save the content to a file and alter the
$req->header() as appropriate but thats basically it.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 27 Sep 1998 05:48:21 GMT
From: "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
Subject: Re: is perl better for these?
Message-Id: <FkkP1.15$cR3.611016@burlma1-snr1.gtei.net>
>Wondering if perl would be helpful for these tasks, or should I stick with
>something like Bourne Shell in a UNIX environment??? and why??
>Now, if I stick with Bourne Shell, and subsequently want to translate it
>into a compiled language, what language would be preferable, and why?
Look, I've been a UNIX admin for ~10 years. I did sh and ksh as long as I
could stand them and I also know the place of awk and sed. My philosopy is,
if I need to automate it and I cannot do it in one or two lines of sh or
awk, its Perl all the way.
Why Perl? Because its adapts itself well to who and what we are. I did C++
for years and it was never this much fun. Never this practical. I have
something I need to get done, need to do simply and efficiently, don't need
to reinvent the wheel.
What sort of tasks are you trying to accomplish. Perl isn't for every admin
task, but I have found it adapts itself very very well if you are in that
frame of mind to do something simply, efficiently and want to automate.
------------------------------
Date: Sun, 27 Sep 1998 12:07:57 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: is perl better for these?
Message-Id: <361c2953.4141509@news.ping.be>
David Schlessinger wrote:
>Wondering if perl would be helpful for these tasks, or should I stick with
>something like Bourne Shell in a UNIX environment??? and why??
>
>1) listing objects in the current directory, by full name or lexical
>pattern
Better? No.
>2) removing objects in the current directory, individually by name or
>collectively by lexical pattern
No.
>3) searching contents of text files for a given string or lexical pattern
Yes. Definitely.
And since Perl can be used for (1) and (2) as well, well: yes, Perl is
better.
Bart.
------------------------------
Date: Sun, 27 Sep 1998 12:07:54 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: M/// problem again...
Message-Id: <36192854.3886438@news.ping.be>
Hampus Brynolf wrote:
>(Re-sent due to unreadability...)
>I have a little problem with m/// (I think)
Yup. it's either s/// or m//. m/// is a problem.
p.s. I think I gave a usable reply to your previous post.
Bart.
------------------------------
Date: 27 Sep 1998 06:21:22 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Multiple perlscripts editing same file
Message-Id: <6uklh2$bm2$1@marina.cinenet.net>
Hampus Brynolf (hampus@globetree.org) wrote:
: I have a couple of perlscripts that all are writing/editing the same
: file. Which is the safest way to do this? I do not know when or what
: script is doing it. There might be hundreds of clients trying to open
: and write to the same file at the same time.
perldoc -f flock
Lock the file exclusively before writing, for sharing before reading.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Sun, 27 Sep 1998 11:26:42 GMT
From: melLA@west.net
Subject: Need help with $1 pattern
Message-Id: <360e1e83.10328411@news.west.net>
Hi there,
I 'm having a problem extracting the city name from $string as such:
$match = 0;
$string = "state=Alaska|county=Talkeetna|city=Anchorage|";
if ($string =~ /city\s*=\s*(.+)\s*|/i)
{
$match = 1;
$city = $1;
}
print qq(city \= $city<br>\n);
But the $city value keeps turning up as undefined although $match = 1.
I expected the value in parenthesis to contain $1, the city name. What
am I doing wrong here?
Thanks,
Milt
(remove all CAPS from my e-addr)
------------------------------
Date: 27 Sep 1998 03:02:22 GMT
From: pete@localhost.localdomain (Peter J. Kernan)
Subject: Re: newbie DATE question
Message-Id: <6uk9ru$ata$1@pale-rider.INS.CWRU.Edu>
In article <6tpfna$nk4$1@client3.news.psi.net>,
abigail@fnx.com (Abigail) writes:
>
> use constant HOURS => 24;
> use constant MINUTES => 60;
> use constant SECONDS => 60;
>
> sub tomorrow () {
> local $_ = 1 x HOURS x MINUTES x SECONDS;
> s/1/sleep $&/eg;
> scalar localtime;
> }
>
I really enjoy this thread and am dissapointed that it
is so short. So here is my addition which is in somewhat in
the same spirit as the original solution using a different
algorithm (a bit more of a memory hog, but thats cheap).
Also, like the original it is Y2K compliant, so I invite readers
to feel free to use this routine in perl programs which you plan
to be using in the year 2000. In fact if you have a reliable OS
and dont plan on upgrading soon (you probably also want a UPS)
you can tweak the program just a bit and have it figure out the time
on midnight Jan 1, 2000.
Craig Copi provided much inspiration for the tomorrow() subroutine
including suggesting that I use select which allows flexibility
in potential modifications to the program.
BTW: the program might issue some warnings, there is nothing
to be concerned about. It is doing the right thing.
Tested on
perl, version 5.005_02 built for aix and
perl, version 5.004_04 built for i586-linux and
perl, version 5.005_01 built for i686-linux-thread
Here is the code;
#sample use
$time = tomorrow(time);
print "${ \(scalar localtime($time))}\n";
sub tomorrow {
local $now;
split '',273352;
$_ = join '*', map {shift() ** shift()} (0..2);
$time ||= eval;
time unless --$time && tomorrow(select $now,$now,$now,1);
}
--
Pete Kernan CWRU Physics and Statistics Depts
http://theory2.phys.cwru.edu/~pete
------------------------------
Date: Sun, 27 Sep 1998 01:29:17 -0400
From: "caustic" <caustic@causticinteractive.nospam.com>
Subject: Re: newbie Perl Program help
Message-Id: <356bb431.0@newsprime.tidalwave.net>
Jonathan Stowe wrote in message
>if($text =~ m|<headline>(.*)</headline>!i)
> {
> $headline = $1;
> }
Thanks a lot for your reply...
I've been working with an incredibly similar expression but I keep receiving
'Search pattern not terminated' errors.
I'll look into HTML::Parser.
Thanks again,
keith
------------------------------
Date: Sat, 26 Sep 1998 23:04:49 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie Perl Program help
Message-Id: <MPG.1077755943f462ce989886@nntp.hpl.hp.com>
In article <356bb431.0@newsprime.tidalwave.net> on Sun, 27 Sep 1998
01:29:17 -0400, caustic <caustic@causticinteractive.nospam.com> says...
> Jonathan Stowe wrote in message
> >if($text =~ m|<headline>(.*)</headline>!i)
> > {
> > $headline = $1;
> > }
> I've been working with an incredibly similar expression but I keep receiving
> 'Search pattern not terminated' errors.
Could the problem possibly be that the first delimiter of the regex is a
'|' while the intended second delimiter is a '!'?
They do look a lot alike, though. You could also try '1' or 'l' and see
if they work any better. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 27 Sep 1998 01:30:28 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: newbie Perl Program help
Message-Id: <360DDB84.6DC21FE8@gpu.srv.ualberta.ca>
caustic wrote:
>
> Jonathan Stowe wrote in message
>
> >if($text =~ m|<headline>(.*)</headline>!i)
> > {
> > $headline = $1;
> > }
>
> Thanks a lot for your reply...
>
> I've been working with an incredibly similar expression but I keep receiving
> 'Search pattern not terminated' errors.
shall we assume you're just being caustic?
regards
andrew
------------------------------
Date: 27 Sep 1998 11:22:10 -0000
From: Jonathan Stowe <gellyfish@gellyfish.btinternet.com>
Subject: Re: newbie Perl Program help
Message-Id: <6ul752$8h2$1@gellyfish.btinternet.com>
On Sat, 26 Sep 1998 23:04:49 -0700 Larry Rosler <lr@hpl.hp.com> wrote:
> In article <356bb431.0@newsprime.tidalwave.net> on Sun, 27 Sep 1998
> 01:29:17 -0400, caustic <caustic@causticinteractive.nospam.com> says...
>> Jonathan Stowe wrote in message
>> >if($text =~ m|<headline>(.*)</headline>!i)
>> > {
>> > $headline = $1;
>> > }
>> I've been working with an incredibly similar expression but I keep receiving
>> 'Search pattern not terminated' errors.
> Could the problem possibly be that the first delimiter of the regex is a
> '|' while the intended second delimiter is a '!'?
> They do look a lot alike, though. You could also try '1' or 'l' and see
> if they work any better. :-)
I think a need a bigger font,glasses,less beer (select one) ;-}
Talking about the solidus two thoughts spring into my head - On a PC
keyboard (UK Layout) what is the extra thing on the cap of the key to
the left of the "1" all about ? And why does my PC at work show a | in
a DOS box but show a Yen symbol in Windows Apps.
Ooh heavy times on the Archers.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 27 Sep 1998 05:05:02 +0100
From: Nigel Parker <95ncp@eng.cam.ac.uk>
Subject: opening and locking a file from other access
Message-Id: <Pine.HPP.3.96L.980927050118.6535B-100000@club.eng.cam.ac.uk>
Anybody know how to open a file, and prevent further access from other
users whilst it's updated by a script?
How would denied access to said file be handled by the server (Apache)?
Will it just pause the other instance of the script until the file is
finished with, or will it create some kind of error?
Thanks in advance for any tips!
Cheers.
Nigel
--
Girton College, Cambridge, England, CB3 0JG. Tel: 0411 384803
http://welcome.to/nigels nigel.parker@iee.org
------------------------------
Date: Sat, 26 Sep 1998 23:14:10 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: opening and locking a file from other access
Message-Id: <MPG.1077778babb72822989887@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <Pine.HPP.3.96L.980927050118.6535B-100000@club.eng.cam.ac.uk>
on Sun, 27 Sep 1998 05:05:02 +0100, Nigel Parker <95ncp@eng.cam.ac.uk>
says...
> Anybody know how to open a file, and prevent further access from other
> users whilst it's updated by a script?
perlfaq5: "How can I lock a file?" and `perldoc -f flock`.
> How would denied access to said file be handled by the server (Apache)?
> Will it just pause the other instance of the script until the file is
> finished with, or will it create some kind of error?
That depends on how the program is written (in particular, what the
second argument to 'flock' is). The server only stands and waits.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 27 Sep 1998 13:48:26 +0800
From: "Crimson Knight" <c.knight@usa.net>
Subject: Perl , Java, Cold Fusion or Net Fusion?
Message-Id: <360dd141.0@news.cyberway.com.sg>
I'm sorree if i've got the wrong newsgroup but would appreciate if someone
could help me.
I'm creating an online auction on the web and i'm given this three
applications/programmes to chose from. Which one should i use? I need
something fast and secure with database capability.
Thanx in advance!
------------------------------
Date: Sun, 27 Sep 1998 06:17:07 GMT
From: "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
Subject: Re: Perl , Java, Cold Fusion or Net Fusion?
Message-Id: <DLkP1.17$cR3.619625@burlma1-snr1.gtei.net>
Crimson Knight wrote
>I'm creating an online auction on the web and i'm given this three
>applications/programmes to chose from. Which one should i use? I need
>something fast and secure with database capability.
You gave four choices actually. How can we advise you without knowing the
platform or what you intend to do? Please post what you are trying to
accomplish and why you think Perl could be a choice. Perl is great for many
applications, but not for everything.
>Thanx in advance!
If iI have but one pet peeve on usenet, this would be it. Thanx is spelled
'Thanks' .
e.
------------------------------
Date: Sun, 27 Sep 1998 00:20:41 -0400
From: Kevin Liquori <kliquori@ix.netcom.com>
Subject: perl 5 on Freebsd - dbm Problems
Message-Id: <360DBD19.8FF8DAAA@ix.netcom.com>
I just installed perl5 (ver 5.00404) on my FreeBSD (ver 2.2.5) system.
It runs fine except when I try to use any dbm commands such as
"dbmopen." I get an error message that "dbm does not exist on this
machine." Have I configured something incorrectly? I downloaded the
perl5~.tar from the FreeBSD site, ungzip'd it then did a tar xvf. I
didn't do any kind of configuring. Later I downloaded and installed gdbm
but this didn't help. I am a newbie to perl and to FreeBSD. Any advice
would be greatly appreciated. TIA!
...Kevin
kliquori@ix.netcom.com
------------------------------
Date: Sun, 27 Sep 1998 05:55:27 GMT
From: "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
Subject: Re: Perl not terminating
Message-Id: <jrkP1.16$cR3.612949@burlma1-snr1.gtei.net>
Michel Prevost wrote
>The script have perfectly performed its job, but it don't exit.
Well, that would be 'doesn't exit'...but I digress. What exactly are you
saying by 'it did its' job but its hangin' around?' Could you post some code
for those of us sitting on the edge of our seats wondering?
------------------------------
Date: 27 Sep 1998 11:27:43 -0000
From: Jonathan Stowe <gellyfish@gellyfish.btinternet.com>
Subject: Re: Perl not terminating
Message-Id: <6ul7ff$8hm$1@gellyfish.btinternet.com>
On 26 Sep 1998 20:14:05 GMT Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was sent to Michel Prevost
> <michel.prevost@cactuscom.ca_REMOVE_TO_MAIL>],
> who wrote in article <360D3807.1F1060BB@cactuscom.ca_REMOVE_TO_MAIL>:
>> That is what we do to make it stop. But i want the script to terminate by
>> itself. For a reason I don't know, the script won't terminate after the
>> exit() call.
>>
>> The script have perfectly performed its job, but it don't exit.
> How do you know it called exit()? Did you try to trace/truce (sp?)
truss - I think but why is it called that ?
That is you can do truss -p <PID> to see what the process is doing.
Of course this probably not available on BSD based OS's.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 27 Sep 1998 02:55:14 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: removing a-z from a string.
Message-Id: <6uk9ei$7q$1@marina.cinenet.net>
Jim Weeks (jim@siteplus.com) wrote:
: I should know this, but could someone tell me how to remove the letters from
: this string.
:
: Bmw Volvo 205-894-5660
:
: $line =~ s/a-z//g; #remove lower case.
: $line =~ s/A-Z//g; #remove upper case.
:
: doesn't work.
Wrong operator. tr/A-Za-z//d
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Sun, 27 Sep 1998 12:07:56 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: removing a-z from a string.
Message-Id: <361b28d8.4018532@news.ping.be>
Nigel Parker wrote:
>On Sat, 26 Sep 1998, Jim Weeks wrote:
>
>: Bmw Volvo 205-894-5660
>:
>: $line =~ s/a-z//g; #remove lower case.
>: $line =~ s/A-Z//g; #remove upper case.
>
>You simply need $line =~ s/[a-zA-Z]+//g;
>
>I think!
or
s/[a-z]//gi;
("i" = ignore case)
or
tr/a-zA-Z//d;
Bart.
------------------------------
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 3835
**************************************