[12565] in Perl-Users-Digest
Perl-Users Digest, Issue: 6165 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 29 13:07:37 1999
Date: Tue, 29 Jun 99 10:00:18 -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 Tue, 29 Jun 1999 Volume: 8 Number: 6165
Today's topics:
Re: CGI and SSI <cassell@mail.cor.epa.gov>
Re: Command line parameters / Wildcard characters / Rec <upsetter@ziplink.net>
Re: Does (rand * 6) DWIM? <swiftkid@bigfoot.com>
Re: fastest DBI module? <swiftkid@bigfoot.com>
Re: Help with rename function <swiftkid@bigfoot.com>
Re: Help with rename function (Bart Lateur)
Re: Help, always an error ?? <swiftkid@bigfoot.com>
Re: help <upsetter@ziplink.net>
Re: How to convert a text file to 0-byte lenght? <swiftkid@bigfoot.com>
Re: How to convert a text file to 0-byte lenght? <jim@*nospam*network-2001.com>
Re: How to convert a text file to 0-byte lenght? <tchrist@mox.perl.com>
Re: How to convert a text file to 0-byte lenght? (Marcel Grunauer)
Re: I need help on easy topic <stupid_ass@nospam.hotmail.com>
Re: I need help on easy topic <swiftkid@bigfoot.com>
MKTEMP <scott@salmon.ltd.uk>
Re: MKTEMP <jim@*nospam*network-2001.com>
Re: Need help using umask. (Anno Siegel)
newbie refs | uninitialised data prob (Rory Campbell Lange)
Re: Problem Installing Tk 8.000.14 - make => line too l <s.grififths@virgin.net>
search and replace with <> <prlawrence@lehigh.edu>
Re: Unlink == delete files? Why (on earth) is it called <jhi@alpha.hut.fi>
updating activeperl to build 518 brian_smith@sonat.com
Re: Verifying an existing file with a PERL web script (Bart Lateur)
Re: win32 file access <swiftkid@bigfoot.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 29 Jun 1999 09:08:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: CGI and SSI
Message-Id: <3778EF79.D8180EFA@mail.cor.epa.gov>
End User wrote:
>
> It sould be able to recognise the correct sytax:
Yes, it *should* be able to recognize the correct syntax.
But it won't, unless it has been configured properly.
This is a common problem with web servers, which in turn
leads to off-topic posts by Perl users who don't under-
stand why their Perl scripts aren't working right. And
that is in part why the users get so mad when they are
told they are asking in the wrong place. They don't
have a good working model of the process, so the sepa-
ration HTTP/webserver/HTML/CGI/Perl is unclear.
As Abigail was (correctly) alluding to, in Abigail's
own unique way.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 29 Jun 1999 16:53:30 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Command line parameters / Wildcard characters / Recursive directories
Message-Id: <eS6e3.239$6M6.81956@news.shore.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
: Both this and the other posting intentionally something out for comic
: effect.
I'm having trouble following you on the "comic" part.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 29 Jun 1999 20:27:18 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Does (rand * 6) DWIM?
Message-Id: <7lbrt4$3uo13@news.cyber.net.pk>
Not me!
#!/usr/bin/perl
print int rand 6 , "\n" for 1 .. 10;
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
Keith G. Murphy <keithmur@mindspring.com> wrote in message
news:3778D2FD.76B90844@mindspring.com...
> How many are surprised by the result of this:
>
> #!/usr/bin/perl
> for ($i=0;$i<10;$i++) { print ((rand * 6) . "\n") }
>
> Of course, running w/ '-w' provides the answer, as usual. It just kind
> of surprised me; I wondered how many others...
> -----------------
> Out, damned spot!
> Out, spot, out!
> -- Shakespeare for First Grade
------------------------------
Date: Tue, 29 Jun 1999 20:24:42 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: fastest DBI module?
Message-Id: <7lbroc$3uo12@news.cyber.net.pk>
DBI is one module!
DBD::* are the modules, but they are for different sql programs!
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
Kevin Howe <khowe@performance-net.com> wrote in message
news:Fu4e3.42318$%65.105617@tor-nn1.netcom.ca...
> Which of the DBI:: Modules are the fastest?
>
> Thanks
> Kevin
------------------------------
Date: Tue, 29 Jun 1999 20:39:07 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Help with rename function
Message-Id: <7lbsjb$57d2@news.cyber.net.pk>
Lance Dial <lcdialx@earthlink.net> wrote in message
news:3778e1d4.3797264@news.earthlink.net...
> Hello,
>
> I seem to be having some trouble with the perl rename function. It
> returns the error:
>
> "Invalid cross-device link"
<snip>
/perl and /home are most probably not same partitions!
(as if you don't have a partition for /perl it is root partition)
I think the error means you cannot directly do that on 2 different
mounted partitions.
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
------------------------------
Date: Tue, 29 Jun 1999 16:04:29 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Help with rename function
Message-Id: <3779ed61.1786490@news.skynet.be>
Lance Dial wrote:
>"Invalid cross-device link"
>
>Of course my question is: what does this mean, and how do I fix it?
It means that the different "directories" actually reside on different
(physical or logical) disks. To fix it, you have to manually copy the
file and delete the original; AKA "move". See "perldoc File::Copy".
use File::Copy;
move("/dev1/fileA","/dev2/fileB");
Bart.
------------------------------
Date: Tue, 29 Jun 1999 20:32:48 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: Help, always an error ??
Message-Id: <7lbs7h$5if1@news.cyber.net.pk>
Mark Stellaard <mark.stellaard@knoware.nl> wrote in message
news:7ladc9$22e$1@tasmania.dev.ict.nl...
> Hello,
>
> I'am desperate, I'm tring to write an upload perl script. But everytime I
> got stuck at the same fault response: Premature end of script headers:
> /home/foo/script.cgi.
<snip>
The first line should point the the copy of the installed Perl.
#!/usr/bin/perl
#!/usr/local/bin/perl
#!/perl/bin/perl
depends upon your system! (you should put only one)
or the server can't know what type of cgi it is!
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
------------------------------
Date: Tue, 29 Jun 1999 16:50:04 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: help
Message-Id: <0P6e3.238$6M6.81956@news.shore.net>
Abigail <abigail@delanet.com> wrote:
: Peter Hodder (peterh@stealth.com.au) wrote on MMCXXVIII September
: MCMXCIII in <URL:news:3779710a.3671936@news.griffith.stealth.com.au>:
: ^^ can someone tell me how to put a background image in a perl script.
: Write your script on a mirror.
If you don't want to help newbies, why don't you just ignore them (or,
alternatively, insult their mothers)? Is it really that important to you
to appear superior to someone who's just learning the language? What next,
insulting the language skills of 2d-graders?
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: Tue, 29 Jun 1999 20:20:45 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <7lbrgt$3uo11@news.cyber.net.pk>
open FILE , ">file.txt";
close FILE;
# file.txt is 0-byte now.
`echo '' >file.txt`;
# file.txt should be 0-byte now
or
$/ = undef;
open FILE , "+<file.txt";
$data = <FILE>;
truncate FILE , 0;
close FILE;
Reads the file in $data and set its size to 0.
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
Squigy <Squigy@last.com> wrote in message
news:3778e01e.7435922@news2.newscene.com...
> Hi,
>
> Starting to learn Perl. I downloaded this cgi script that
> appends data to a text file. My idea is to download the file and then
> reset the file to 0 byte lenght. I want to do this via a web page with
> two buttons: download and reset. The download part is easy. The reset
> file should be easy too, but this newbie doesn4t know how.
>
> Any help will be appreciated.
> Thanks for your time.
> Bye,
> S.
------------------------------
Date: Tue, 29 Jun 1999 11:17:09 -0500
From: "Jim" <jim@*nospam*network-2001.com>
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <7larhf$sgm$1@news3.infoave.net>
open (EMP, ">$file") || die $!;
print EMP "";
close (EMP);
that'll empty your file
--
-Jim- syt.at.email.dot.com
----------------------------------
-I don't suffer from insanity, I enjoy every minute of it.
-So what if I'm paranoid? It doesn't hurt anybody
and makes life interesting for me.
----------------------------------
- Get Paid For Staying Online -
http://www.alladvantage.com/go.asp?refid=ANT424
Squigy <Squigy@last.com> wrote in message
news:3778e01e.7435922@news2.newscene.com...
| Hi,
|
| Starting to learn Perl. I downloaded this cgi script that
| appends data to a text file. My idea is to download the file and then
| reset the file to 0 byte lenght. I want to do this via a web page with
| two buttons: download and reset. The download part is easy. The reset
| file should be easy too, but this newbie doesn4t know how.
|
| Any help will be appreciated.
| Thanks for your time.
| Bye,
| S.
------------------------------
Date: 29 Jun 1999 10:41:27 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <3778f737@cs.colorado.edu>
In comp.lang.perl.misc, "Faisal Nasim" <swiftkid@bigfoot.com> writes:
:`echo '' >file.txt`;
:# file.txt should be 0-byte now
Oh, please! That's wicked in so many ways I don't know where to start.
You used backticks in void context. You didn't check $?. You wrote
a one-byte file, not zero. Maybe even a two-byte file if you've been
POBbed.
[Eighteen lines of senseless, after-the-fact quotation deleted]
I see you still haven't got this newsreader thing down. :-(
--tom
--
"People demand freedom of speech to make up for the freedom of thought
which they avoid." - Kierkegaard
------------------------------
Date: Tue, 29 Jun 1999 15:56:24 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: How to convert a text file to 0-byte lenght?
Message-Id: <377dec20.17340253@enews.newsguy.com>
On 29 Jun 1999 10:13:04 -0500, Squigy@last.com (Squigy) wrote:
>Hi,
>
> Starting to learn Perl. I downloaded this cgi script that
>appends data to a text file. My idea is to download the file and then
>reset the file to 0 byte lenght. I want to do this via a web page with
>two buttons: download and reset. The download part is easy. The reset
>file should be easy too, but this newbie doesn4t know how.
Wouldn't it be easier to unlink the file? Appending creates the file
if it doesn't exist anyway.
Marcel
------------------------------
Date: Tue, 29 Jun 1999 16:05:18 GMT
From: "Butcher" <stupid_ass@nospam.hotmail.com>
Subject: Re: I need help on easy topic
Message-Id: <296e3.49044$LQ4.62467@news.rdc1.bc.wave.home.com>
OK i am dumb. most of it was in the documentation that comes with the
distribution. The only problem i am having now is that it is saying that I
should use a module called Mail.pm that is supposed to come with the win32
distrib but didnt seem to.
Thanks for responses
Butcher <stupid_ass@nospam.hotmail.com> wrote in message
news:Xv0e3.48964$LQ4.61848@news.rdc1.bc.wave.home.com...
> Hi, I have been using perl for 2 days =).
> I would just like to know the most common way in general that cgi
> programmers use to mail off form results to someone. I want it to be
mailed
> off server-side on an NT machine running IIS. Also, I have noticed that
> most scripts dynamically create html results depending on the form input
but
> i am wondering about url redirection based on form input. I have bought
the
> gecko book but it doesnt cover e-mailing form results.
>
> Thanks.
>
>
>
------------------------------
Date: Tue, 29 Jun 1999 20:43:04 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: I need help on easy topic
Message-Id: <7lbsqn$57d3@news.cyber.net.pk>
Butcher <stupid_ass@nospam.hotmail.com> wrote in message
news:Xv0e3.48964$LQ4.61848@news.rdc1.bc.wave.home.com...
> Hi, I have been using perl for 2 days =).
> I would just like to know the most common way in general that cgi
> programmers use to mail off form results to someone. I want it to be
mailed
> off server-side on an NT machine running IIS. Also, I have noticed that
<snip>
Download sendmail from www.demobuilder.com (win32)
open MAIL , "|/installedir/sendmail -t";
print MAIL <<'EOT';
To: you@host.com
From: "The Whiz Kid" <swiftkid@bigfoot.com>
Subject: blah blah
Addition-header: here
This is the body!
EOT
close MAIL; #mail is sent
Do error checking yourself.
------------------------------
Date: Tue, 29 Jun 1999 17:03:31 +0100
From: "Scott Pritchett" <scott@salmon.ltd.uk>
Subject: MKTEMP
Message-Id: <7laqni$2a2$1@lure.pipex.net>
Does anyone know of the Perl equivalent to C's MKTEMP or MKSTEMP which
apparebtly guarantees a(n) unique filename?
------------------------------
Date: Tue, 29 Jun 1999 11:23:38 -0500
From: "Jim" <jim@*nospam*network-2001.com>
Subject: Re: MKTEMP
Message-Id: <7lartg$gjk$1@news3.infoave.net>
I don't know if there is one... but here's what I use.. never had any
trouble with it if only for a temp file...
srand;
$filename = rand(10000);
open (TMP,">$filename");
print TMP "$file_stuff";
close (TMP);
if for a more permanant file, I'd use a count to increment the
number of the file above the last every time
--
-Jim- syt.at.email.dot.com
----------------------------------
-I don't suffer from insanity, I enjoy every minute of it.
-So what if I'm paranoid? It doesn't hurt anybody
and makes life interesting for me.
----------------------------------
- Get Paid For Staying Online -
http://www.alladvantage.com/go.asp?refid=ANT424
Scott Pritchett <scott@salmon.ltd.uk> wrote in message
news:7laqni$2a2$1@lure.pipex.net...
| Does anyone know of the Perl equivalent to C's MKTEMP or MKSTEMP which
| apparebtly guarantees a(n) unique filename?
|
|
------------------------------
Date: 29 Jun 1999 16:33:55 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Need help using umask.
Message-Id: <7lashj$5iu$1@lublin.zrz.tu-berlin.de>
Brian Wagener <wagener@cs.fsu.edu:NOSPAM> wrote in comp.lang.perl.misc:
>I am having problems using umask. The perl docs are very sparse on the
>subject. Well here is what I think I know and just tell me what is wrong.
>umask sets the default permissions of the files that havent been made yet.
>In my case I want all subsequent files to be made with full permission so I
>tried "umask 0777" and it didn't work. What am I doing wrong.
Not a perl thing, umask, so maybe that's why the perl docs
don't say much about it. Try man umask instead. Anyway:
Umask works the other way round. The bits that are set in umask
are those that will *not* be set in a file you create. So you want
an umask 0, which is scary, but that's up to you.
Anno
------------------------------
Date: 29 Jun 1999 16:30:04 GMT
From: 'x'campbell-lange@easynet.co.uk (Rory Campbell Lange)
Subject: newbie refs | uninitialised data prob
Message-Id: <'x'campbell-lange-2906991729410001@campbell-lange.easynet.co.uk>
I am a newbie, playing about with references and referencing
I've written the following code to encode a bit of data
(the bit below __END__) by taking the position of each letter
in the text to be incoded in the alphabet, and adding this to
the position of a letter in the codeword. Letters from 1 to n
are taken from the codeword in a cycle until the encoding text
is used up.
1) I'd like some comments on my attempts please.
I realise that it would be more useful to deal with caps,etc -
I've chopped the code down for posting
References $ar and $na are unnecessary - I was just
trying out the idea of referencing.
2) I get an unexplained uninitialised value readout:
This one is ok:
What code word do you want to use?
No spaces, digits or caps allowed
rory #<- codeword
dvdumw dl sptl
sfplqgeeh qgwu ldf
This one isn't
What code word do you want to use?
No spaces, digits or caps allowed
sam #<- codeword
xqpvaf hg uqru
----># Use of uninitialized value, <DATA> chunk 2.
File 'newgroup question'; Line 36
mabmepij refo gpg
I'm at a loss as to why the print @out doesn't work
I get to a point in the cycle where the codenumber +
the encoding number produces an uninitialised result
any help would be useful!
Regards
Rory
!#perl-w #: 1
@alphas = ("a".."z"); #: 2
$num = 0; #: 3
foreach $a (@alphas) { #: 4
$alphanum{$a} = ++$num; #: 5 make alpha
$numalpha{$num} = $a; #: 6 and number
} #: 7 hashes for
#: 8 encoding
$ar = {%alphanum}; #: 9
$na = {%numalpha}; #:10
#:11
while ($input !~ /^[a-z]+$/) { #:12 get
print "\n\nWhat code word do you want to use? #:13 codeword
No spaces, digits or caps allowed\n"; #:14
$input = <STDIN>; #:15
chomp $input; #:16
} #:17
$code = [split //, $input]; #:18
$code_last = scalar @$code; #:19 get number
$codenum = 0; #:20 of letters
#:21 in codeword
while (<DATA>) {$all .= $_;} #:22
$text_to_encode = [split //, $all]; #:23 get text
foreach $enc (@$text_to_encode) { #:24 to encode
$enc =~ tr/[A-Z]/[a-z]/; #:25
#:26
if ($enc =~ /[a-z]/i) { #:27
$codenum = $codenum % $code_last; #:28 all the
$enc = $na->{($ar->{$enc} #:29 encoding done
+ $ar->{$code->[$codenum]}) % 26}; #:30 here!
++$codenum; #:31
#:32
} #:33
} #:34
@out = reverse (@$text_to_encode); #:35 try and
print @out; #:36 print out
#:37
__END__ #:38
Not very important #:39
text to encode #:40
--
Rory Campbell-Lange
The Campbell-Lange Workshop
Remove the 'x' to reply
------------------------------
Date: Tue, 29 Jun 1999 16:59:01 +0100
From: Simon griffiths <s.grififths@virgin.net>
Subject: Re: Problem Installing Tk 8.000.14 - make => line too long
Message-Id: <3778ED45.9AEDA6B9@virgin.net>
The line in question is - I think -
# --- MakeMaker pm_to_blib section:
pm_to_blib: $(TO_INST_PM)
@$(PERL) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)" \
"-I$(PERL_ARCHLIB)" "-I$(PERL_LIB)" -MExtUtils::Install \
-e "pm_to_blib({qw{$(PM_TO_BLIB)}},'$(INST_LIB)/auto')"
- in other words its only the expansion that's the problem !
Thus splitting into separate lines is not an option !
> Well, you might try to break up lines into continuation lines. Run
> something like
>
> $line =~ s/(.{70,} )/$1\\\n\t/;
>
> over the makefile, that is, insert a backslash, a newline and a tab
> after a blank beyond column 70. (*Not* tested.) Apply repeatedly,
> if necessary.
>
> Anno
------------------------------
Date: Tue, 29 Jun 1999 11:59:26 -0400
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: search and replace with <>
Message-Id: <7laqhk$1sqe@fidoii.cc.Lehigh.EDU>
This Search and Replace script seems to correctly go through the files, but
while it claims there have been replacements, no change has actually been made
to the files in question. Can anyone see why?
snr.pl:
________________________
#!/usr/local/bin/perl -w
use diagnostics;
use strict;
#usage: snr files* -s "search_str" -r "replace_str"
my $replace = pop;
die "No replace string!\n" unless (pop =~ /-r/);
my $search = pop;
die "No search string!\n" unless (pop =~ /-s/);
my $count = 0;
while (<>) {
$count += s/$search/$replace/og;
}
print "Replaced \"$search\" with \"$replace\" $count times.\n";
________________________
--
Phil R Lawrence
Lehigh University
Enterprise Systems Implementation
Programmer / Analyst
prlawrence@lehigh.edu - work
prlawrence@planetall.com - personal
--
until (!$self->{'plaid pants'}) { bless $self, $class }
------------------------------
Date: 29 Jun 1999 19:08:44 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Unlink == delete files? Why (on earth) is it called unlink?
Message-Id: <oee7lonc7lf.fsf@alpha.hut.fi>
Scratchie <upsetter@ziplink.net> writes:
> Mats Pettersson <mats.pettersson@falukuriren.se> wrote:
> : After searching for a built in file-delete function in despair, i was
> : surprised (although i probably shouldn't be) to find it in 'unlink'.
>
> : Why such an unlogical name? Does it really delete files (as freeing up
> : disk space), or am i missing something of great importance here?
>
> : Feel free to enlighten me, please!
>
> The reasons have to do (I believe) with the file system used by Unix and
> its variants (which some on this ng apparently believe is so obvious and
> self-evident that it doesn't need to be described).
>
> In Unix, you can have more than one link to a single file. This allows you
I just heard that W2K (or, more precisely, NTFS5) will also have
"hard links". No doubt they will dub this as earth-shattering
innovation of their own.
> to have a single file "live" in two or more different directories, or to
> live under different names in the same directory. It always seemed kind of
> weird to me, coming from a non-Unix background, but that's the way it
That's not so strange once you know that in UNIX a file's real name is
two numbers (roughly, one per disk plus one per file). The name(s)
are for user convenience. Why not have several names?
> works (note that this is different from a symbolic link, which is more
> akin to a "shortcut" on Windows or an "alias" on a Mac).
>
> Anyway, when you "unlink" a file, you are just removing one of the
> (possibly multiple) names for that file. When you remove the last link,
> the file is deleted.
Close. When the last link is gone *and* no process holds the file
open, the file is deleted. Unlinking the last link will succeed
regardless of processes having the file open.
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
------------------------------
Date: Tue, 29 Jun 1999 16:07:54 GMT
From: brian_smith@sonat.com
Subject: updating activeperl to build 518
Message-Id: <7lar0f$jsh$1@nnrp1.deja.com>
I am having problems running the activeperl 518 updater, it cannot
replace perlSE.dll, perlcore.dll, and OLE.dll, and I don't know what
services to stop, if any, to run the install.
running NT 4.0, sp 3, IIS 4
Please help.
brian
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 16:04:27 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Verifying an existing file with a PERL web script
Message-Id: <3778ec51.1513787@news.skynet.be>
J. Trent Adams wrote:
>Thanks, I ran into this problem as well. The next question I have for
>you is, do you know how to find the path in which the script "thinks"
>the file lives? Is there a "print path" command that would work?
Try:
use Cwd;
print cwd; # Current Working Directory
but if from CGI, first print a content-type header (+ blank line).
Bart.
------------------------------
Date: Tue, 29 Jun 1999 20:30:27 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: win32 file access
Message-Id: <7lbs32$3uo14@news.cyber.net.pk>
flock() should work on NT.
Anyway you can always create a .tmp file and delete it after close(),
and if a .tmp already exists, that mean there is another session accessing
that file. You can sleep for 1 second for 2-3 times and if it doesn't
respond
remove the file (probably not deleted because of a script crash or
something,
just for ...)
--
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift ICQ: 4265451
FAX: (815) 846-2877
Kenneth Massey <kmassey@mratings.com> wrote in message
news:3778C91F.C0320355@mratings.com...
> I am writing a CGI script that will run on a NT server. It needs to
> access a data file of name/email addresses (sometimes reading, sometimes
> writing). How can I lock the file so that simultaneous accesses don't
> mess things up?
>
> I've tried flock(), but the experiments I've tried indicate that the
> file can still be accessed by multiple people at the same time. Any
> ideas would be great. Thanks,
>
> Kenneth
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6165
**************************************