[19480] in Perl-Users-Digest
Perl-Users Digest, Issue: 1675 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 1 06:10:31 2001
Date: Sat, 1 Sep 2001 03:10:12 -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: <999339012-v10-i1675@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 1 Sep 2001 Volume: 10 Number: 1675
Today's topics:
Perlscript memory leak (vrac)
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <pne-news-20010901@newton.digitalspace.net>
Re: sharing sockets between processes <bla@bla.bla>
Re: use CGI qw(param) <mfrick@chariot.net.au>
Re: use CGI qw(param) <rob_13@excite.com>
Verilog Training Courses (ASIC / VLSI Design) <training@nsquare.com>
Re: Vintage versions of perl <dtweed@acm.org>
Re: Vintage versions of perl (Martien Verbruggen)
~ s/\n//g; does not remove line brack's whats wrong? <michealo@ozemail.com.au>
Re: ~ s/\n//g; does not remove line brack's whats wro <rob_13@excite.com>
Re: ~ s/\n//g; does not remove line brack's whats wro <pne-news-20010901@newton.digitalspace.net>
Re: ~ s/\n//g; does not remove line brack's whats wro <michealo@ozemail.com.au>
Re: ~ s/\n//g; does not remove line brack's whats wro <wyzelli@yahoo.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 31 Aug 2001 18:56:53 -0700
From: xvrac@mediaone.net (vrac)
Subject: Perlscript memory leak
Message-Id: <1a6d415b.0108311756.30f36dd9@posting.google.com>
I put a perl script into a windows script component and ran it on a
timer from vb, it slowly consumed more and more memory on every
iteration. I broke it down to the point where there now nothing but
an empty function call in the script, the memory leak still occurs.
The script component looks like this:
<script language="PerlScript">
<![CDATA[
sub exec{
}
]]>
</script>
When I replace PerlScript with vbscript or javascript and put in a
similar empty function there is no increase in memory use no matter
how many times it runs. I've got the latest build of activestate
perl, 629.
Any ideas?
------------------------------
Date: Sat, 01 Sep 2001 09:43:11 +0200
From: Philip Newton <pne-news-20010901@newton.digitalspace.net>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.2 $)
Message-Id: <k941ptgfeslrodktrcn2jqt7oa1ppb8pt1@4ax.com>
On Fri, 31 Aug 2001 17:33:56 GMT, tadmc@augustmail.com wrote:
> Do not re-type Perl code
> Use copy/paste or your editor's "import" function rather than
> attempting to type in your code. If you make a typo you will get
> followups about your typos instead of about the question you are
> trying to get answered.
Also:
Post real code. Do not post something that you think "looks like" your
code and then, when people comment on what you posted, say "but that
won't work in my real program because it does <foo> instead of <bar>".
This will only serve to annoy people (especially if you incrementally
reveal more and more restrictions) rather than helping.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sat, 01 Sep 2001 09:50:38 GMT
From: "ninpo" <bla@bla.bla>
Subject: Re: sharing sockets between processes
Message-Id: <Ob2k7.116365$SC.2684851@amsnews02.chello.com>
In that way, only communication between parents and children is
possible,right?,
but i'm looking for a way to have the children chatter amongst eachother.
Every forked process gets its own socket. a newly spawned child has no
knowledge of other clients and hence, their sockets.
I've read perlipc again, maybe I'm missing something ?
I have a client connecting to a server, and another client connecting to the
same
server. each gets its own process, with the server going back to listening
on the port.
thirty clients on the wall now and untill the thirtieth falls I'ld like it
to be able to write
something directly to the socket of the first child and the second etc.
Should I have all the communication go through the parent? but if so, how
can I make
the sockets distinguishable, since in the code a new object is returned,
everytime by the same name:
$new_sock = $listening_sock->accept;
defined ($kidpid = fork())||die " muhahahah\n";
if ($kidpid){
kidstuff
}else{
parentstuff
}
everytime i get a new socket it has the name $new_sock, how's the parent to
know the difference between
the new_sock of child1 and the new_sock of child24?
Ninpoka, scratching his nose wondering how pipes are going to save him.
"Logan Shaw" <logan@cs.utexas.edu> wrote in message
news:9mh4cp$fs9$1@charity.cs.utexas.edu...
> In article <ACTi7.47971$SC.1031821@amsnews02.chello.com>,
> ninpo <bla@bla.bla> wrote:
> >I'm looking for a way to have forked sockets
> >be able to write to eachother.
> >I've tried putting the sockets in shared memory
> >(IPC::Shareable) but that only accepts the basic classes scalar array and
> >hash.
> >
> >I now have clients polling for values in shared mem, but that eats cpu. i
> >want the values directly printed to the socket. is that possible and can
> >someone give me a pointer how?
>
> You want to use pipe():
>
> #! /usr/local/bin/perl
>
> use IO::Handle;
>
> $to_pipe = new IO::Handle;
> $from_pipe = new IO::Handle;
>
> pipe $from_pipe, $to_pipe;
>
> if (fork())
> {
> # parent
> $from_pipe->close; # only the other process uses this.
>
> # send some lines of stuff to the other process.
> foreach my $i (qw{ one two three })
> {
> $to_pipe->print("$i\n");
> $to_pipe->flush;
> sleep 2;
> }
>
> $to_pipe->close;
> }
> else
> {
> # child
> $to_pipe->close; # only the other process uses this.
>
> my $line;
>
> # read what the other process sends to us.
> while ($line = $from_pipe->getline())
> {
> chomp $line;
> print STDOUT "I got '$line'.\n";
> }
>
> $from_pipe->close;
> }
>
> "perldoc perlipc" should have other stuff that might be helpful.
>
> Hope that helps.
>
> - Logan
> --
> "Our grandkids love that we get Roadrunner and digital cable."
> (Advertisement for Time Warner cable TV and internet access, July 2001)
In that way, only communication between parents and children is
possible,right?,
but i'm looking for a way to have the children chatter amongst eachother.
Every forked process gets its own socket. a newly spawned child has no
knowledge of other clients and hence, their sockets.
I've read perlipc again, maybe I'm missing something ?
I have a client connecting to a server, and another client connecting to the
same
server. each gets its own process, with the server going back to listening
on the port.
thirty clients on the wall now and untill the thirtieth falls I'ld like it
to be able to write
something directly to the socket of the first child and the second etc.
Should I have all the communication go through the parent? but if so, how
can I make
the sockets distinguishable, since in the code a new object is returned,
everytime by the same name:
$new_sock = $listening_sock->accept;
defined ($kidpid = fork())||die " muhahahah\n";
if ($kidpid){
kidstuff
}else{
parentstuff
}
everytime i get a new socket it has the name $new_sock, how's the parent to
know the difference between
the new_sock of child1 and the new_sock of child24?
Ninpoka, scratching his nose wondering how pipes are going to save him.
------------------------------
Date: Sat, 1 Sep 2001 14:52:18 +0930
From: "Matthew Frick" <mfrick@chariot.net.au>
Subject: Re: use CGI qw(param)
Message-Id: <3b906fba$1_4@news.chariot.net.au>
if the error is that it cannot find it on the INC path then you can push the
directory it resides in onto the inc.
"alex" <aort527@hotmail.com> wrote in message
news:3B8E4936.38B7AC76@hotmail.com...
> newbie here. trying to use "use CGI qw(param)" in
> my perl script but it appears that it can't find
> the CGI.pm MODULE. my script resides in
> \inetpub\wwwroot\cgi-bin directory and
> I found CGI.pm in \PERL\LIB.
>
> how do I tell my script to go to this
> \PERL\LIB directory to find the CGI.PM
> module. do i code something like:
> use C:\PERL\LIB\CGI qw(param)
>
> this doesn't work. help....
>
------------------------------
Date: Sat, 01 Sep 2001 05:30:58 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: use CGI qw(param)
Message-Id: <Xns910FF6768DB1rock13com@64.8.1.227>
alex <news:3B8E4936.38B7AC76@hotmail.com>:
> newbie here. trying to use "use CGI qw(param)" in
> my perl script but it appears that it can't find
> the CGI.pm MODULE. my script resides in
> \inetpub\wwwroot\cgi-bin directory and
> I found CGI.pm in \PERL\LIB.
If the CGI module is in there then it should be in the search path
and perl will look for and find it. Perhaps there is some other
problem with your script. Are you using the -w switch (or use
warnings;) Also, I can't recall if you are allowed to import only
the param function--you may need to import :standard or something
like that instead.
Read the docs on CGI to make sure you are using it correctly.
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Fri, 31 Aug 2001 19:01:25 -0700
From: N Square Corp <training@nsquare.com>
Subject: Verilog Training Courses (ASIC / VLSI Design)
Message-Id: <3B904175.7C43279C@nsquare.com>
THE FOLLOWING CLASSES WILL BE HELD AT OUR SANTA CLARA, CA (USA)
CENTER.
Location Address: N Square Corporation
2094 Walsh Ave., Ste # B-1, Bldg #6, Santa Clara, CA 95050
(Inside the San Tomas Business Center)
Tel # 408-654-0500
COURSE I: INTRODUCTION TO DIGITAL DESIGN USING VERILOG
Duration: 4 weeks ( 2 classes per week ) - Students can enroll for
either weekday or weekend classes.
Weekend Classes: Every Saturday & Sunday (Timings: 8:30 am to 11:30 am)
Weekday Classes: Every Tues & Wed (Timings: 6:15 pm to 9:15 pm)
Starts by: Sheduled to begin on and from 09/15/01.
COURSE II: ADVANCED DIGITAL DESIGN USING VERILOG
Duration: 4 weeks ( 2 classes per week )
Weekend Classe only: Every Saturday & Sunday
Timings: 2:30 pm to 5:30 pm
Starts by: Sheduled to begin on and from 10/13/01.
FREE Question-hour for both COURSES will be held on every Saturday and
Sunday after 11:30 am and 5:30 pm. Interested candidates may fix
apointment with our Instructor by e-mailing st
<mailto:training@nsquare.com?Subject=FREE_Ques_Hr> or call #
408-654-0500. Please check http://www.nsquare.com/training for further
details on these Courses or call us
PROFILES OF OUR INSTRUCTORS
-------------------------------------------------
Most of our instructors had been associated with the ASIC Design /
Verification, Networking and Wireless communications related industries
for about 8 - 12 years and has extensive experience in working at both
hands-on level and also project management. They have prior experience
working at companies, viz. - NEC, Philips, 3Com, Cisco, Sun
Microsystems, Nokia etc. The courses are fully Lab-based and are
scaled-down versions of real-time projects. Please check
http://www.nsquare.com/training for further details.
------------------------------
Date: Sat, 01 Sep 2001 01:38:50 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: Vintage versions of perl
Message-Id: <3B903B10.5F9C15A4@acm.org>
Lijiv Khil wrote:
> From where can I download old versions of perl source? Version 1.0 or
> v0.1 for example.
I've got perl-3.018, from around August 1991.
If you're interested in such a "mature" Perl, I can put it up temporarily
on my web server. All 48 files and 670KB of it.
For comparison, perl-5.7.2 weighs in at 29.5MB and 2259 files in 238
directories.
-- Dave Tweed
------------------------------
Date: Sat, 1 Sep 2001 14:32:54 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Vintage versions of perl
Message-Id: <slrn9p0p7m.3ga.mgjv@martien.heliotrope.home>
On 31 Aug 2001 11:09:43 -0700,
Lijiv Khil <lijivnews@yahoo.com> wrote:
> Hi,
> From where can I download old versions of perl source? Version 1.0 or
> v0.1 for example.
I have 1.0, 2.0, 3.01 and 4.036 here somewhere. I believe that I got
them from the Perl Oasis, www.oasis.leo.org/perl, but that host name
doesn't seem to resolve anymore.
Martien
--
Martien Verbruggen |
Interactive Media Division | That's not a lie, it's a
Commercial Dynamics Pty. Ltd. | terminological inexactitude.
NSW, Australia |
------------------------------
Date: Sat, 1 Sep 2001 14:06:08 +1000
From: "nathan" <michealo@ozemail.com.au>
Subject: ~ s/\n//g; does not remove line brack's whats wrong?
Message-Id: <O7Zj7.1215$V83.66725@ozemail.com.au>
ive been using ($minidesc = $input{'minidesc'}) =~ s/\n//g;
to try and remove line bracks, the input comes from a multiline form fild.
heres the data when it has been recived
1&&ndreamer&&yayaya&&kkkkkkkkkkk
kkkkkkk
kkkkkkkkkkk
kkkkkkkkkkkkkk&&http://localhost/news/.html&&1.html&&news
as you can see the method i have does little to nothing.
here is what i want the above to come out
1&&ndreamer&&yayaya&&kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk&&http://loc
alhost/news/.html&&1.html&&news
is there a way to print just to one line?
can i remove these line bracks from my minidesc fild with out using a single
line text box?
------------------------------
Date: Sat, 01 Sep 2001 05:38:43 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: ~ s/\n//g; does not remove line brack's whats wrong?
Message-Id: <Xns910F10B7F42rock13com@64.8.1.227>
nathan <news:O7Zj7.1215$V83.66725@ozemail.com.au>:
> ive been using ($minidesc = $input{'minidesc'}) =~ s/\n//g;
> to try and remove line bracks, the input comes from a multiline
> form fild.
Maybe you need to remove carriage returns "\r"
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Sat, 01 Sep 2001 09:43:10 +0200
From: Philip Newton <pne-news-20010901@newton.digitalspace.net>
Subject: Re: ~ s/\n//g; does not remove line brack's whats wrong?
Message-Id: <2s31ptc7upt7qri873n0or4r204hf0rkm6@4ax.com>
On Sat, 1 Sep 2001 14:06:08 +1000, "nathan" <michealo@ozemail.com.au>
wrote:
> ive been using ($minidesc = $input{'minidesc'}) =~ s/\n//g;
> to try and remove line bracks, the input comes from a multiline form fild.
In that case, it may have "\r\n" at the end of each line. To remove all
carriage returns *and* line feeds, you can use tr/\r\n//d.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sat, 1 Sep 2001 18:10:14 +1000
From: "nathan" <michealo@ozemail.com.au>
Subject: Re: ~ s/\n//g; does not remove line brack's whats wrong?
Message-Id: <II0k7.1274$V83.72724@ozemail.com.au>
thank you both. .
for the help . and it was the carrage return that was bracking my lines.
Philip Newton <pne-news-20010901@newton.digitalspace.net> wrote in message
news:2s31ptc7upt7qri873n0or4r204hf0rkm6@4ax.com...
> On Sat, 1 Sep 2001 14:06:08 +1000, "nathan" <michealo@ozemail.com.au>
> wrote:
>
> > ive been using ($minidesc = $input{'minidesc'}) =~ s/\n//g;
> > to try and remove line bracks, the input comes from a multiline form
fild.
>
> In that case, it may have "\r\n" at the end of each line. To remove all
> carriage returns *and* line feeds, you can use tr/\r\n//d.
>
> Cheers,
> Philip
> --
> Philip Newton <nospam.newton@gmx.li>
> That really is my address; no need to remove anything to reply.
> If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sat, 1 Sep 2001 19:29:33 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: ~ s/\n//g; does not remove line brack's whats wrong?
Message-Id: <pe2k7.6$MQ4.325@wa.nnrp.telstra.net>
"nathan" <michealo@ozemail.com.au> wrote in message
news:II0k7.1274$V83.72724@ozemail.com.au...
> thank you both. .
> for the help . and it was the carrage return that was bracking my lines.
What the hell is 'bracking'? Are referring to newlines or carriage returns?
Or do you mean 'breaking'?
'scuse my semantic silliness... :)
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
$d='$_$a$s$b$w';$e='$_$a$s$b';sub d{$h=shift;$h=~s/\$(\w+)/${$1}/g;return$h}
sub
e{return(shift!=1)?'s':''}for(reverse(1..100)){$s=e($_);$f=d($d);$g=d($e);
$c.="$f\n$g\n$t\n";$_--;$s=e($_);$e=d($d);$c.="$e\n\n";}print"$c*hic*";
------------------------------
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 1675
***************************************