[25824] in Perl-Users-Digest
Perl-Users Digest, Issue: 8061 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 9 09:05:26 2005
Date: Mon, 9 May 2005 06:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 9 May 2005 Volume: 10 Number: 8061
Today's topics:
can I modify a file without using a temporary file <cckk_lin@yahoo.ie>
Re: can I modify a file without using a temporary file <jurgenex@hotmail.com>
Re: How can I prevent perl from exiting during a networ (Anno Siegel)
How to do this? Form fill problem (Moozie)
Re: How to do this? Form fill problem <pilkowsk@informatik.uni-marburg.de>
Parrot 0.2.0 "NLnet" Released! <slrn@toetsch.at>
running a compiled program in perl <Bob_then@yahoo.com.au>
Re: running a compiled program in perl <1usa@llenroc.ude.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 9 May 2005 11:23:19 +0800
From: "Lin Jingxian" <cckk_lin@yahoo.ie>
Subject: can I modify a file without using a temporary file
Message-Id: <d5ml6g$vc8$1@news.yaako.com>
hi,
I want to modify contents of a file. usually I will open the file,read the
contents,
do some substitution, and write them to a temporary file, then delete the
original file,
rename the temporary file to the original file.
now I want not to use a temporary file, can I do it in perl ?
thanks.
------------------------------
Date: Mon, 09 May 2005 03:44:18 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: can I modify a file without using a temporary file
Message-Id: <m0Bfe.13940$dw1.4614@trnddc02>
Lin Jingxian wrote:
> hi,
> I want to modify contents of a file. usually I will open the
> file,read the contents,
> do some substitution, and write them to a temporary file, then delete
> the original file,
> rename the temporary file to the original file.
> now I want not to use a temporary file, can I do it in perl ?
Sure, just open() the file for read and write and then seek() to whereever
you want to write.
jue
------------------------------
Date: 8 May 2005 19:12:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How can I prevent perl from exiting during a network error?
Message-Id: <d5lobn$596$1@mamenchi.zrz.TU-Berlin.DE>
Song Lining <songlining@gmail.com> wrote in comp.lang.perl.misc:
> Hi, guys
>
> Got a very frustrating problem while writing a perl socket client to
> connect to a server.
>
> The perl client will quit by itself everytime I stop the server and
> the errno is either "ECONNRESET: Connection aborted" or "ECONNABORTED:
> Connection reset by peer".
How do you know that? Is that printed by the code you show?
> The problem is that I need to keep the
> client alive even the server is shutdown, so I tried to ignore all the
> signals in %SIG but that didn't help either. Here's a snipet of the
> code:
>
> <code>
> ...
> foreach (keys %SIG) {
> print "$_\n";
> $SIG{$_} = 'IGNORE';
> }
> ...
> ...
> $sock = new IO::Socket::INET(
> PeerAddr => $PeerAddr,
> PeerPort => $PeerPort,
> Proto => 'tcp',
> );
> ...
> ...
> </code>
>
> As you can see, it's a very simple and straitforward code but how can
> it stop exiting??? I think there must be at least one easy way to do
> it :)
>
> Any clue would be much appreciated!
From what you show, there is no reason why it shouldn't exit. There's
no read-loop or anything. It creates the socket and exits, closing the
socket.
Show a small program we can run that demonstrates the behavior, and
explain why you think it should behave otherwise.
Anno
------------------------------
Date: 9 May 2005 03:54:36 -0700
From: nospam@dse.nl (Moozie)
Subject: How to do this? Form fill problem
Message-Id: <e8b6156c.0505090254.7c3e7333@posting.google.com>
I have a form that people can fill out.
Link looks like:
http://www.myname.com/form.php
A regular form, nothing special.
Now I would like to fill out 1 field automatically by the link I give
people.
E.g. custommer number 14 will get a link from me like this one:
http://www.myname.com/form.php?number=14
Or something similar.
What I would like to know is: how to put that "number 14" included in
the link into the form. Or (even better) send it as a hidden field in
the form?
Is there maybe a cgi script or php script that does this job? Or a
piece of javascript maybe?
Any advice would be appreciated.
Thanks for reading!
------------------------------
Date: Mon, 9 May 2005 13:36:14 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: How to do this? Form fill problem
Message-Id: <3e908aF1pvi1U1@individual.net>
* Moozie schrieb:
> I have a form that people can fill out.
>
> Link looks like:
> http://www.myname.com/form.php
> A regular form, nothing special.
>
> Now I would like to fill out 1 field automatically by the link I give
> people.
> E.g. custommer number 14 will get a link from me like this one:
> http://www.myname.com/form.php?number=14
> Or something similar.
>
> What I would like to know is: how to put that "number 14" included in
> the link into the form. Or (even better) send it as a hidden field in
> the form?
>
> Is there maybe a cgi script
If you're using CGI.pm for creating the form the default values are
those you send with your request -- that's the default mode, AFAIR. You
have to deactivate this feature explicitly if this isn't desired (search
`perldoc CGI` for the "-override" parameter to get an explanation).
Hence, I suggest to use CGI.pm for this.
> or php script that does this job? Or a
> piece of javascript maybe?
Neither PHP nor JavaScript is discussed in this newsgroup. But you could
also use PHP as well as JavaScript for this, I guarantee.
regards,
fabian
------------------------------
Date: Sun, 08 May 2005 18:15:49 +0200
From: Leopold Toetsch <slrn@toetsch.at>
Subject: Parrot 0.2.0 "NLnet" Released!
Message-Id: <slrnd7sep9.ne7.slrn@toetsch.at>
Parrot 0.2.0 "NLnet" Released!
On behalf of the Parrot team I'm proud to announce the release of
Parrot 0.2.0 and I'd like to thank all involved pepole as well as
our sponsors for supporting us.
It's a pleasure and honor for me to be able to advertise (after 0.1.0) the
next leap release 0.2.0 with almost complete MMD support.
What is Parrot?
Parrot is a virtual machine aimed at running Perl6 and other dynamic
languages.
Parrot 0.2.0 changes and news
* parrot repository is now under subversion
* MMD (Multi Method Dispatch) refactored
* new unary and infix opcodes that return new result PMCs
* dynamic scalar PMCs inherit now almost all from Parrot core PMCs
* more unification of PMCs and ParrotObjects
* tailcalls for functions and methods
* PGE (Parrot Grammar Engine) reworked
* Pugs creates Parrot code and Pugs is a registered Parrot compiler
* new languages/lisp
* the usual bug fixes and improvements
After some pause you can grab it from
<http://www.cpan.org/authors/id/L/LT/LTOETSCH/parrot-0.2.0.tar.gz>.
As parrot is still in steady development we recommend that you
just get the latest and best from SVN by following the directions at
<http://www.parrotcode.org/source.html>
Turn your web browser towards <http://www.parrotcode.org/> for more
information about Parrot, get involved, and:
Have fun!
leo
------------------------------
Date: Mon, 9 May 2005 13:49:44 +1000
From: "Bob Then" <Bob_then@yahoo.com.au>
Subject: running a compiled program in perl
Message-Id: <427eddcd$1@dnews.tpgi.com.au>
How can I run a compiled C program in Perl I tried using
use Shell(prog);
prog("","");
and
use Shell(./prog);
prog("","");
and
use Shell(prog);
./prog("","");
but non of them worked.
I know the first one didn't work because it needs the ./ at the start
------------------------------
Date: Mon, 09 May 2005 04:01:48 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: running a compiled program in perl
Message-Id: <Xns96512EB4075asu1cornelledu@127.0.0.1>
"Bob Then" <Bob_then@yahoo.com.au> wrote in news:427eddcd$1
@dnews.tpgi.com.au:
> How can I run a compiled C program in Perl I tried using
>
> use Shell(prog);
Did you even bother to read the documentation for the module you are
using?
DESCRIPTION
Caveats
This package is included as a show case, illustrating a few Perl
features. It shouldn't be used for production programs. Although
it does provide a simple interface for obtaining the standard
output of arbitrary commands, there may be better ways of achieving
what you need.
Please read:
perldoc Shell
perldoc -f system
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8061
***************************************