[7907] in Perl-Users-Digest
Perl-Users Digest, Issue: 1532 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 24 13:08:06 1997
Date: Wed, 24 Dec 97 10:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 24 Dec 1997 Volume: 8 Number: 1532
Today's topics:
Re: Access Denied Problem running script on NT4 (Jim Michael)
Re: Access Denied Problem running script on NT4 <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Access Forbidden??? (Neil Briscoe)
Annoying rounding problem... (Nihon)
Re: Annoying rounding problem... (Mike Stok)
Re: Are locals automatically initialized ? <jdporter@min.net>
Re: awk to perl (Tad McClellan)
Re: Beginner question regarding single-quoted strings (Mike Stok)
Re: book on perl (Tad McClellan)
Re: calling two arrays in a function as variables <david.x.corcoran@boeing.com>
client server encription decryption <mehta@mama.indstate.edu>
Re: Dynamic array names <nygsi@ny.ubs.com>
Re: Error using backticks with "ps" system command <adavid@netinfo.com.au>
Re: help newbie at wit's end (almost) ushere@ibm.net
Help. Checking file sizes in perl5 mat.r@ukonline.co.uk
Newbie Question about Ctrl-D (Don)
Re: Newbie Question about Ctrl-D (Jim Michael)
Re: Newbie Question about Ctrl-D (Mike Heins)
Re: next == continue?? (Tad McClellan)
Oh! Pascal! (was Re: Teaching programing) <jdporter@min.net>
Re: Opening a telnet process as a filehandle? (Jeremy D. Zawodny)
Re: Perl Dbase Access (Clay Irving)
PERL Memory Problems <scover@sportscover.com>
Re: PERL Memory Problems (Mike Stok)
Re: Starting a Daemon in a CGI script <real@earthling.net>
Re: Starting a Daemon in a CGI script charlot@SPAM-FREE.org
Re: Starting a Daemon in a CGI script (Andrew M. Langmead)
Re: Teen Perl Programmers Mailing List twod@not.valid
Win32 problem with ISAPI (PERLISS.DLL ) apps not workin pxharding_remove_this_bit_@_remove_this_bit_compuserve.com
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 24 Dec 1997 12:56:59 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Access Denied Problem running script on NT4
Message-Id: <genepoolELp2n0.JF6@netcom.com>
Myles Lawrence (myleslawrence@email.msn.com) wrote:
: I've got one for you. I've got a script that executes the copy command on an
: NT4 server using IIS to copy a file from one pc to another. If I remotely
: key in and execute the copy command by typing \\server\copy
: \\machineA\fileA \\machineB\fileB, everything works fine. But If I try to
: run this command from a script I get an access denied message because the
: script doesn't seen to have access to the network computers. Any ideas?
Are you doubling up on the backslashes in your script?
\\\\machineA\\fileA, etc. Post an example of the offending code.
Cheers,
Jim
------------------------------
Date: Wed, 24 Dec 1997 07:28:07 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Access Denied Problem running script on NT4
Message-Id: <67r9km$q6n@mtinsc05.worldnet.att.net>
You may have hit the nail on the head. Does the login ID the script's
running under have permission to access the server in question?
To duplicate problems like this under NT you have to do your test using the
exact conditions under which the problem occurs. Without knowing more that
the situation that's the best advice I can give you. Good luck!
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Myles Lawrence wrote in message <#TE5MGCE9GA.216@upnetnews03>...
>I've got one for you. I've got a script that executes the copy command on
an
>NT4 server using IIS to copy a file from one pc to another. If I remotely
>key in and execute the copy command by typing \\server\copy
>\\machineA\fileA \\machineB\fileB, everything works fine. But If I try to
>run this command from a script I get an access denied message because the
>script doesn't seen to have access to the network computers. Any ideas?
>Myles
>myleslawrence@msn.com
>
>
------------------------------
Date: 24 Dec 1997 17:38:59 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: Access Forbidden???
Message-Id: <memo.19971224173859.34393A@skep.compulink.co.uk.cix.co.uk>
In article <34A03BC0.760DD568@flash.net>, kbsitz@flash.net (K B Sitz)
wrote:
> Got this:
>
> HTTP/1.0 403 Access Forbidden (Execute Access
> Denied - This Virtual Directory does not allow objects
> to be executed.)
>
> Can anyone help?
>
Since you posted this in a perl group, I assume you received this in
response to an attempt to run a perl script, that might be located in your
local web space directory.
The error seems pretty explicit, executables are not permitted to run from
there. Either you, or the Administrator of the server in question must
either arrange for executables to run from that directory, or you must
move your script to the cgi-bin directory for that server.
You'll get much more helpful answers in an appropriate web/cgi newsgroup.
Regards
Neil
------------------------------
Date: Wed, 24 Dec 1997 17:26:24 GMT
From: Xnihon@Yjapan-mail.Zcom (Nihon)
Subject: Annoying rounding problem...
Message-Id: <34a4457f.2968412@news.itsnet.com>
In writing the script for an online store, I've run into this problem. Here's the variable:
$Tax = ($Subtotal * 0.06125)
If $Subtotal is 100, then the resulting tax is $6.125. How do I round
that UP to $6.13 in perl so their total is $106.13, NOT $106.125?
Thanks for your help!
To reply to this posting, remove the X, Y, and Z from my address.
Want to contact me? http://users.itsnet.com/~nihon/contact.html
----------------/----------------/----------------/----------------\
Avoid Microsoft like the plague? They ARE the plague!
------------------------------
Date: 24 Dec 1997 12:43:14 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Annoying rounding problem...
Message-Id: <67rhji$18m$1@stok.co.uk>
In article <34a4457f.2968412@news.itsnet.com>,
Nihon <Xnihon@Yjapan-mail.Zcom> wrote:
>In writing the script for an online store, I've run into this problem. Here's the variable:
>
>$Tax = ($Subtotal * 0.06125)
>
>
>If $Subtotal is 100, then the resulting tax is $6.125. How do I round
>that UP to $6.13 in perl so their total is $106.13, NOT $106.125?
There's an answer in section 4 of the FAQ which contains a comment about
the use of rounding in financial applications, but cutting to the chase
you may find
$Tax = sprintf '%.2f', $Subtotal * 0.06125;
OK for your use - though this rounds 6.125 to 6.12 so you might want to
add 0.005 to force the issue.
The FAQ (frequently asked questions list) can be found in any recent perl
distribution or by browsing http://www.perl.com.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Tue, 23 Dec 1997 08:21:10 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Are locals automatically initialized ?
Message-Id: <349FBAC6.6ED6@min.net>
Come on, Tad, you of all people know that the real answer is RTFM.
q(If no initializer is given, all scalars are initialized
to the undefined value and all hashes and arrays to empty.)
John Porter
jporter@logicon.com
Tad McClellan wrote:
>
> Kilrogg2_GS (kilrogg2@mindless.com) wrote:
>
> : I wonder if parmeters declared "local"
> : in a function are initialized to a default
> : value by the compiler ?
>
> : sub foo { local($var); }
>
> Write a script and find out.
>
> ---------------------
> #!/usr/bin/perl -w
>
> &foo;
>
> sub foo {
> local($var);
> print "$var\n";
> }
> ---------------------
>
> outputs:
> ---------------------
> Use of uninitialized value at ./foo.pl line 6.
>
> ---------------------
>
> So, my guess is that they are not initialized ;-)
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Wed, 24 Dec 1997 08:02:32 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: awk to perl
Message-Id: <ol4r76.0j.ln@localhost>
: On Fri, 5 Dec 1997 17:25:37 +0000, Tim Pagden <tim@doulos.co.uk>
: wrote:
: >I've tried search engines, browsing (and text-searching) the key Web
: >pages (anything linked to from www.perl.com) and the FAQs - just about
: >everything in fact -
^^^^^^^^^^
Your good 'net citizenship is appreciated by the newsgroup.
Thanks for looking before you leap.
Your list above are the 2nd-4th places to check though.
The first being the POD files that are shipped with the perl distribution.
: > but can I find the ftp site or URL for downloading
: >the awk2perl utility? Nope.
Subject: awk to perl
^^^^^^^^^^^
grep 'awk to perl' *.pod
perl.pod: a2p awk to perl translator
;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 24 Dec 1997 15:05:56 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Beginner question regarding single-quoted strings
Message-Id: <slrn6a29bs.d7.mike@stok.co.uk>
On 24 Dec 97 02:27:27 GMT, Devin Ganger <devin@premier1.net> wrote:
>In the examples given for single-quoted strings, we have the following
>text and examples:
>
> ...Two exceptions: to get a single quote into a single-quoted string,
> precede it by a backslash. And to get a backslash into a single-
> quoted string, precede the backslash by a backslash...
>
> 'silly\\me' # silly, followed by backslash, followed by me
> 'hello\n' # hello followed by backslash followed by n
>
>Perhaps I'm missing some subtle nuance here, but wouldn't 'silly\me' and
>'silly\\me' do the exact same thing in this case?
>
>What am I missing?
Probably nothing. In a string quoted with '' the only characters which
"consume" a backslash to escape them are \ and ' When the character after
the backslash isn't special then the backslash isn't used up in a single
quoted string - compare this to double quoted strings which do "consume"
backslashes which are part of unrecognised sequences e.g.
DB<1> print 'silly\me'
silly\me
DB<2> print "silly\me"
sillyme
so it's safe to use \\ to make make sure a \ gets output, otherwise you
have to be careful of the type of quoting (of course, being aware of what
type of context you're in makes perl easier to use...)
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Wed, 24 Dec 1997 07:55:38 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: book on perl
Message-Id: <q84r76.0i.ln@localhost>
Kuntal M. Daftary (daftary@cisco.com) wrote:
: i have "programming perl" book which describes perl 4. so is there a "bible" on
: perl 5 like "programming perl" ?
Yes there is.
It is the _second_ edition of "Programming Perl" ;-)
(It is blue instead of pink, and says "Covers Perl 5" on the cover)
: basically i would like to get familiar with the new features in perl 5 like
: extended regexes and the new commands and OOPs.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 24 Dec 1997 16:21:21 GMT
From: David Corcoran <david.x.corcoran@boeing.com>
Subject: Re: calling two arrays in a function as variables
Message-Id: <34A13681.422D@boeing.com>
: Aragorn <mbijlsma.nospam@xs4all.nl> writes:
: > Hi,
: > I've got a problem calling two lists or arrays into a function.
When I
: > call them inside the function using (@foo, %bar) = @_; perl tends
to
: > assign all elements - both arrays - to the first one, leaving the
second
: [...]
: > won't work.
: > Is there any special syntax forcing perl to keep the two devided,
any
: > trick to get the arrays back in line, just.. anything that will
work? :)
You may want to try this:
----------------------------------8<-------------------------------------------
@x=(one,two,three);
@y=(red,green,blue);
foo(\@x,\@y);
sub foo
{
for $i (@{$_[0]}) {
print "first $i\n";
}
for $i (@{$_[1]}) {
print "second $i\n";
}
}
----------------------------------8<-------------------------------------------
Note:
I don't know if the syntax:
@{$_[0]}
is a hard or soft reference (I haven't dealt with references enough)
if it is a soft reference then you can't use the 'strict' pragma as
perl forbids it.
--@@
~
DavidC
------------------------------
Date: Wed, 24 Dec 1997 05:15:24 GMT
From: Miten S Mehta <mehta@mama.indstate.edu>
Subject: client server encription decryption
Message-Id: <Pine.LNX.3.96.971224001301.31586A-100000@mama.indstate.edu>
12/24/97
Hello,
I want to use a some encryption decryption scheme between client and
server. The client is java applet and server side is perl cgi. Besides
how do I have the perl cgi drop cookies as the applet communicates via
post with urlconnection object?
-miten
------------------------------
Date: Wed, 24 Dec 1997 12:10:03 -0500
From: Ian Goldstein <nygsi@ny.ubs.com>
Subject: Re: Dynamic array names
Message-Id: <34A141EB.83E101D4@ny.ubs.com>
I am still trying to get my arms around this perl thing,
but try something like this: This will read the contents
of a subdirectory and store the info in an array whose name
is the directory.
hth
#!/usr/local/bin/perl
@directory=`find * -type d -prune -print`;
foreach $dir (@directory){
chop $dir;
opendir(DIR,"$dir");
@subdir = readdir(DIR);
closedir(DIR);
$num=@subdir;
$index{$dir} = $num - 2;
eval "\@${dir} = \@subdir";
}
Corey Leighton wrote:
>
> Anyone have any suggestions on how I can dynamically name arrays? I
> want to do something like this:
>
> open (DIR,"<SOMEPATH>");
> @dir = readdir(DIR):
> closedir(DIR);
>
> foreach $file (dirs){
> @$file = <some stuff>
> ...
> ... some more stuff
> }
>
> I want to create an array named by each of the files in the <SOMEPATH>.
> the files in the array change so I need something dynamic.
>
> --
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
> Corey Leighton cleighto@*ctron.com
> Cabletron Systems, Inc. ext. 5510
> \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
--
Ian
======================================================================
Ian Goldstein | E-Mail nnygsi@ny.ubs.com
Enterprise Systems Management |
On assignment at Union Bank of Switzerland |
======================================================================
------------------------------
Date: Wed, 24 Dec 1997 19:34:53 +1100
From: Anthony David <adavid@netinfo.com.au>
To: Brett Denner <Brett.W.Denner@lmco.com>
Subject: Re: Error using backticks with "ps" system command
Message-Id: <34A0C92D.BCED5C66@netinfo.com.au>
Brett Denner wrote:
> I have a Perl script that starts up a binary executable file and forks a
> separate Perl process to monitor the total cpu time used.
>
> My forked processes obtains the group id using getpgrp:
>
>
> while(1) {
> chomp(@times = `ps -g$pgrp -o time=`);
>
I am not familiar with the above -o option (It doesn't look like Solaris and
I'msure it's not Linux nor AIX). All I can say is that the process seems to run in
a
reasonably tight loop, chewing up a lot of CPU time itself.
Sorry I don't have a definitive answer. I suspect chomp is not
chomping all the \013 chars you want to get rid of (there is one for
each process in the group (ie array element).
Regards and have a significant Christmas.
--
Anthony David | Opinions expressed ARE
Anthony David & Associates | those of my employer
------------------------------
Date: Wed, 24 Dec 1997 03:58:52 -0500
From: ushere@ibm.net
Subject: Re: help newbie at wit's end (almost)
Message-Id: <34A0CECC.2D69@ibm.net>
ushere@ibm.net wrote:
> ---------------------------------------
> entering the URL: http://127.0.0.1/test.htm
> gives: [an error occurred while processing this directive]
> httpd.error_log says:
> -exec of /usr/local/httpd/cgi-bin/test.pl failed, errno is 2
> -access to /usr/local/httpd/cgi-bin/test.pl failed for localhost,
> reason: Premature end of script headers
------------------------------------------------
Anyone know of a good place to hide?
This is a replacement for the first message I posted in a hurry as
soon as I found the cause. Here's the lesson learned, touching on
Perl while being mostly Linux related:
I went looking to check the perms and integrity of my perl.exe
under /usr/bin, EVEN THOUGH perl was working fine, as was almost
everything else. So, I mistyped /root/usr/bin instead {which I NEVER
do BTW} and of course found nothing there at all. But seeing all this
nothingness rang a bell and I remembered having had to also link to
/usr/local/bin because that's where my ISP wants them to point. I
didn't want the alternative of having to change my scripts just before
uploading each time.
But entering /usr/local/bin I found nothing again, thinking I was under
/root once more, though this time there was no error message about
there being no such directory. THAT's how I found out what it was that
had never taken place after the last brand new reinstall. The link that
had been there all this time had been there only in my mind ever
since.
10 seconds took care of the whole problem.
I got LOTSA concerned and sympathetic e-mail, perhaps many others
also remembered such episodes in their own struggles, the kind when
nothing seems to be making any sense. My SINCEREST thanks go to
everyone.
Maybe the Linux producers will consider routinely linking this way
during installation if only to cut down on help calls in view of this
being the type of trap that many might never admit having stepped
into. I did see hundreds of similar problems on DejaNews with all
kinds of really heavy troubleshooting for causes {except this very
simple one}. Maybe this post will surface in some other "newbie's"
search in turn.
And why I would have entered /root when I never do that, and
why would I imediately thereupon have had the impression (really)
that some one or some thing had just made me do so... well, spelling
that all out just wouldn't be poetic now would it?
cheers to one and all, and may this be as real a Christmas story
as it seems small.
-|- Who, has loved us more? -|-
------------------------------------------------------
------------------------------
Date: 24 Dec 1997 15:15:50 GMT
From: mat.r@ukonline.co.uk
Subject: Help. Checking file sizes in perl5
Message-Id: <67r8v6$d24$1@morse.news.easynet.net>
I am desperately trying to write a piece of code that checks a files size and returns the path if it exceeds a set limit. Most of the code is in place, I just can't seem to get the code that checks the files size to work. If anyone has a bit of code that does this, I would appreciate a copy of it, so I can modify it to suit my needs.
There is a listing in the perl 5 book I'm using, but that refuses to work, so I am right in it.
The script will be running on a Unix system.
Thanks in advance for any help
Mat.
------------------------------
Date: Wed, 24 Dec 1997 06:16:07 GMT
From: dongood@ibm.net (Don)
Subject: Newbie Question about Ctrl-D
Message-Id: <34a1a76f.5140210@news3.ibm.net>
Just started learning PERL. I have gotten to the point where I am
reading in array elements and am told in my book that Ctrl-D will send
"end of file" to the perl interpreter.
This doesn't seem to be the case with my version/machine. 32 bit PERL
for Win 95.
Thank-you in advance,
Don
------------------------------
Date: Wed, 24 Dec 1997 13:00:07 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Newbie Question about Ctrl-D
Message-Id: <genepoolELp2s7.Jqu@netcom.com>
Don (dongood@ibm.net) wrote:
: Just started learning PERL. I have gotten to the point where I am
: reading in array elements and am told in my book that Ctrl-D will send
: "end of file" to the perl interpreter.
: This doesn't seem to be the case with my version/machine. 32 bit PERL
: for Win 95.
Try Ctl-Z.
Cheers,
Jim
------------------------------
Date: 24 Dec 97 08:16:11 GMT
From: nospam@minivend.com (Mike Heins)
Subject: Re: Newbie Question about Ctrl-D
Message-Id: <34a0c4cb.0@news.one.net>
Don <dongood@ibm.net> wrote:
> Just started learning PERL. I have gotten to the point where I am
> reading in array elements and am told in my book that Ctrl-D will send
> "end of file" to the perl interpreter.
> This doesn't seem to be the case with my version/machine. 32 bit PERL
> for Win 95.
Try Ctrl-Z and return instead.
You might also want to go to www.perl.com and look at all of the
FAQ lists there -- they are wonderful reading for newcomers to Perl.
If this is your first post to the group, you probably already
have an email message giving more pointers.
Good luck with Perl!
Regards,
Mike Heins http://www.minivend.com/ ___
Internet Robotics |_ _|____
Just because something is 131 Willow Lane, Floor 2 | || _ \
obviously happening doesn't Oxford, OH 45056 | || |_) |
mean something obvious is <mikeh@minivend.com> |___| _ <
happening. --Larry Wall 513.523.7621 FAX 7501 |_| \_\
------------------------------
Date: Tue, 23 Dec 1997 23:42:59 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: next == continue??
Message-Id: <3d7q76.b05.ln@localhost>
Steve Evans (sassee@unx.sas.com) wrote:
: I have a good background in C and ksh, and am
: just starting to learn perl. I like that it
: looks so much like C, but find it annoying that
: some key words are different.
It _is_ a different language, after all.
: And another thing,
: all the books mention "there is no switch statement,
: but you can easily write one with if-else". Why!?
: It's a useful construct, what's the problem adding it??
Even this philosophical type of question is answered by the
docs that come with the perl distribution.
from the Perl FAQ, part 7
--------------------------
=head2 How do I create a switch or case statement?
This is explained in more depth in the L<perlsyn>. Briefly, there's
no official case statement, because of the variety of tests possible
in Perl (numeric comparison, string comparison, glob comparison,
regexp matching, overloaded comparisons, ...). Larry couldn't decide
how best to do this, so he left it out, even though it's been on the
wish list since perl1.
...
--------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 23 Dec 1997 16:15:27 -0500
From: John Porter <jdporter@min.net>
Subject: Oh! Pascal! (was Re: Teaching programing)
Message-Id: <34A029EF.3FEE@min.net>
Tad McClellan wrote:
>
> Chris Winters (cwinters@clark.net) wrote:
> : Jacqui Caren <Jacqui.Caren@ig.co.uk> wrote:
>
> : I remember with fondness the text *Oh, Pascal!* from my high
> ^^^^^^^^^^
> : school days.
>
> I learned to program from that text also.
>
> Seemed to work fine for me, though I can't say that I remember
> much about the book itself...
>
> 80% of my college textbooks are in boxes in the garage, but
> "Oh, Pascal" is right here on my bookshelf.
>
> Haven't looked at it for several years though.
>
If I recall a-rightly, this book (which btw I also learned to
program from) made the wonderful innovation of always referring
to the programmer in the feminine!
Can any of you old-timers tell us if this was ever done in any
technical literature prior to "Oh! Pascal!"?
John Porter
jporter@logicon.com
------------------------------
Date: Wed, 24 Dec 1997 16:08:52 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Opening a telnet process as a filehandle?
Message-Id: <34a13364.4084613@igate.hst.moc.com>
[original author automagically cc'd via e-mail]
On Tue, 23 Dec 1997 00:07:20 GMT, mccarthy@marshall.edu (Mike
McCarthy) wrote:
>I'm writing a script to take advantage of our new alphanumeric pagers
>by POSTing a message to our paging service's WWW server. I can
>manually telnet to that server on port 80 and enter the message
>successfully. When running through the perl script, however, the
>commands which I assumed would print to the telnet process filehandle
>don't seem to be working.
[snip]
>Any suggestions?
Yes.
Grab Net::Telnet from your local CPAN and put it to use. You might
also want to see the article about Net::Telnet in the latest Perl
Journal.
Jeremy
--
Jeremy D. Zawodny jzawodn@wcnet.org
Web Server Administrator www@wcnet.org
Wood County Free Net (Ohio) http://www.wcnet.org/
------------------------------
Date: 24 Dec 1997 06:51:40 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Perl Dbase Access
Message-Id: <67qt0c$i6q@panix.com>
In <349FF625.1945@flash.net> Steve <mrlock@flash.net> writes:
>Is there a Dbase access Module for Perl 5.x?
DBD::XBase
http://www.perl.com/CPAN-local/authors/Jan_Pazdziora/
Provides read and write access to XBase data files (.dbf and .dbt).
It doesn't obey index files so please do not break your valuable data.
Xbase
http://www.perl.com/CPAN/modules/by-module/Xbase
Access to Xbase DBF files and Foxpro IDX and FPT files.
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: Wed, 24 Dec 1997 15:02:38 +1000
From: Tim Nash <scover@sportscover.com>
Subject: PERL Memory Problems
Message-Id: <34A0976E.6629@sportscover.com>
Hello,
Could anyone please help me with this problem ?
I use a PERL script to work its way through
a list and assign values to each of the items so
are sorted. I use a hash table / associatuive array
to hold the items and value. When this script
runs it chews up Megs of memory within seconds so
that there is literally none left and the result is that
the machine keeps swpping from the swap disk causing the
script to run extremely slow. The longer it runs, the more
it chews up !
The type of machine is a Intel P120 24Mg RAM running
Red Hat Linux 4.2
If you have any suggestions, I'd love to hear them.
Regards
Tim Nash
scover@sportscover.com
------------------------------
Date: 24 Dec 1997 15:11:50 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: PERL Memory Problems
Message-Id: <slrn6a29mu.d7.mike@stok.co.uk>
On Wed, 24 Dec 1997 15:02:38 +1000, Tim Nash <scover@sportscover.com> wrote:
>I use a PERL script to work its way through
>a list and assign values to each of the items so
>are sorted. I use a hash table / associatuive array
>to hold the items and value. When this script
>runs it chews up Megs of memory within seconds so
>that there is literally none left and the result is that
>the machine keeps swpping from the swap disk causing the
>script to run extremely slow. The longer it runs, the more
>it chews up !
Could you post a chunk of code which demonstrates the problem? There are
a number of ways to code so that perl consumes a lot of memory, and most
can be avoided. Without a sample of the code it's hard to suggest
anything - how large a volume of data are you storing in memory?
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 24 Dec 1997 10:20:54 GMT
From: "Real" <real@earthling.net>
Subject: Re: Starting a Daemon in a CGI script
Message-Id: <01bd1055$9d0113c0$822c57c0@pc0130.pica.nl>
Hay there,
charlot@SPAM-FREE.org wrote in article <67oqdk$it@stratus.CAM.ORG>...
> In article <01bd0fbf$931c0860$822c57c0@pc0130.pica.nl>,
> Real <real@earthling.net> wrote:
> >For me, it's just the other way around. If I'm using exec, the script
never
> >comes back.
> >
>
> That's the documented behaviour. "exec" _replaces_ the invoking process
with
> the one given in argument. That's why it's often preceded by "fork" to
create
> a new process first.
Yep, you're right. The perlfunc man page (on exec() and system()) is clear
enough. But in the original message, Matt writes :
Matt> if (!daemonRunning)
Matt> {
Matt> system("runDaemon.pl &");
Matt> }
Matt> print htmlHeader();
Matt> print "I'm back";
Matt> return 1;
Matt>
Matt> The problem is my perl script never comes back from starting
runDaemon.pl
There's no way I can explain this behaviour. In this case, exec() has
nothing to do with it. Matt did not use it. The system() function should
work fine, so his questions hasn't been answered yet 'cause *in his case*
it doesn't work properly. Any idea why ?
Real
>
> Richard.
> --
> Richard Bellavance -- charlot(at)cam(dot)org --
http://www.cam.org/~charlot/
> "All along this path I tread / My heart betrays my weary head
> With nothing but my love to save / From the cradle to the grave"
> (Eric Clapton, "From the cradle")
------------------------------
Date: 24 Dec 1997 10:22:02 -0500
From: charlot@SPAM-FREE.org
Subject: Re: Starting a Daemon in a CGI script
Message-Id: <67r9ar$mjt@ocean.CAM.ORG>
In article <01bd1055$9d0113c0$822c57c0@pc0130.pica.nl>,
Real <real@earthling.net> wrote:
>
> [repeat of Matt's problem removed]
>
>There's no way I can explain this behaviour. In this case, exec() has
>nothing to do with it. Matt did not use it. The system() function should
>work fine, so his questions hasn't been answered yet 'cause *in his case*
>it doesn't work properly. Any idea why ?
>
Not really, and it's why I had not quoted Matt's message in my answer. I
tried to reproduce the problem (briefly, I admit) and could not.
Sorry,
Richard.
--
Richard Bellavance -- charlot(at)cam(dot)org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: Wed, 24 Dec 1997 16:02:19 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Starting a Daemon in a CGI script
Message-Id: <ELpB7v.9D5@world.std.com>
maverner@hotmail.com writes:
>I have a perl script in my cgi-bin file which is supposed to start a
>daemon and then return a simple message.
Check with your servers documentation. Many don't consider a script
finished until the standard input and standard output streams are
closed. This includes streams inherited by child processes (or
grandchild processes in this case you are having perl spawn a shell
which spawns your perl script.)
Maybe you want to fork() new processes yourself, close STDIN and
STDOUT and then call your other processes.
Although if the process you are trying to start is a true daemon, it
should be closing standard input, output, and error itself. (along
with other steps.) If you need help on writing a daemon, maybe you
should take a look at the book "Advanced Unix Programming" by WR
Stevens.
--
Andrew Langmead
------------------------------
Date: 24 Dec 1997 07:36:08 GMT
From: twod@not.valid
Subject: Re: Teen Perl Programmers Mailing List
Message-Id: <67qe18$5il$2@vnetnews.value.net>
brian d foy (comdog@computerdog.com) wrote:
: i didn't realize the newsgroup had an age limit - no one carded me
: when i first came in... :)
Getting out is harder than getting in !
IAP
--
I am using anti-spam measures, please replace 'not.valid' with 'value.net'
------------------------------
Date: Wed, 24 Dec 1997 13:53:24 GMT
From: pxharding_remove_this_bit_@_remove_this_bit_compuserve.com
Subject: Win32 problem with ISAPI (PERLISS.DLL ) apps not working with anything more than basic syntax
Message-Id: <34a113ae.23182644@news.compuserve.com>
Hi - I have implemented the actviestate Perl Win32 distribution,
including the ISAPI component, which runs applications fine from the
command line ( I have verified that the correct versin of perl is
being picked up ie. not one from the Resource Tool kit etc. ) - what I
have a problem with is that the same application fails with an error
like:
Internet Explorer cannot open the internet site abc/dfdf.pl
the operation completed successfully. - when being run as an ISAPI
application!
Code:
use File::Find;
print "Content-type: text/html\n\n";
find(sub {push(@dirlist, $File::Find::name) if -d;}, '/temp');
print <<BUNCHASTUFF;
<HTML><HEAD>
<TITLE>Blah BLah </TITLE>
</HEAD><BODY>
<H1>What's Happening </H1>
<HR>
BUNCHASTUFF
if ($ENV{'PERLXS'} == 'PerlIS'){
print "This is running PerlIS\n";}
print "start", "\n \n";
foreach $item ( @dirlist ) {
print "$item", "\n";
}
print </BODY></HTML>
exit;
The code works if you take the "find " line out - yet this work
perfectly at the command line with no change ( so it is not a syntax
error etc ).
Any suggestions gratefully received.
Cheers.
Please email me using this address after removing the obvious bits:
pxharding_remove_this_bit_@_remove_this_bit_compuserve.com
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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 V8 Issue 1532
**************************************