[12679] in Perl-Users-Digest
Perl-Users Digest, Issue: 88 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 9 09:10:41 1999
Date: Fri, 9 Jul 1999 06:05:09 -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 Fri, 9 Jul 1999 Volume: 9 Number: 88
Today's topics:
Re: [1] 988?? <nospam.newton@gmx.net>
connecting to a secure web server <ggabelma@mdsi.bc.ca>
Cookies won't work <debot@xs4all.nl>
Re: Correct syntax for NT drives <c4jgurney@my-deja.com>
Re: Correct syntax for NT drives (Andreas Fehr)
Re: Deleting everything after a pattern? (Bart Lateur)
Re: finding relative path between two files (Jenda Krynicky)
Re: ftp (Andreas Fehr)
Re: ftp <gellyfish@gellyfish.com>
Re: ftp <thomas@bibsyst.no>
Re: Has anyone thought of this before? (Jenda Krynicky)
Re: Help -- Weird Increments (MacPerl) (Jenda Krynicky)
Re: Help -- Weird Increments (MacPerl) (Bart Lateur)
Re: How can I disconnect an NT resource handle w/ Perl? (Jenda Krynicky)
Re: I need to hide the source (David Cantrell)
Re: I need to hide the source (David Cantrell)
Re: Microsoft Word -> TXT? <gj_at_work@my-deja.com>
Re: Microsoft Word -> TXT? <gj_at_work@my-deja.com>
Re: OLE & Excel <c4jgurney@my-deja.com>
Re: Perl Debugger recommendation sought (Jenda Krynicky)
Re: perlscript in IE <debot@xs4all.nl>
Re: Program for Easy Writing of Perl Code <gellyfish@gellyfish.com>
Re: Program for Easy Writing of Perl Code <tchrist@mox.perl.com>
Re: Reading who files into a variable.. <nospam.newton@gmx.net>
Signal handler to restart app wilda1@my-deja.com
Re: Telnet.pm module and logging output (or input)? <jbaird@idirect.com>
Re: Using perlcc to compile a perl prog <tchrist@mox.perl.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 09 Jul 1999 14:16:07 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: [1] 988??
Message-Id: <3785E807.6B252458@gmx.net>
Abigail wrote:
>
> @@ i don't know what is wrong....my command line execution looks like
> @@
> @@ ./email.pl?from=joe@aol.co&subject=test&text=this is a test
>
> So... you start up the program './email.pl?from=joe@aol.com', with any
> letter on the place of the ?, and you do that in the background. Then
> you start the program 'subject=test', also in the background. Next
> you start 'text=this', with 3 parameters 'is', 'a' and 'test'.
> I don't think you wanted to do that.
No; after starting the program './ema[etc.].com' in the background, he
gives the environment variable 'subject' the value 'test' (in the
background), and then starts the program 'is' with the two parameters
'a' and 'test', setting the environment variable 'text' to the value
'this' for the duration of the execution of program 'is'.
This is probably also not what he wants, though.
Cheers,
Philip
------------------------------
Date: Wed, 7 Jul 1999 16:58:54 -0700
From: "Greg Gabelmann" <ggabelma@mdsi.bc.ca>
Subject: connecting to a secure web server
Message-Id: <7m0pd5$noq$1@vannews.mdsi.bc.ca>
I'm using ActiveState Perl on win95 and am trying to connect to a secure web
server (financial web site). To do this I need the SSLeay perl module, but
ActiveState's server doesn't seem to have a copy ready for downloading. I
tried manually downloading it from CPAN, but the instructions are kind of
vague and I haven't been successful. Has anyone successfully installed the
SSLeay module on their win95 machine?
Thanks,
Greg.
ggabelma@mdsi.bc.ca
------------------------------
Date: Fri, 09 Jul 1999 14:26:11 +0200
From: Frank de Bot <debot@xs4all.nl>
Subject: Cookies won't work
Message-Id: <3785EA63.4276A833@xs4all.nl>
I'm trying for over 3 days to set cookies. But it never worked. I've
already used cgi.pm and CGI::Cookies . I've read very carefully the
description. Can anyone give me an examples that WILL work?
--
Contact Information:
\\\|///
\\ - - //
( @ @ )
----------------------oOOo-(_)-oOOo--------------------|
| General: |
| |
| EMAIL: debot@xs4all.nl |
|------------------------------------------------------|
| Penpal International |
| |
| URL: http://www.debot.nl/ppi/ or http://fly.to/ppi |
| EMAIL: debot@xs4all.nl or ppi@debot.nl |
-------------------------------Oooo---------------------
oooO ( )
( ) ) /
\ ( (_/
\_)
------------------------------
Date: Fri, 09 Jul 1999 11:04:24 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: Correct syntax for NT drives
Message-Id: <7m4kvl$7e3$1@nnrp1.deja.com>
In article <FEKJ4G.77J@news.boeing.com>,
"Jim Ray" <jim.ray@west.boeing.com> wrote:
> I have 2 servers, 1 has the Perl and IIS and the other is the data. I
am
> trying to grab a directory of the files on the data server, but am
having
> problems with the syntax.
>
> $filepath = "\\nt-delta-02\epmr\PMR-B\Program_Quality;
>
> Is what I am using with no luck. I have also used "//" and still no
luck.
> Can someone please direct me to the proper syntax for address NT
server
> mapping?
>
> Thank you.
>
> Jim
$filepath = "//nt-delta-02/epmr/PMR-B/Program_Quality/";
Should work, however I have been told that IIS can't access data from
other servers (I'm not sure if this is true). If IIS has to be logged on
as a user as services do then it might be a matter of making sure it has
access to the network (localsystem for example doesn't).
If you still have problems then re-post on
comp.infosystems.www.servers.ms-windows who should be better able to
help.
HTH
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 09 Jul 1999 11:21:48 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: Correct syntax for NT drives
Message-Id: <3785dab5.21432638@news.uniplus.ch>
On Thu, 8 Jul 1999 20:19:40 GMT, "Jim Ray" <jim.ray@west.boeing.com>
wrote:
>I have 2 servers, 1 has the Perl and IIS and the other is the data. I am
>trying to grab a directory of the files on the data server, but am having
>problems with the syntax.
>
> $filepath = "\\nt-delta-02\epmr\PMR-B\Program_Quality;
>
>Is what I am using with no luck. I have also used "//" and still no luck.
>Can someone please direct me to the proper syntax for address NT server
>mapping?
>
I'm not sure about that, but I think to remember that you
have to use \\\\ what is clear, but that you even have to
use //// for some reason. Saw it in the book of Dave Roth,
I think.
http://www.roth.net/
Andreas
------------------------------
Date: Fri, 09 Jul 1999 12:02:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Deleting everything after a pattern?
Message-Id: <3786e2c1.16967101@news.skynet.be>
Neko wrote:
>>s/$pattern.*?$//;
> ^
> typo
>
>Specifying a non-greedy quantifier will gain you nothing. A greedy
>quantifier cannot eat up past the end of a string, no matter how greedy it
>is.
>
> s/foo.*$//; # Say what you mean.
It's not because by default, Perl greedifies it's star/plus matches,
that unnecessarily making such matches non-greedy is a bad idea.
Actually, I expect
if(/a.*b/) { ... }
generally to be SLOWER than
if(/a.*?b/) { ... }
although I could be wrong. Well:
$_ = 'abcdefghibklm';
the non-greedy version will simply match "ab", while the greedy version
will match "abcdefghib". Seems far less efficient to me. I don't expect
a speed difference in your case.
Benchmark! Use the benchmark, Luke!
use Benchmark;
$text = 'abcdefghibklm';
timethese(10000, {
GREEDY => sub { $text =~ /a.*b/ },
FRUGAL => sub { $text =~ /a.*?b/ },
});
__END__
Benchmark: timing 10000 iterations of FRUGAL, GREEDY...
FRUGAL: 4 wallclock secs ( 4.40 usr + 0.00 sys = 4.40 CPU)
GREEDY: 5 wallclock secs ( 4.56 usr + 0.00 sys = 4.56 CPU)
Oh yeah. Tiny difference (less than 4%), but in the direction I
expected.
Bart.
------------------------------
Date: Fri, 09 Jul 1999 12:11:49 GMT
From: Jenda@McCann.cz (Jenda Krynicky)
Subject: Re: finding relative path between two files
Message-Id: <1103_931522309@prague_main>
I wrote:
> $$ Why
> $$ q q..q
> $$ instead of
> $$ '..'
> $$ ?
>
Abigail said:
> Why not?
Well why yes? Of course it means the same, but I think its much harder to read.
Keep in mind all those that did not know yet to q{}, qq{} ... operators.
For a newbie, even if he's a seasoned programmer in C or anything, your code is a strange mess.
It doesn't tell him anything. It's unnecessarily complex.
I think examples should be as simple as possible. Especialy if you are answering a question from a newbie. I
would understand the "=/==> ...", it's visualy appealing, but the "q q..q"? Why?
You'll scare people away ;-)
Jenda
P.S.: Don't take me too seriously :-)
------------------------------
Date: Fri, 09 Jul 1999 11:15:08 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: ftp
Message-Id: <3785d7e9.20716418@news.uniplus.ch>
On Fri, 09 Jul 1999 10:25:24 +0100, Ian Mortimer
<ianmorty@nortelnetworks.com> wrote:
>Hi all,
>
>Is it possible to run an ftp session using perl ?
>
>I want to send a file generated by my script to another machine on
>demand (like a backup system). There would be no need for user
>interaction - the machine name, filename, username and password all
>remain constant.
>
>Any ideas ?
>
I wrote some ftp client, but I hid the code somewhere and am not able
to get it back from Andrew ;)
Sorry, no help from me in this case. But what about reading the
documentation?
perlfaq8 and perlfaq9 may help. And LWP.
Andreas
------------------------------
Date: 9 Jul 1999 12:46:41 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: ftp
Message-Id: <3785e121@newsread3.dircon.co.uk>
Ian Mortimer <ianmorty@nortelnetworks.com> wrote:
> Hi all,
>
> Is it possible to run an ftp session using perl ?
>
Net::FTP available from CPAN
/J\
--
"The teenage masturbators of today are the television executives of
tomorrow" - Melissa Cabriolet, Drop the Dead Donkey
------------------------------
Date: Fri, 09 Jul 1999 14:11:51 +0200
From: Thomas Weholt <thomas@bibsyst.no>
Subject: Re: ftp
Message-Id: <3785E707.F9F412E9@bibsyst.no>
Yo,
I looked at the CPAN-module and also at some examples in the Perl
CookBook. It seems as if simlpe things like just put or get is easy to
implement, but I haven`t seen any examples doing more than that. I`d
like to get the results of ls, pipe it to a file and process the
contents.
Any thoughts?
Thomas.
Ian Mortimer wrote:
> Hi all,
>
> Is it possible to run an ftp session using perl ?
>
> I want to send a file generated by my script to another machine on
> demand (like a backup system). There would be no need for user
> interaction - the machine name, filename, username and password all
> remain constant.
>
> Any ideas ?
>
> Ian.
--
-------------------------------------------------
| Thomas Weholt |_.|._| |
| Email : thomas@bibsyst.no <-|-> |
-------------------------------------------------
------------------------------
Date: Fri, 09 Jul 1999 12:15:55 GMT
From: Jenda@McCann.cz (Jenda Krynicky)
Subject: Re: Has anyone thought of this before?
Message-Id: <1104_931522555@prague_main>
On Thu, 8 Jul 1999 20:06:40 -0500, "John M. Dlugosz" <john@dlugosz.com> wrote:
> Consider case of wanting to interpolate a function. Given something like
>
> "the result is " . prettyup ($x) . ", or so\n"
>
> we know it can be written using the reference trick:
>
> "the result is ${\prettyup($x)}, or so\n"
>
> But how about using a tie to a hash and putting the functionality into the
> FETCH method, so you can simply say,
>
> "the result is $prettyup{$x}, or so\n"
>
use Interpolation prettyup => \&prettyup;
See http://www.plover.com/~mjd/perl/Interpolation/
Jenda
http://jenda.krynicky.cz
------------------------------
Date: Fri, 09 Jul 1999 12:18:26 GMT
From: Jenda@McCann.cz (Jenda Krynicky)
Subject: Re: Help -- Weird Increments (MacPerl)
Message-Id: <1105_931522706@prague_main>
On Thu, 08 Jul 1999 12:01:49 GMT, pudge@pobox.com (Chris Nandor) wrote:
> In article <1108_931433591@prague_main>, Jenda@McCann.cz (Jenda Krynicky) wrote:
>
> # There is another thing, I do not see any locking.
>
> This is MacPerl, the poster said.
>
> flock() is unimplemented in MacPerl.
I've never used MacPerl so I did not know this.
Sorry, Jenda
http://Jenda.Krynicky.cz
------------------------------
Date: Fri, 09 Jul 1999 12:07:04 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Help -- Weird Increments (MacPerl)
Message-Id: <3787e567.17644271@news.skynet.be>
Jenda Krynicky wrote:
>> flock() is unimplemented in MacPerl.
>
>I've never used MacPerl so I did not know this.
Did you know that if the file is opened for writing by another program,
that the open() will fail?
MacPerl scripts are currently sequentialized, so if only MacPerl scripts
touch this file, there's no problem. But if there ever will be an update
so that multiple scripts can try to access a file at the same time, this
will be a problem.
Bart.
------------------------------
Date: Fri, 09 Jul 1999 12:25:56 GMT
From: Jenda@McCann.cz (Jenda Krynicky)
Subject: Re: How can I disconnect an NT resource handle w/ Perl?
Message-Id: <1106_931523156@prague_main>
On Thu, 8 Jul 1999 18:25:12 -0600, "Sean Montgomery" <smontgomery@digitialblaze.net> wrote:
> I have an application where I am using Perl to copy files from a source
> server to several remote servers on a weekly basis. Sometimes, a file
> doesn't copy successfully because the file on the remote computer is in use.
> If that happens I'd like for my Perl script to close the open filehandle on
> that
> remote server and attempt the copy again.
It seems to be possible with Win32::Lanman.
You may install it via PPM from http://jenda.krynicky.cz/perl/
The sources should ba available in here ftp://ftp.roth.net/pub/ntperl/Others/Lanman/
or from the author jens.helberg@bosch.com
Jenda
http://Jenda.Krynicky.cz
------------------------------
Date: Fri, 09 Jul 1999 11:08:31 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: I need to hide the source
Message-Id: <3785d634.6972666@news.insnet.net>
On Thu, 8 Jul 1999 11:41:33 -0700, "Jürgen Exner"
<juex@my-dejanews.com> said:
>Abigail <abigail@delanet.com> wrote in message
>news:slrn7o7lb6.ued.abigail@alexandra.delanet.com...
>> rdosser@my-deja.com (rdosser@my-deja.com) wrote on MMCXXXVI September
>> MCMXCIII in <URL:news:7m09vd$m44$1@nnrp1.deja.com>:
>> ``
>> `` I should have explained more: I'm trying to conceal a decryption
>> `` algorithm for confidential data.
>>
>> And you don't trust root? Buhahhahhahahhahaa. That's stupid.
>> Find a root who you can trust.
>
>Although I have to aggree that security by obsfucation is not the right way
>to go, still the administrator of e.g. a hospital network has no business
>reading my medical records.
True, they have no business doing that, but you just have to trust
them not to, just like I am trusted not to change the prices in our
customers' databases no matter however badly I want that cheap CD
burner.
>So not trusting root for confidential data is a very valid case.
No it isn't. You must remember that anyone who has the root password
is more powerful than God, and can take copies of your badly-encrypted
data for decoding at their leisure. Anyway, you can't conceal a
decryption algorithm - the decryption code has to be in plaintext for
the computer to execute it. If the code for doing the decryption is
itself encrypted, then there has to be some 'plaintext' code to
decrypt _that_, and so on.
If you're interested in security, why not use a well-known, published,
peer-reviewed encryption scheme such as PGP or Blowfish? I'd be
willing to bet the contents of my whisky cabinet that even with
publicly available sourcecode they would be more secure than anything
you can create yourself.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 09 Jul 1999 11:13:54 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: I need to hide the source
Message-Id: <3786d880.7560200@news.insnet.net>
On Thu, 08 Jul 1999 15:28:53 GMT, rdosser@my-deja.com said:
> The people who own/administer the host are the ones
>we want to protect the data from, if you can believe that, so my private
>key would not be very private.
So use a well-known public key whatsit like PGP.
> They're also not very smart/determined,
>so obscurity may actually work
I wouldn't trust to confidential data to something which _may_ work
(but _may_ not). There's nothing to stop them hiring a black-hat-
toting consultant.
> - at any rate, it seems like the only
>option I've got given the circs.
Is there any silly suit-imposed reason you can't use public key
encryption? If there is, resign immediately cos they're not letting
you do your job :-)
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Fri, 09 Jul 1999 12:50:00 GMT
From: GJ <gj_at_work@my-deja.com>
Subject: Re: Microsoft Word -> TXT?
Message-Id: <7m4r5k$9dk$1@nnrp1.deja.com>
I am looking for a perl script to do the job becuase I would like
to run it on my webserver and send the script the location of the Word
document and then display it as a HTML page.
-GJ
In article <ybdh3.117$J84.7937@nsw.nnrp.telstra.net>,
mgjv@comdyn.com.au (Martien Verbruggen) wrote:
> In article <7m358l$nqu$1@nnrp1.deja.com>,
> GJ <gj_at_work@my-deja.com> writes:
>
> > Is there anyway to open a Microsoft Word document in a perl
script
> > and be able to get out just the text
>
> Yep. You don't even need a perl script.
> http://www.gnu.org/
> Look for CatDoc. There are other tools around to do this.
>
> > (and possibly the formating) so
>
> If you want formatting, a plain text file will not be the right
> intermediate.
>
> > that it can be formated into HTML?
>
> Word is supposed to be able to save HTML, isn't it?
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | If it isn't broken, it doesn't
have
> Commercial Dynamics Pty. Ltd. | enough features yet.
> NSW, Australia |
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 09 Jul 1999 12:50:24 GMT
From: GJ <gj_at_work@my-deja.com>
Subject: Re: Microsoft Word -> TXT?
Message-Id: <7m4r6c$9f2$1@nnrp1.deja.com>
I am looking for a perl script to do the job becuase I would like
to run it on my webserver and send the script the location of the Word
document and then display it as a HTML page.
-GJ
In article <ybdh3.117$J84.7937@nsw.nnrp.telstra.net>,
mgjv@comdyn.com.au (Martien Verbruggen) wrote:
> In article <7m358l$nqu$1@nnrp1.deja.com>,
> GJ <gj_at_work@my-deja.com> writes:
>
> > Is there anyway to open a Microsoft Word document in a perl
script
> > and be able to get out just the text
>
> Yep. You don't even need a perl script.
> http://www.gnu.org/
> Look for CatDoc. There are other tools around to do this.
>
> > (and possibly the formating) so
>
> If you want formatting, a plain text file will not be the right
> intermediate.
>
> > that it can be formated into HTML?
>
> Word is supposed to be able to save HTML, isn't it?
>
> Martien
> --
> Martien Verbruggen |
> Interactive Media Division | If it isn't broken, it doesn't
have
> Commercial Dynamics Pty. Ltd. | enough features yet.
> NSW, Australia |
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 09 Jul 1999 10:55:05 GMT
From: Jeremy Gurney <c4jgurney@my-deja.com>
Subject: Re: OLE & Excel
Message-Id: <7m4ke7$7at$1@nnrp1.deja.com>
In article <7m3ivc$soi$1@nnrp1.deja.com>,
hemant_gandhi@my-deja.com wrote:
> Hi all,
> I am processing excel file thru a perl program. reading the excel file
> and loading it in the database. can any one tell me how to find out
the
> number of sheets in the excel file ?
>
> Thanks,
> Hemant.
I don't know the syntax for win32::OLE but in VB it would be
ActiveWorkbook.Sheets.Count
($count = ActiveWorkbook->Sheets->{Value}; ?)
HTH
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 09 Jul 1999 13:08:26 GMT
From: Jenda@McCann.cz (Jenda Krynicky)
Subject: Re: Perl Debugger recommendation sought
Message-Id: <1107_931525706@prague_main>
On Thu, 08 Jul 1999 18:09:16 +1000, Kevin Powe <kevinp@COMPANY.com> wrote:
> 'lo all.
>
> I'm looking for a debugger for messing with Perl currently, and I was
> wondering if someone could recommend something for the PC.
I'm using ptkdb from http://world.std.com/~aep/ptkdb/
Jenda
http://Jenda.Krynicky.cz
------------------------------
Date: Fri, 09 Jul 1999 14:30:31 +0200
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: perlscript in IE
Message-Id: <3785EB66.CA31FA77@xs4all.nl>
If you want to run a perlscript in a browser, this is THE answer. Without any http
server it just won't work for now!
Jonathan Stowe wrote:
> Frank de Bot <debot@xs4all.nl> wrote:
> > Jonathan Stowe wrote:
> >
> >> On Tue, 06 Jul 1999 10:38:00 -0800 Ashish Kadakia wrote:
> >> > Hi,
> >> > Anyone knows how I can view cleint side Perlscript in IE.
> >> > I downloaded some example, but cannot view in the browser.
> >> > It doesn't display anything.. Do I need sometype of dlls?
> >> >
> >>
> >> You need to download and install Activeperl <http://www.activestate.com>
> >> and answer yes if it asks you about it ...
> >>
> >
> > Download a http server. http://www.apache.org/
> > You will be able to execute scripts in your browser. Further instructions include
> > at the website.
> >
>
> That doesnt answer his question and is off-topic anyhow.
>
> /J\
> --
> "I want to be like Oprah" - Sarah, Duchess of York
--
Contact Information:
\\\|///
\\ - - //
( @ @ )
----------------------oOOo-(_)-oOOo--------------------|
| General: |
| |
| EMAIL: debot@xs4all.nl |
|------------------------------------------------------|
| Penpal International |
| |
| URL: http://www.debot.nl/ppi/ or http://fly.to/ppi |
| EMAIL: debot@xs4all.nl or ppi@debot.nl |
-------------------------------Oooo---------------------
oooO ( )
( ) ) /
\ ( (_/
\_)
------------------------------
Date: 9 Jul 1999 12:08:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Program for Easy Writing of Perl Code
Message-Id: <3785d826@newsread3.dircon.co.uk>
Francisco Romero <fromero@csudh.edu> wrote:
> Does anyone know if there is an application that will help you write
> perl code with ease!
>
You mean like:
#!/usr/bin/perl -w
$file = $ARGV[0] || 'newscript';
open(PROG,">$file") || die "Cant open $file - $!\n";
print <<EOSCRIPT;
#!/usr/bin/perl -w
use strict;
EOSCRIPT
close PROG;
system("/usr/bin/vi $file");
/J\
--
"Most big companies don't like you very much, except hotels, airlines
and Microsoft, which don't like you at all" - Bill Bryson
------------------------------
Date: 9 Jul 1999 06:02:04 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Program for Easy Writing of Perl Code
Message-Id: <3785e4bc@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, Francisco Romero <fromero@csudh.edu> writes:
:Does anyone know if there is an application that will help you write
:perl code with ease!
vi
--
f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.
------------------------------
Date: Fri, 09 Jul 1999 14:18:33 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: Reading who files into a variable..
Message-Id: <3785E899.8D0CDEE4@gmx.net>
Tom Christiansen wrote:
>
> How can I read in an entire file all at once?
Wrong part of the docs. He wanted to eval the contents of the file
(which is a Perl script). You should have sent him perlfunc and quoted
the "do" and/or "require" bits.
Cheers,
Philip
------------------------------
Date: Fri, 09 Jul 1999 11:15:25 GMT
From: wilda1@my-deja.com
Subject: Signal handler to restart app
Message-Id: <7m4lk8$7l1$1@nnrp1.deja.com>
I installed a signal handler in my program to catch the HUP signal so
that it would restart itself. The first time I send the HUP signal to
process it restarts itself fine. But, when I then try and send a HUP
signal to the restarted program it appears to ignore the signal!
My code goes something like this :
Program: daemon.pl
#!/usr/local/bin/perl
$SIG{HUP} = \&restart;
use POSIX qw(setsid);
# Completely disassociate itself
close STDIN;
close STDOUT;
open STDERR, ">/dev/null";
fork() && exit(); # fork
setsid(); # detach
<snip - program code>
# Signal handler to restart another version then die
sub restart {
system("./daemon.pl");
die;
}
Does anyone have any idea why the HUP signal is being ignored in the
restarted program?
Thanks, Andrew.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 09 Jul 1999 08:55:08 -0400
From: John Baird <jbaird@idirect.com>
Subject: Re: Telnet.pm module and logging output (or input)?
Message-Id: <3785F12C.E5AE96E@idirect.com>
Hi Jim,
I have recently run into this problem myself, and the issue is the
schizophrenic behaviour of STDOUT. It basically block buffers data writes
what is in the buffers when ever it feels it it.... the following chunk of
code will resolve this problem:
;# Usage: &flush(FILEHANDLE)
;# flushes the named filehandle
;# Usage: &printflush(FILEHANDLE, "prompt: ")
;# prints arguments and flushes filehandle
sub flush {
local($old) = select(shift);
$| = 1;
print "";
$| = 0;
select($old);
}
sub printflush {
local($old) = select(shift);
$| = 1;
print @_;
$| = 0;
select($old);
}
1;
BTW this is not my code I found it at CPAN.
regards,
John Baird
Jim Matzdorff wrote:
> I am having some problems with using the Telnet.pm library, and am
> hoping someone can help me out.
>
> I am opening two different telnet connection. I want to log I/O for
> both connection simultaneously (using either
> "$session->input_log($filename) or when I set up the initial telnet
> session).
>
> But for some reason, only one of the telnet log files writes to the
> log file as it receives the data, the other one waits until the
> program is done running and then dumps ALL I/O it has come across
> at once into it's logfile.
>
> Can anyone tell me what the difference is, and if it's correctable. I
> am at a loss for ideas...
>
> Thanks,
> --jim
> --
> --
> If life is a waste of time, and time is a waste of life,
> then let's all get wasted together and have the time of our lives.
------------------------------
Date: 9 Jul 1999 05:57:15 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Using perlcc to compile a perl prog
Message-Id: <3785e39b@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
richardwchin@my-deja.com writes:
:I want to create a single executable rather
:than a script that some users might be tempted to edit.
"tempted"? And what's your problem with that?
--tom
--
WANTED: Dead or Alive -- Schrodeinger's Cat
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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.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 V9 Issue 88
************************************