[7681] in Perl-Users-Digest
Perl-Users Digest, Issue: 1307 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 12 17:07:13 1997
Date: Wed, 12 Nov 97 14:00:22 -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, 12 Nov 1997 Volume: 8 Number: 1307
Today's topics:
Re: "perl aware" vi editor? (Colin Kuskie)
(in)efficient memory use--shm reset <ed@texas.net>
Re: Anxiously awaiting my Perl Resource Kit (Dustin Mollo)
Re: Better Way in Perl <curtis@ei.kodak.com>
Re: Block comments in Perl? (Jim Turner )
Re: carriage returns (Greg Bacon)
Re: carriage returns <$_=qq!fearless\@NOSPAMio.com!;y/[A-Z]//d>
Re: child-process workaround for taint-mode glob? (Greg Bacon)
Re: Debugger (Andrew M. Langmead)
Re: Debugger <cmargoli@world.northgrum.com>
Error for target `depend' when installing <chris_braiotta@harvard.edu>
Re: Help subroutines! <prl2@lehigh.edu>
Re: How to create a timeout for connect() ? <hollosi@sbcm.com>
Re: Installing modules? (Walt Sullivan )
Re: Killing a child process <xrcc0494@dcaca037.ca.boeing.com>
New to CGI.pm question. <klawson@julian.uwo.ca>
Re: New to CGI.pm question. (Mike Stok)
Novice needs help...inventory script <buhl@aieg.mot.com>
problem with MXR ERR ? <msda+@andrew.cmu.edu>
Re: Statistics for comp.lang.perl.misc <usenet-tag@qz.little-neck.ny.us>
Re: Statistics for comp.lang.perl.misc (brian d foy)
Tainting Question (Vince Wilding)
Re: tell in piped filehandle (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
THANKS FOR PERL AND PERLTK! (Mark Nielsen)
Re: Where can I get the pre-compiled binariy "undump" f (John Moreno)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 12 Nov 1997 09:01:28 -0800
From: colink@latticesemi.com (Colin Kuskie)
Subject: Re: "perl aware" vi editor?
Message-Id: <64cnd8$gec@sarek.latticesemi.com>
In article <x4lnyuz7cy.fsf@clovis.oulu.fi>,
Janne Himanka <spam@oyt.oulu.fi> wrote:
>Take a look at
>http://www.sleepycat.com/vi/
>
>A new version that fully supports embedded perl 5.004 is in the
>works. I could not get embedding to work with the nvi 1.79.
I just got embedding to work. You need this patch from Sven
Verdoolaege's home page (He wrote the embedding part of perl for
nvi).
URL: http://www.ufsia.ac.be/~skimo
The patch itself, in case you're HTTP impaired like I am:
--- perl.xs.orig Mon Aug 25 17:21:11 1997
+++ perl.xs Mon Aug 25 17:21:27 1997
@@ -417,10 +417,10 @@
static void
xs_init()
{
+ char *file = __FILE__;
#ifdef HAVE_PERL_5_003_01
dXSUB_SYS;
#endif
- char *file = __FILE__;
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
newXS("VI::bootstrap", boot_VI, file);
A small warning. I wasn't able to apply this using patch. However,
all that is involved is moving:
char *file = __FILE__;
Before the #ifdef HAVE_PERL_5_003_01
Colin Kuskie
------------------------------
Date: 12 Nov 1997 18:43:58 GMT
From: Edward Henigin <ed@texas.net>
Subject: (in)efficient memory use--shm reset
Message-Id: <64ctde$stg$1@news3.texas.net>
I'm working with SysV shared memory segments in my
apache-perl module. I'm doing some scoreboarding. Once a day,
I'm going to dump the scoreboard, and reset all the elements to zero.
I've got 64K elements, each element is two unsigned long's.
To zero out the shared memory segment, I was first planning
on doing this:
$DATUMSIZE = length(pack("LL",0));
$MAXCOUNT = 64 * 1024;
my $ps = "c" x ($DATUMSIZE * $MAXCOUNT);
my @pa = (0) x ($DATUMSIZE * $MAXCOUNT);
my $zerostring = pack($ps, @pa);
Needless to say, I tried to test this in a one-line perl
script, before I ran it, just to see how long it would take. Well,
it was taking a while before returning, so I thought of a way
which might be more efficient:
my $ps = pack("c",0);
my $zerostring = $ps x ($DATUMSIZE * $MAXCOUNT);
Well, I ran that in a one line perl script, and would you
believe it, the first thing the perl process did was to allocated
1G of memory. Thank god our sparcs run with a lot of swap.
So I'm thinking, this approach isn't going to work very well
at all. But I'd like to be able to do something like
shmwrite($ID, $zerostring, 0, $DATUMSIZE * $MAXCOUNT);
Can anyone suggest any other way to zero out the shared
memory segment? Or come up with a more efficient way of generating
a binary string of 512K 0's ? I'm also trying to do it in a way
that's going to be easy to maintain, so I'd like to minimize the
constants.
Thanks for your insights...
------------------------------
Date: 12 Nov 1997 21:21:22 GMT
From: dustin@sonic.net (Dustin Mollo)
Subject: Re: Anxiously awaiting my Perl Resource Kit
Message-Id: <64d6ki$88b$1@ultra.sonic.net>
Mark Morgan (mak@mark.dircon.net) wrote:
: Blake D. Mills IV wrote:
:
: > I'm due to receive my PRK in the next day or so, and am rather excited
: > about it. Has anyone out there already recieved a kit, or possibly
: > tested the pre-releases? Anyone have any first-impressions?
: >
: > -Blake
The kits are beginngin to ship and should be in bookstores shortly.
I work for an affiliate of ORA, so I have seen both the finished product,
and the BETA versions. I can't speak about Larry's Java<->Perl thingy as it
is over my head. I do, however, really enjoy the books that come with this
product. The modules books are completely cool IMHO. I would much rather
look through these books than porr over man pages. I have heard from a
friend who was on the BETA test as well, that the ability to pop in a CD and
install Perl onto a Sun at his client's office was really cool. It comes
with a Perl/Tk interface and is pretty much a snap.
BTW, a better URL to get ORA/Perl info is http://perl.ora.com
-Dustin
------------------------------
Date: Wed, 12 Nov 1997 14:27:24 -0500
From: Walker Curtis <curtis@ei.kodak.com>
To: abigail@fnx.com
Subject: Re: Better Way in Perl
Message-Id: <346A031C.8EE8B9C6@ei.kodak.com>
Abigail wrote:
> Walker Curtis (curtis@ei.kodak.com) wrote on 1532 September 1993 in
> <URL: news:34670FD2.4942A63@ei.kodak.com>:
> ++
> ++ Abigail wrote:
> ++
> ++ >
> ++ > Or ls, a pipe and -n:
> ++ >
> ++ > ls|perl -ne'/\.cin$/&&`mv $_ $\``'
> ++
> ++ Don't you need to strip the return on $_ to make this work?
>
> So, stick in an extra -l:
> ls|perl -nle'/\.cin$/&&`mv $_ $\``'
Outstanding! I never fully understood the -l option. My amaturestatus
has been exposed. I have been using perl on and off for a year.
If I see nothing better a tshirt is yours. Wait a couple of days.
After that send me an address and a size.
>
>
> Abigail
> --
> perl -wle 'print "Prime" if (1 x shift) !~ /^(11+?)\1+$/'
Thanks,
-wc
------------------------------
Date: 12 Nov 1997 18:14:20 GMT
From: turnerj@cliffy.lmtas.lmco.com (Jim Turner )
Subject: Re: Block comments in Perl?
Message-Id: <64crls$ncl1@quest.lmtas.lmco.com>
brian d foy (comdog@computerdog.com) wrote:
: In article <slrn66fi1o.n2k.gabor@vinyl.quickweb.com>, gabor@vinyl.quickweb.com (Gabor) wrote:
:
: >In article <35744.4279846065luutrangeocitiescom@207.217.245.11>, Luu Tran wrote:
:
: >>This is dumb but how do I do block comments in Perl (5.003)? perlsyn says C
: >>style /* */ block comment is out, so how?
:
:
: >if(0) {
: > stuff i want to block, should still be valid code, of course
: >}
:
: why would you want to do soemthing like that, which really isn't a
: comment at all? use the built in commenting features of plain old
: documentation:
:
: =head1 this section is ugly
:
: lots of lines of code here are ignored by the interpreter, unlike
: some other suggestions
:
: =cut
:
: --
: brian d foy <comdog@computerdog.com>
: NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
: CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
I just have to add my 2 cents worth also:
Try this:
goto RESUME;
Type anything you want here, this will
all be commented out.
RESUME:
------------------------------
Date: 12 Nov 1997 18:01:04 GMT
From: gbacon@adtran.com (Greg Bacon)
To: Mark Chaffee <chaffee@cpdmfg.cig.mot.com>
Subject: Re: carriage returns
Message-Id: <64cqt0$3de$5@info.uah.edu>
[Posted and mailed]
In article <3469E823.67CA@cpdmfg.cig.mot.com>,
Mark Chaffee <chaffee@cpdmfg.cig.mot.com> writes:
: I have a variable that contains a text string with carriage returns. Is
: there a way to strip them out?
:
: $var = "This is^Ma text string^Mwith unwanted^Mcarriage returns."
$var =~ s/\s+/ /g;
will replace all runs of whitespace in $var with a single space. Read
the perlre manpage and the perlop entry on the substitution operator
(s///) for more details.
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Wed, 12 Nov 1997 10:43:09 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/[A-Z]//d>
Subject: Re: carriage returns
Message-Id: <64ctft$f11@news.microsoft.com>
$var =~ s/\cM/ /g;
should do it for you.
Mark Chaffee wrote in message <3469E823.67CA@cpdmfg.cig.mot.com>...
>I have a variable that contains a text string with carriage returns. Is
>there a way to strip them out?
>
>$var = "This is^Ma text string^Mwith unwanted^Mcarriage returns."
------------------------------
Date: 12 Nov 1997 17:53:26 GMT
From: gbacon@adtran.com (Greg Bacon)
To: John Callender <jbc@west.net>
Subject: Re: child-process workaround for taint-mode glob?
Message-Id: <64cqem$3de$4@info.uah.edu>
[Posted and mailed]
In article <34695611.9D34231A@west.net>,
John Callender <jbc@west.net> writes:
: #!/usr/local/bin/perl -T
:
: # add error processing as above
: $pid = open(KID_TO_READ, "-|");
: if ($pid) { # parent
: while (<KID_TO_READ>) {
: # do something interesting
: push @stuff; # seemed interesting to me...
: }
: close(KID_TO_READ) || warn "kid exited $?";
:
: } else { # child
: ($EUID, $EGID) = ($UID, $GID);
: $ENV{'PATH'} = '/bin:/usr/bin:/usr/local/bin';
: exec('ls', '-1', '../????/??????.html')
: || die "can't exec program: $!";
: # NOTREACHED
: }
:
: print "@stuff";
:
: When I run this, I get the following:
:
: ls: ../????/??????.html: No such file or directory
: kid exited 256 at temp.pl line 10.
Right. At a shell, give the command
% ls '????'
ls will probably complain that there's no file named ????. The whole
point of giving exec a list is so the arguments don't go throught the
shell (which is where globbing happens, *not* in the programs
themselves).
Until we have secure globbing (which we hope will be very soon), why
not use a regular expression (which is usually more powerful than a
shell glob pattern anyway)?
opendir DIR, $dirname or die "Failed opendir $dirname: $!";
while (readdir DIR) {
if (/^(\w{1,6}\.html)$/) { # avoid evil file names
push @files, $1;
}
}
closedir DIR;
It's not as easy to specify glob patterns like */*.html in Perl, but if
you need to traverse a directory tree, perhaps File::Find will be useful
to you.
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Wed, 12 Nov 1997 20:21:35 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Debugger
Message-Id: <EJJv80.C0A@world.std.com>
rqy1319@is4.nyu.edu (Ryuji Yokoyama) writes:
>I appreciate people who replied me, but I still don't understand how
>to use the debugger. I read perldebug man, but this document is too
>poor for me. Please some body teach me. How to watch variables and
>how to trace the program step by step.
This should be enough to start you out, once you get comfortable with
these commands, then maybe the rest will fall into place:
The debugger is command line oriented, you type a command and follow
it by the enter or return key on your keyboard.
The "n" command (stands for "next") goes to the next statement in your
program. If the current statement is a subroutine, it will stop on the
next statement after the subroutine call. (It "steps over"
subroutines.)
The "s" command also single steps through your program, but it enters
subroutine when they are called. (It "steps into" subroutines")
The "r" command continues running your program until the current
subroutine ends. Once the subroutine is over, it stops execution and
returns you to the debugger prompt.
The "c" command tells perl to continue to run non-stop until the
program ends or a breakpoint is reached.
The "x" command shows the current value of a variable. It is followed
by the name of the variable you want to examine. (that is, if you want
to see the contents of the variable "$line", you would type
"x $line" followed by enter.)
The "b" command sets a breakpoint on a line. Its argument is a line
number or a subroutine name.
The "w" command shows a couple of lines of your program. If you give
it a number as an argument, it will show you a couple of lines before,
on, and after that line number. If you don't give it an argument, it
will default to the line number of the current statement.
The "q" command immediatly ends the execution of your program.
Say you have a program:
#!/usr/bin/perl -w
use strict;
my $char;
for $char ( 'a' .. 'z') {
print "$char\n";
}
A debugging session might look like this. All of the lines that start
with DB<n> are the debuggers prompts. Everything after that one the
line is the stuff I typed in. The other lines are either from the
debugger, or output from my program.
$ perl -d foo
Loading DB routines from perl5db.pl version 1
Emacs support available.
Enter h or `h h' for help.
main::(foo:4): my $char;
DB<1> n
main::(foo:6): for $char ( 'a' .. 'z') {
DB<1> n
main::(foo:7): print "$char\n";
DB<1> n
a
main::(foo:7): print "$char\n";
DB<1> n
b
main::(foo:7): print "$char\n";
DB<1> x $char
0 'c'
DB<2> w
4: my $char;
5
6: for $char ( 'a' .. 'z') {
7==> print "$char\n";
8 }
DB<2> q
$
Once you get comfortable with using the commands I listed, you might
be able to decipher the perldebug man page a bit better. then you can
start looking at either new commands or additional features the
commands I mentioned. For example the "b" command can also set
breakpoints that only trigger when certain conditions are met. If you
are noticing something funny happens in the above script near the end,
you could say something like:
b 7 $char eq 'v'
and then type the "c" command for "continue", then the program will
run until $char is the string "v", and then break.
--
Andrew Langmead
------------------------------
Date: Wed, 12 Nov 1997 21:02:41 GMT
From: Charles Margolin <cmargoli@world.northgrum.com>
Subject: Re: Debugger
Message-Id: <346A1971.15AF@world.northgrum.com>
Andrew M. Langmead wrote:
>
> The "r" command continues running your program until the current
> subroutine ends. Once the subroutine is over, it stops execution and
> returns you to the debugger prompt.
>
Maybe I'm missing something, but I can't find the 'r' command in
the perldebug man page or the Blue Camel. It's in the debugger's
own help.
--
Charles G. Margolin DSSD Internal Information Services
cmargoli@world.northgrum.com Northrop Grumman Corp. 0624/23
margolin@acm.org Hawthorne, California 90250-3277
------------------------------
Date: Wed, 12 Nov 1997 13:36:50 -0500
From: Chris Braiotta <chris_braiotta@harvard.edu>
Subject: Error for target `depend' when installing
Message-Id: <3469F736.B95140CD@harvard.edu>
Halp! I'm trying to install perl 5.004_04 on a Sparc 10 running Solaris
2.4. When the Configure program gets to the "make depend" step, I get
the following error:
make: Fatal error: Command failed for target `depend'
Any ideas? I and my sysadmin are stumped.
Chris Braiotta
chris_braiotta@harvard.edu
------------------------------
Date: 12 Nov 1997 18:29:36 GMT
From: "Phil R Lawrence" <prl2@lehigh.edu>
Subject: Re: Help subroutines!
Message-Id: <01bcef98$ed031180$3e03b480@mm>
Greg Bacon <gbacon@adtran.com> wrote in article
<64cped$3de$3@info.uah.edu>...
in response to <346b3459.3377081@netnews.nyu.edu>,
> Character classes (like [0-9]) are only available within regular
> expressions. You want to use numeric comparison here:
>
> sub check_input {
> my $n = shift;
>
> if ($n >= 0 and $n <= 9) {
> return 1;
> }
> else {
> return 0;
> }
> }
Is there anything wrong or depracated about using regular expressions in
this case (where we're hoping to deal with a digit input?) Or is the
following acceptable?
sub check_input {
my $n = shift;
if ($n !~ /^[0-9]$/) {
return 1;
}
else {
return 0;
}
}
------------------------------
Date: Wed, 12 Nov 1997 19:21:43 GMT
From: Jozsef Hollosi <hollosi@sbcm.com>
To: Frederic GILLES <gilles@tls-cats.sps.mot.com>
Subject: Re: How to create a timeout for connect() ?
Message-Id: <EJJsGC.GC@nonexistent.com>
Frederic GILLES wrote:
>
> When the connection to a server with the function connect() doesn't
> work, it doesn't give me an answer.
> I want to define a timeout alarm to stop the connect() and to continue
> the program?
> How can I do that?
First answer: it times out eventually (thought the time depends
on the circumstances and your OS - and it can be looooong.
Second answer: you can use a $SIG{"ALRM"} handler with alarm()
Third answer: you can set the socket to non-blocking mode:
$F_SETFL = 4; # lazy, you should use config here
$O_NDELAY = 4; # lazy, you should use config here
fcntl($filedesc, $F_SETFL, $O_NDELAY);
and then you can monitor it with regular select()
Jozsef
------------------------------
Date: 12 Nov 1997 13:05:11 -0500
From: walts@bquah49f.ca.nortel.com (Walt Sullivan )
Subject: Re: Installing modules?
Message-Id: <yszhn2jam1ig.fsf@bquah49f.ca.nortel.com>
In article
<erik-1111970736080001@pool028-max1.pasadena.ca.us.dialup.earthlink.net>
erik@earthlink.net (Erik Y. Adams) writes:
So, I've downloaded a module from my nearest CPAN mirror. I've done "perl
Makefile.PL" and "make". Now I've got a bazillion files sitting around,
and I'm not sure which ones to move into the @INC directories.
While "make install" will install the correct files in the correct
system Perl library directories, if you want to test them in your
application first, or if you don't have write access to the system
Perl lib dirs, use:
perl Makefile.PL PREFIX=/my/perl
Then run "make", "make test" and "make install", which will install
the package under /my/perl/...
See "perldoc MakeMaker"
------------------------------
Date: Wed, 12 Nov 1997 19:36:51 GMT
From: "robert c. combs" <xrcc0494@dcaca037.ca.boeing.com>
Subject: Re: Killing a child process
Message-Id: <346A0553.4095@dcaca037.ca.boeing.com>
SiberTanrI wrote:
>
> A Perl script makes a system call to invoke another
> tool. While this child is running, the user tries to stop
> the execution of the Perl script using ^c. How do we kill
> the child process, too, since ^c is only detected by the
> parent?
>
> An example will be appreciated.
You could try implementing a SIGTERM (^c) trap inside of the scrip to
kill off the child.
-bob combs
------------------------------
Date: Mon, 10 Nov 1997 12:55:16 -0500
From: Keith Lawson <klawson@julian.uwo.ca>
Subject: New to CGI.pm question.
Message-Id: <Pine.SOL.3.95q.971110124544.14137B-100000@panther.uwo.ca>
Hello,
I recently installed the CGI.pm perl library and am having some problems
with creating a form. I am used to calling a script from an HTML document
and the script will then process the information and display a thank you
message or whatever. From what I understand with the CGI.pm library you
can have the code for the form, the processing of the form and the
'thank-you' page all in the same file. I have the form created and
working, now how do I get the script to call a new HTML document when they
click submit?? Right now when they click submit the form processes the
information and the screen just re-loads. Should I break this into 2
files (one displaying the form, and calling a seprate script to
process the info. and display a thank you page.)?
Keith Lawson. (klawson@julian.uwo.ca)
ICQ UIN: 113375
* Right is what's left when you've done everything else wrong. *
- Robin Williams
------------------------------
Date: 12 Nov 1997 21:29:00 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: New to CGI.pm question.
Message-Id: <64d72s$6pi@news-central.tiac.net>
One way to do it is to have the main body of the code something like this
in structure
if (no parameters) {
displayForm;
}
else {
if (form params are OK) {
processData;
displayThanks;
}
else {
redisplayForm; #maybe with error message
}
}
Hope this helps,
Mike
In article <Pine.SOL.3.95q.971110124544.14137B-100000@panther.uwo.ca>,
Keith Lawson <klawson@julian.uwo.ca> wrote:
>Hello,
>
>I recently installed the CGI.pm perl library and am having some problems
>with creating a form. I am used to calling a script from an HTML document
>and the script will then process the information and display a thank you
>message or whatever. From what I understand with the CGI.pm library you
>can have the code for the form, the processing of the form and the
>'thank-you' page all in the same file. I have the form created and
>working, now how do I get the script to call a new HTML document when they
>click submit?? Right now when they click submit the form processes the
>information and the screen just re-loads. Should I break this into 2
>files (one displaying the form, and calling a seprate script to
>process the info. and display a thank you page.)?
>
>
>Keith Lawson. (klawson@julian.uwo.ca)
>ICQ UIN: 113375
>
>* Right is what's left when you've done everything else wrong. *
> - Robin Williams
>
--
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, 12 Nov 1997 14:55:44 -0600
From: Mark Buhl <buhl@aieg.mot.com>
Subject: Novice needs help...inventory script
Message-Id: <346A17CF.3016553E@aieg.mot.com>
I have written a perl script to do an inventory of my system identifying
all shell and perl scripts and the number of lines in each file. I have
quite a kluge of a script, wondering if someone can show me how to make
it more efficient.
Thanks
#!/usr/local/bin/perl
#
#
$host = `uname -n`;
$outfile = "/common/etc/Y2Klisting."."$host";
open(OUT, ">>$outfile") || die "Unable to open $outfile!!";
foreach (@ARGV) {
$filename = $_;
if ( -T $_ ) {
if ( -s $_ ) {
while (<>) {
if (/^#!.*sh/) {
$type = "Sh Script";
}
elsif (/^#!.*perl/) {
$type = "Perl Script";
}
else {
exit;
}
last;
}
while (<>) {
$count++;
}
$count++;
printf(OUT "%-40s %-10s %-10s\n", $filename,$type,$count);
}
}
}
------------------------------
Date: Wed, 12 Nov 1997 14:14:43 -0500
From: Michael D Sohn <msda+@andrew.cmu.edu>
Subject: problem with MXR ERR ?
Message-Id: <0oOU0X200YUh03upM0@andrew.cmu.edu>
I'm using perl 4.0 on an alpha workstation. My perl program is doing
many loops and system calls. After a certain number of loops I get this
error:
MXR ERR: vfork parent read: Bad file number
What does this mean? I'm closing all of the files that I open. Could
it do with the system calls?
thanks,
Mike.
------------------------------
Date: 12 Nov 1997 21:43:06 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <eli$9711121612@qz.little-neck.ny.us>
Tad McClellan <tadmc@flash.net> wrote:
> Danny Aldham (danny@lennon.postino.com) wrote:
> : Greg Bacon (gbacon@cs.uah.edu) wrote:
> : : Following is a summary of articles spanning a 7 day period,
> : Would it be possible to get the Top 10 Posters of RTFM posts?
Submit code to do it.
> : I swear, close to 50% of the posts are such a beast. Couldn't
> : they just be sent as e-mail?
I very rarely see them, maybe that says something about the articles I
choose not to read though.
> Would it be possible to get the Top 10 Posters of FAQs?
A little trickier since them suckers are very good are rewording the
questions.
> I swear, close to 50% of the posts are such a beast. Couldn't
> they just try and look them up, like the conscientious 'net
> citizens do, before they post the same question yet again?
You assume they aspire to be conscientious.
(Greg: would it be possible to keep a running tally of how many people
have asked for counts of RTFM posts? Probably something like:
my $rtfmcount=1; # Danny Aldham is the first
if ( ($subject =~ /Statistics\s+for\s+comp\.lang\.perl/i) and
(defined($references)) ) {
if ( $body =~ /^\s*
[^]>:|}]
.*
top\s+
(?: ten
| 10
)\s+
(?: RTFM
| read [-\s]+ the [-\s]+ FAQ
| check [-\s]+ deja\W?news
)
/xim
) {
if (open(SAVEDCOUNT,"<savedcount")) {
$rtfmcount=<SAVEDCOUNT>;
if ( $rtfmcount =~ /^\s*\d+\s*$/ ) {
$rtfmcount++;
} else {
warn "\$rtfmcount has been trashed ($rtfmcount) resetting" .
" date is now bogus\n";
$rtfmcount=1;
}
if (open(SAVEDCOUNT,">savedcount")) {
print SAVEDCOUNT $rtfmcount;
} else {
warn "Couldn't write to savedcount: $!\n";
}
} else {
warn "Couldn't open savedcount: $!\n";
}
}
}
# ...
printf "%8d Bozos have asked for RTFM post counts since November 1997\n",
$rtfmcount;
Just a suggestion mind you.)
> I'm more annoyed by the disease than I am by a symptom of the disease...
Of course, they represent two very different mindsets.
Elijah
------
perl -e 's Y Yreverse q N ny pm ,srekcah lrep kroy wen emosNYex and s Pmp ynP
P and s MsMjust sMx and print and s NYPM MPYN Nis or reverse and print q q q'
------------------------------
Date: Wed, 12 Nov 1997 16:58:45 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <comdog-ya02408000R1211971658450001@news.panix.com>
In article <64atoh$s3j$1@lennon.postino.com>, danny@lennon.postino.com (Danny Aldham) wrote:
>Greg Bacon (gbacon@cs.uah.edu) wrote:
>: Following is a summary of articles spanning a 7 day period,
>: beginning at 01 Nov 1997 13:18:11 GMT and ending at
>
>Would it be possible to get the Top 10 Posters of RTFM posts?
>I swear, close to 50% of the posts are such a beast. Couldn't
>they just be sent as e-mail?
then other people wouldn't see them and wouldn't get the stigma of
posting a question before RTFM.
most of the questions answered here are answered by people that
RTFM. you'll notice that these same people rarely *ask* questions.
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Wed, 12 Nov 1997 14:51:23 -0600
From: vwilding@mib.nbs.gov (Vince Wilding)
Subject: Tainting Question
Message-Id: <879366984.32217@dejanews.com>
I have a CGI-script that needs to allow users to generate a file in a
world-writable directory and write to it. When I run with -T, it
complains, I would suppose, about the world-writable directory. Is there
a way around this, i.e. WRITING to a world writable directory and still
pass the taint check?
=================================
Vince Wilding
Web Wrangler
USGS/BRD
vince_wilding@usgs.gov
http://biology.usgs.gov/pubs/vcfw
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 12 Nov 97 14:25:02 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: tell in piped filehandle
Message-Id: <346a03da$16$ofn$mr2ice@speaker>
In <64c13t$3i7$1@mortimer.deas.org>, on 11/12/97 at 10:41 AM,
deas@dont.spam.me.rrz.uni-hamburg.de (Andreas Steffan) said:
+-----
| I am trying to hack info2www to work with gzipped info-pages,
| and I would like to avoid gunzipping these.
| Info2www uses seek and tell.
| However, I wonder why tell is not working in piped filehandles.
+--->8
You cannot seek on a pipe (in this case, between gunzip and your Perl script)
because a pipe is by nature a one-way street. "tell" is implemented as a
zero-byte relative seek to get the OS's idea of the current file position, and
if you had checked $! after the "tell" you'd have seen an error message like
"Attempted seek on a pipe" or whatever text your OS uses for that error. (If
it's a recent Unixish system it might talk about a socket instead of a pipe,
as pipes are often implemented internally as sockets on those systems.)
The canonical solution to this is to read the data from the pipe into a
temporary file, then operate on the file.
--
brandon s. allbery [Team OS/2][Linux] bsa@void.apk.net
cleveland, ohio mr/2 ice's "rfc guru" :-) KF8NH
"Never piss off a bard, for they are not at all subtle and your name scans to
`Greensleeves'." ---unknown, quoted by Janet D. Miles in alt.callahans
------------------------------
Date: 12 Nov 1997 15:16:11 -0500
From: men2@auto.med.ohio-state.edu (Mark Nielsen)
Subject: THANKS FOR PERL AND PERLTK!
Message-Id: <64d2qb$kq$1@auto.med.ohio-state.edu>
Just wanted to say to all the people who made perl, PerlTk, and the
Win32 modules, THANKS!
I really think the PerlTk opens up a whole new field for perl programming.
No more Visual Basic, thank god.
Perl kicks ass. Nuff said.
Mark
--
---------------------------------------------------------------------------
Mark Nielsen men2@auto.med.ohio-state.edu or gytres+@osu.edu
Systems Specialist
The Ohio State University
------------------------------
Date: Wed, 12 Nov 1997 13:14:11 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Where can I get the pre-compiled binariy "undump" for Linux?
Message-Id: <1997111213060346332860N@roxboro-174.interpath.net>
M. Mustun <mustun@active.ch> wrote:
-snip unreadable question in html format-
Please set your newsreader to plain text.
--
John Moreno
------------------------------
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 1307
**************************************