[19668] in Perl-Users-Digest
Perl-Users Digest, Issue: 1863 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 3 14:10:38 2001
Date: Wed, 3 Oct 2001 11:10:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1002132614-v10-i1863@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 3 Oct 2001 Volume: 10 Number: 1863
Today's topics:
RegExp /g shall substitute more often <markus.cl@gmx.de>
Re: RegExp /g shall substitute more often (Rafael Garcia-Suarez)
Re: RegExp /g shall substitute more often (Villy Kruse)
Re: RegExp /g shall substitute more often (Randal L. Schwartz)
Re: RegExp /g shall substitute more often <markus.cl@gmx.de>
Re: RegExp /g shall substitute more often <jeffp@crusoe.net>
Re: RegExp /g shall substitute more often <markus.cl@gmx.de>
Re: Regexp question slidge@slidge.com
Re: Regexp question slidge@slidge.com
remove some pattern at the end of a file <hwc33@hotmail.com>
Re: resetting variables <bart.lateur@skynet.be>
Re: resetting variables nobull@mail.com
socket robustness (perl misk)
Re: Sourcing Things in Perl ? <arnoux@cena.fr>
Re: strict and undisciplined me nobull@mail.com
vvp:Perl DBI error <vprasad@americasm01.nt.com>
What does POSIX-compliant mean ? <digirini@xs4all.nl>
Re: What does POSIX-compliant mean ? <ilya@martynov.org>
Re: win32::netadmin::LocalGroupAddUsers (Eric Boehm)
Writing files <info@sharedweb.de>
Re: Yet another fork question <thompson-nospam@new.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 3 Oct 2001 17:24:20 +0200
From: "Markus Dehmann" <markus.cl@gmx.de>
Subject: RegExp /g shall substitute more often
Message-Id: <9pfaov$hpkmn$1@ID-101658.news.dfncis.de>
I have the following substitution:
$_ = "AAA";
s/AA/AB/g;
It changes AAA to ABA.
But what I need is rather ABB, according to the rule s/AA/AB/g;
What I want is that substitutions are done only virtually at first, and then
in the end all substitutions are applied, finally.
So, in "AAA" you have the string "AA" twice: First, if you begin with the
first letter, and then again, if you begin with the second letter of "AAA".
If you see it like this, you have AA twice in it and AAA should be
substituted twice: ABB.
How can I implement this?
Thanks, Markus.
------------------------------
Date: 3 Oct 2001 15:34:31 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: RegExp /g shall substitute more often
Message-Id: <slrn9rmbvo.4of.rgarciasuarez@rafael.kazibao.net>
Markus Dehmann wrote in comp.lang.perl.misc:
} I have the following substitution:
}
} $_ = "AAA";
} s/AA/AB/g;
}
} It changes AAA to ABA.
}
} But what I need is rather ABB, according to the rule s/AA/AB/g;
} What I want is that substitutions are done only virtually at first, and then
} in the end all substitutions are applied, finally.
}
} So, in "AAA" you have the string "AA" twice: First, if you begin with the
} first letter, and then again, if you begin with the second letter of "AAA".
} If you see it like this, you have AA twice in it and AAA should be
} substituted twice: ABB.
Yes, substituted patterns don't overlap.
You can use a look-behind assertion for this :
$ perl -le '$_="AAA";s/(?<=A)A/B/g;print'
ABB
This reads "replace an A that follows an A by a B". See perlre for
details.
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
Could Marconi have invented the radio if he hadn't by pure chance
spent years working at the problem? -- Monty Python, Penguins
------------------------------
Date: 03 Oct 2001 15:49:55 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: RegExp /g shall substitute more often
Message-Id: <slrn9rmct1.34r.vek@pharmnl.ohout.pharmapartners.nl>
On Wed, 3 Oct 2001 17:24:20 +0200,
Markus Dehmann <markus.cl@gmx.de> wrote:
>I have the following substitution:
>
>$_ = "AAA";
>s/AA/AB/g;
>
>It changes AAA to ABA.
>
>But what I need is rather ABB, according to the rule s/AA/AB/g;
>What I want is that substitutions are done only virtually at first, and then
>in the end all substitutions are applied, finally.
>
Need to apply the replaces right to left. You can do that with an external
loop.
perl -e '
$_ = "AAA";
while (s/(A+)A/$1B/) { print $_, "\n"; }
print "final result: ", $_, "\n";
'
This might work.
perl -e '
$_ = "AAAXXXXXAAAAAAAA999999";
while (s/(A+)A/$1B/) { }
print "final result: ", $_, "\n";
'
Villy
------------------------------
Date: 03 Oct 2001 09:06:41 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: RegExp /g shall substitute more often
Message-Id: <m1vghw673i.fsf@halfdome.holdit.com>
>>>>> "Markus" == Markus Dehmann <markus.cl@gmx.de> writes:
Markus> I have the following substitution:
Markus> $_ = "AAA";
Markus> s/AA/AB/g;
Markus> It changes AAA to ABA.
Markus> But what I need is rather ABB, according to the rule s/AA/AB/g;
Markus> What I want is that substitutions are done only virtually at first, and then
Markus> in the end all substitutions are applied, finally.
Markus> So, in "AAA" you have the string "AA" twice: First, if you begin with the
Markus> first letter, and then again, if you begin with the second letter of "AAA".
Markus> If you see it like this, you have AA twice in it and AAA should be
Markus> substituted twice: ABB.
Markus> How can I implement this?
$string = "AAA";
my @places;
push @places, pos($string) while $string =~ /(?=AA)./gs;
print "@places\n";
substr($string, $_ - 1, 2, "AB") for reverse @places; # offset by 1 for .
print "$string\n";
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 3 Oct 2001 18:05:56 +0200
From: "Markus Dehmann" <markus.cl@gmx.de>
Subject: Re: RegExp /g shall substitute more often
Message-Id: <9pfd6h$i41gq$1@ID-101658.news.dfncis.de>
The two solutions are nice, but because actually my problem is more complex
they don't help.
Look-behind works only for a fixed length but my pattern that stands before
B has in fact a variable length! This is my real problem that is more
complex than just AAA:
Suppose you have this string:
$_ = "bla-R carter-R bush-R clinton-R dunnowman-R clinton-R bla-R";
There is always a name "tagged" with 'R'. Now my rule says: Always tag
clinton with a D if there a two names tagged with R before him. My output
shall be:
bla-R carter-R bush-R clinton-D dunnowman-R clinton-D bla-R
But
s/(\w+-R \w+-R clinton-)R/$1D/;
delivers, of course, only
bla-R carter-R bush-R clinton-D dunnowman-R clinton-R bla-R
The rule doesn't apply to the second clinton because he has not two names
tagged with R before him anymore.
This:
s/(?<=\w+-R \w+-R clinton-)R/$1D/;
produces an error: "variable length lookbehind not implemented"
What can I do?
Markus.
"Markus Dehmann" <markus.cl@gmx.de> wrote in message
news:9pfaov$hpkmn$1@ID-101658.news.dfncis.de...
> I have the following substitution:
>
> $_ = "AAA";
> s/AA/AB/g;
>
> It changes AAA to ABA.
>
> But what I need is rather ABB, according to the rule s/AA/AB/g;
> What I want is that substitutions are done only virtually at first, and
then
> in the end all substitutions are applied, finally.
>
> So, in "AAA" you have the string "AA" twice: First, if you begin with the
> first letter, and then again, if you begin with the second letter of
"AAA".
> If you see it like this, you have AA twice in it and AAA should be
> substituted twice: ABB.
>
> How can I implement this?
>
> Thanks, Markus.
>
>
------------------------------
Date: Wed, 3 Oct 2001 12:42:49 -0400
From: Jeff 'japhy' Pinyan <jeffp@crusoe.net>
Subject: Re: RegExp /g shall substitute more often
Message-Id: <Pine.GSO.4.21.0110031240340.19830-100000@crusoe.crusoe.net>
[posted & mailed]
On Oct 3, Markus Dehmann said:
>Suppose you have this string:
>$_ = "bla-R carter-R bush-R clinton-R dunnowman-R clinton-R bla-R";
>
>There is always a name "tagged" with 'R'. Now my rule says: Always tag
>clinton with a D if there a two names tagged with R before him. My output
>shall be:
>bla-R carter-R bush-R clinton-D dunnowman-R clinton-D bla-R
Time for my demonstration of sexeger:
$_ = "bla-R carter-R bush-R clinton-R dunnowman-R clinton-R bla-R";
($_ = reverse) =~ s/R(?=-notnilc R-\w+ R-\w+)/D/g;
$_ = reverse;
By reversing the string, we turn
>s/(?<=\w+-R \w+-R clinton-)R/$1D/;
>produces an error: "variable length lookbehind not implemented"
a variable-length lookbehind into a variable-length lookahead, which is
implemented.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **
------------------------------
Date: Wed, 3 Oct 2001 19:00:11 +0200
From: "Markus Dehmann" <markus.cl@gmx.de>
Subject: Re: RegExp /g shall substitute more often
Message-Id: <9pfgbs$i2aes$1@ID-101658.news.dfncis.de>
Sounds good, I didn't know the pos function.
But why, then, doesn't this work for my carter-bush-clinton example?
$string = "bla-R carter-R bush-R clinton-R dunnowman-R clinton-R bla-R";
my @places;
while( $string =~ m/(?=\w+-R \w+-R clinton-)./g ) {
push @places, pos($string);
}
print "$string\n";
print "@places\n";
substr($string, $_ - 1, 1, "D") for reverse @places; # offset by 1 for .
print "$string\n";
it matches at 13 positions but should exactly match at 2 positions,
shouldn't it? The result is
bla-R DDDDDD-R bush-R DDDDDDD-R dunnowman-R clinton-R bla-R
Why???
When I look for this:
while( $string =~ m/(?=\w+-R \w+-R clinton-)R/g ) {
instead of this:
while( $string =~ m/(?=\w+-R \w+-R clinton-)./g ) {
there is no match at all!
Is the positive lookahead buggy if (?=...) stands _before_ the expression to
match?
Markus.
"Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
news:m1vghw673i.fsf@halfdome.holdit.com...
> >>>>> "Markus" == Markus Dehmann <markus.cl@gmx.de> writes:
>
> $string = "AAA";
> my @places;
> push @places, pos($string) while $string =~ /(?=AA)./gs;
> print "@places\n";
> substr($string, $_ - 1, 2, "AB") for reverse @places; # offset by 1 for .
> print "$string\n";
>
> --
> Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777
0095
> <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
> See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!
------------------------------
Date: Wed, 03 Oct 2001 15:01:01 GMT
From: slidge@slidge.com
Subject: Re: Regexp question
Message-Id: <NKFu7.19469$ck.130112@sjc-read.news.verio.net>
> You are trying to use a character class to prevent matching a
> multi-char string. Read the docs on character classes (e.g. man
> perlre). You probably want to replace this with:
I knew the character class was wrong. That was the main part of the
problem I was having.
> !~ /\d+\.\d+\.\d+\.\d+$/
The second part of the problem being that I did not know of the existence
of the "!~" so I was trying to do everything within the context of "=~"
Thank you very much
------------------------------
Date: Wed, 03 Oct 2001 15:02:38 GMT
From: slidge@slidge.com
Subject: Re: Regexp question
Message-Id: <iMFu7.19470$ck.130112@sjc-read.news.verio.net>
> This looks like a classic case for the 'unless' as per below:
> unless ($type eq 'HINFO' || $type eq 'TXT' || $type eq 'UNKNOWN'){
> unless ($line =~ /\.$/ || $line =~ /(\d+\.){3}\d+$/){
> $line .= $origin;
> }
> }
That makes much more sense. Thank you for helping out.
> I think the logic is easier to follow, because it tests all the conditions
> first, with no 'negative logic'.
We can get stuck in our ways, especially concerning problem solving. I
will attempt to use more creative approaches (ie, something different) in
the future.
Thanks!
------------------------------
Date: Thu, 4 Oct 2001 00:13:30 +0800
From: "hwchui" <hwc33@hotmail.com>
Subject: remove some pattern at the end of a file
Message-Id: <9pfdcr$g4h10@imsp212.netvigator.com>
I created a function to remove pattern <<CNF>> appearing at the end of
a file.
sub removeCode {
my ($filename) = @_;
local(*FH);
open(FH, "+< $filename") || die "Can\'t open file $filename: $!\n";
$out = '';
while(<FH>) {
s/<<CNF>>//g;
$out .= $_;
}
seek(FH, 0, 0) || die "Can't seek to start of $filename\n";
print FH $out || die "Can't print to $filename\n";
truncate(FH, tell(FH)) || die "Can't truncate $filename\n";
close(FH);
}
Is there a way which only goes to the last line of a file and remove a given
pattern? so that it more efficient that reading the whole file. As I know
the
given pattern only appears at the end of the file.
Thanks a lot
Wing
------------------------------
Date: Wed, 03 Oct 2001 13:55:31 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: resetting variables
Message-Id: <v16mrtksrr0kgknnjr1pg3gben5m0gv3jc@4ax.com>
rolf deenen wrote:
>Simple question. In a cgi-script i wrote to store web-links i want to
>clear some variables at the end of the script so that when a user
>refreshes the page the freshly added new entry doesn't get added
>again. How can I do this. It's a hash I want to clear completely....
All CGI scripts are run as separate programs, thus all unsaved data will
be lost when it finishes, and you'll start with a fresh copy next time.
If you worry about using mod_perl or similar, you are right to worry.
Just use my() on your script variables, and they'll be limited to this
run. For globals, I'd expect that local() could work...
--
Bart.
------------------------------
Date: 03 Oct 2001 18:19:24 +0100
From: nobull@mail.com
Subject: Re: resetting variables
Message-Id: <u9g0903alf.fsf@wcl-l.bham.ac.uk>
rgarciasuarez@free.fr (Rafael Garcia-Suarez) writes:
> CGI programs are executed each time the corresponding page(s) is
> requested. In other words, the same instance of the running program is
> not reused for two pages. So you don't need to clear any variable at the
> end of your script.
This is true, however it is good practice IMHO to get into the habit
of writing your Perl CGI scripts as though they may one day be run
under mod_perl rather than CGI.
This means that you do need to clear your variables.
Anyhow I suspect this whole thing is moot as I suspect the OP was
taking about the 'stickey' nature of fields in CGI.pm. To disable
this you need the 'force=>1' attribute on fields.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 3 Oct 2001 09:34:23 -0700
From: perlmisk@yahoo.co.uk (perl misk)
Subject: socket robustness
Message-Id: <7fe42fcd.0110030834.4e0de96d@posting.google.com>
within a socket server, if one uses:
104 while (defined (my $reply = <$sock>)) {
105
106 print "$reply\n";
107
108 }
is this a potential bug?
what if the client stops sending for whatever reason? would the
server be stuck in a state of limbo? would sysread/syswrite help? or
would it suffer a similar flaw?
------------------------------
Date: Wed, 03 Oct 2001 17:41:14 +0200
From: arnoux <arnoux@cena.fr>
Subject: Re: Sourcing Things in Perl ?
Message-Id: <3BBB319A.2345306D@cena.fr>
slightlysprintingdog@ntlworld.com wrote:
> I trying to source some stuff in a Perl Tk script.
>
> Basically I have a string setup somewhere else in the program ;
> $sourceme which contains the full path of the source file.
>
> And then I'm using the system command to source it like so :
>
> system ( "source $sourceme" );
>
> I don't get anything written to the console and the file is definately
> not sourced.
>
> Any ideas ?
I once had to deal with the following :
how to get some variable initialisation from multiple recursive file :
At tcsh prompt I will do some
source toto.csh
and toto.csh would have to source some other titi.csh and so on.
at the end all variables would be initialized
then I start the application that needed all this initialisation :
As you cannot fork a child that alter your Environement you've got to
acquire the variables and then set them so that another child that you
fork
will take them into account.
Here is the code I used :
print STDERR "source $Mass_settings";
# on veut 'sourcer' un script en tcsh
# et récupérer les variables d'environnements ainsi positionnées
# Il nous faut donc d'abord trouver un moyen de passer la commande
# 'source MASS_SETTINGS' à un interpréteur tcsh
# on est contraint de faire cela dans un processus fils
# puis de remonter les variables d'environnements ainsi positionnées
# dans le processus courant : on va utiliser un pipe pour communiquer
# entre le fils et le process courant
open TRALALA, "echo 'source $Mass_settings;env'| /usr/bin/tcsh -s |"
|| die "pb at open ";
while (<TRALALA>) {
chop;
my ($variable,$valeur) = /^(.+?)=(.*)$/;
$ENV{$variable} = $valeur;
}
close TRALALA || die "pb at close ";
After that I can system ('myapplication') ;
Cyril
------------------------------
Date: 03 Oct 2001 18:01:44 +0100
From: nobull@mail.com
Subject: Re: strict and undisciplined me
Message-Id: <u9ofno3bev.fsf@wcl-l.bham.ac.uk>
Bart Lateur <bart.lateur@skynet.be> writes:
> local $^W;
Manipualating $^W is the right thing iff you need your scripts to be
backward compatible with versions prior to 5.6.
If you never anticipate using older versions of Perl then read
"perllexwarn" for a more elegant approach to warning management.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 3 Oct 2001 12:53:57 -0400
From: "Prasad, Victor [FITZ:K500:EXCH]" <vprasad@americasm01.nt.com>
Subject: vvp:Perl DBI error
Message-Id: <9pffq4$iso$1@bcarh8ab.ca.nortel.com>
Would anybody be able to help me with this error:
Can't call method "bind_columns" without a package or object reference:
What is it referencing?
Here is the chuck of code:
foreach $signarray (@signarray) {
($soid,$sogid,$sos,$sosd,$sot) = @signarray;
$sth=$dbh->prepare("SELECT first_name,last_name from aaa_emp whe
re global_id=$sogid");
$sth->bind_columns(undef,\$first,\$last) or die "naming problem. <----THIS
IS LINE 189
","\n";
$sth->execute();
$firstlast=$sth->fetchrow_array();
print "Name: $firstlast \n";
$first=~s/ //g;
$last=~s/ //g;
$rq++;
print "Sign off:$soid GID:$sogid $first $last status: $sos date:
$sosd req: $r_id[$rq] total:$rtotal[$rq] $cnt \n";
print FILE "$soid|$sogid|$first|$last|$sos|$sosd|$r_id[$rq]|$rtotal[$rq]
| $cnt \n";
}## signoff
$sth->finish;
The program is suppose to retrieve a row from the sql statement - then take
the fields - break them up into individual variables. It works when I use a
while statement instead of the first 'foreach' statement.
ie
************works******
$signarray= $sth->fetchrow_array();
while ($signarray = $sth->fetchrow_arrayref) {
push @signarray,[@$signarray];
}
**************************
Does not:
foreach $signarray (@signarray) {
($soid,$sogid,$sos,$sosd,$sot) = @signarray;
$sth=$dbh->prepare("SELECT first_name,last_name from aaa_emp whe
re global_id=$sogid");
$sth->bind_columns(undef,\$first,\$last) or die "naming problem. <----THIS
IS LINE 189
Any help?
Thanks,
V
------------------------------
Date: Wed, 03 Oct 2001 19:04:17 +0200
From: Rinus Luijmes <digirini@xs4all.nl>
Subject: What does POSIX-compliant mean ?
Message-Id: <9t7krtc07mgjju5dm7unilum75fu66o0f3@4ax.com>
Maybe offtopic but the question in the subject of this mail came up
when reading Linux and Perl documentation. Is POSIX an abbreviation
for a set of rules?
TIA,
--
Rinus Luijmes
www.xs4all.nl/~digirini N 51°57.032' E 006°24.689'
------------------------------
Date: 03 Oct 2001 21:09:04 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: What does POSIX-compliant mean ?
Message-Id: <87wv2ck5vz.fsf@abra.ru>
>>>>> On Wed, 03 Oct 2001 19:04:17 +0200, Rinus Luijmes <digirini@xs4all.nl> said:
RL> Maybe offtopic but the question in the subject of this mail came up
RL> when reading Linux and Perl documentation. Is POSIX an abbreviation
RL> for a set of rules?
From my dictionary:
POSIX - Portable Operating System for unIX
(POSIX) A set of IEEE standards
designed to provide application portability between Unix
variants. IEEE 1003.1 defines a Unix-like operating system
interface, IEEE 1003.2 defines the shell and utilities and
IEEE 1003.4 defines real-time extensions.
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: 2 Oct 2001 20:21:40 GMT
From: boehm@nortel.ca (Eric Boehm)
Subject: Re: win32::netadmin::LocalGroupAddUsers
Message-Id: <9pd7kk$cn$1@zrtph05m.us.nortel.com>
>>>>> "Nick" == "Nick Blake" <nick.blake@qr.com.au> writes:
Nick> Connecting remotely to a server with this script. What am I
Nick> doing wrong ??
Nick> This is a sample record
Nick> ROK_CEREP_CORRIE,RCENTRE\ROK_CEREP_CORRIE
Nick> script;
Nick> use Win32::NetAdmin;
Nick> while ( <> ){
Nick> ( $groupname, $users ) = split(/,/);
Nick> Win32::NetAdmin::LocalGroupAddUsers(\\\\server, $groupname,
Nick> $users) || print "error", $groupname . "\n", $users;
I'm not sure. Maybe you need double quotes around \\\\server.
I use the following successfully
use Win32::NetAdmin qw ( LocalGroupIsMember LocalGroupAddUsers );
sub check_group_membership {
my ( $host, $group, $member ) = @_;
$host = "\\\\$host" unless ( $host =~ /^\\\\/ );
my $is_member = LocalGroupIsMember( $host, $group, $member );
print "\n**** ERROR: $member is not a member of the local $group group\n"
unless ( $is_member );
if ( $optctl{fix} && !$is_member ) {
LocalGroupAddUsers( $host, $group, $member ) || do {
print "**** ERROR: Unable to add $member to local $group group: $^E\n";
};
}
}
--
Eric M. Boehm boehm@nortelnetworks.com
------------------------------
Date: Wed, 3 Oct 2001 18:05:37 +0200
From: "Gerd Wagner" <info@sharedweb.de>
Subject: Writing files
Message-Id: <9pfd0a$24j$03$1@news.t-online.com>
Hy freaks!
I want to code a little site-counter by perl (CGI). This is not difficult.
But I want to store the count-file at another server as mine. The
perl-script should be run on my server and the file, where the script writes
data should be on a different server. If I code this, there is no result on
the server, where the datafile is.
Is it impossible to write with perl on another server or what did I do
false?? :-/ Please help me! Thanks!
Greetinx from germany
Gerd Wagner
------------------------------
Date: Wed, 03 Oct 2001 14:53:03 GMT
From: "P. Thompson" <thompson-nospam@new.rr.com>
Subject: Re: Yet another fork question
Message-Id: <Pine.LNX.4.33.0110030942050.23853-100000@malacandra.localnet>
On Wed, 3 Oct 2001, Mr. Sunblade wrote:
> Ok - I should be checking for a successful fork, though I have to ask: Has
> anyone ever seen a fork fail (on a *nix system)? If so, why did it fail?
> I'm genuinely curious. I realize the books all say that it should be
> checked for, but aren't the odds extremely small of this happening?
If you exceed the maximum number of user processes defined in your
kernel it will fail. This could happen on a busy server with most
processes running as one user tho most times I have seen it it was due to
something going haywire.
--
Leave the nospam in, correct email address
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 1863
***************************************