[9555] in Perl-Users-Digest
Perl-Users Digest, Issue: 3152 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 14 10:17:25 1998
Date: Tue, 14 Jul 98 07:01:36 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 14 Jul 1998 Volume: 8 Number: 3152
Today's topics:
Re: AWK Interpreter <scp@cadcentre.co.uk>
Re: AWK Interpreter <rdh@best.com>
Re: Dynamic HTML document in new browser window? <barnett@houston.Geco-Prakla.slb.com>
Re: My script stops searching... merzky@physik.hu-berlin.de
Numerous Test Errors <rkurnik@rspac.ivv.nasa.gov>
Re: portability of -s dave@mag-sol.com
Re: Recommend me Perl! <tchrist@mox.perl.com>
Re: Recommend me Perl! (Bart Lateur)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 14 Jul 1998 14:22:19 +0100
From: "S.Plant" <scp@cadcentre.co.uk>
Subject: Re: AWK Interpreter
Message-Id: <6ofm0i$os0$1@flex.london.pipex.net>
David,
There is a Awk2perl translator that comes with a std perl
distribution. Its called "a2p" and was written by Larry Wall (surprise !!
;) ).
Watch out tho, as some of the produced code isn't
the nicest perl in the world, but hey it works and saves me hours :)
Rgds
Si
David Reynolds wrote in message <6ofg46$vno$1@news.wolsi.com>...
>I am learning Perl and have have programmed a great deal in AWK. I was
>looking for a perl program that converted AWK code to Perl. I would like
to
>see the differences between the two.
>
>
>David
>
>
------------------------------
Date: 14 Jul 1998 06:38:54 -0700
From: Dale Hagglund <rdh@best.com>
Subject: Re: AWK Interpreter
Message-Id: <86btqsblht.fsf@ponoka.battleriver.com>
"David Reynolds" <irisbeau@wolsi.com> writes:
> I am learning Perl and have have programmed a great deal in AWK. I
> was looking for a perl program that converted AWK code to Perl. I
> would like to see the differences between the two.
Perl comes (used to come?) with a program called ``a2p'' that makes an
attempt to translate awk to perl.
However, I don't think that looking at the output of this program is
going to help you all that much; a better approach, in my opinion, is
to find one of your smaller awk programs, and rewrite it in perl
yourself. Then, repeat with other awk programs.
Dale.
------------------------------
Date: Tue, 14 Jul 1998 08:01:32 -0500
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Dynamic HTML document in new browser window?
Message-Id: <35AB56AC.61299560@houston.Geco-Prakla.slb.com>
Sabine Cremer wrote:
>
> I wrote a simple perl application to get an answer from a database.
> Because it is called from a frame too small for the output, I want to
> put the dynamically generated data into a new browser window. How to do
> it??
>
> Sabine
Several suggestions:
1. This is not a perl specific issue. This can be done in any
programming language you want.
2. The question you pose is related to CGI, and html. More appropriate
newsgroups would be: comp.infosystems.www.authoring.cgi, and
comp.infosystems.www.authoring.html.
3. Have a look at the 'target' html sub-tag. I think that is what you
want, but don't quote me on that (and don't ask me how to implement
it--I don't know).
Cheers,
Dave
--
"Security through obscurity is no security at all."
-comp.lang.perl.misc newsgroup posting
----------------------------------------------------------------------
Dave Barnett U.S.: barnett@houston.Geco-Prakla.slb.com
DAPD Software Support Eng U.K.: barnett@gatwick.Geco-Prakla.slb.com
----------------------------------------------------------------------
------------------------------
Date: Tue, 14 Jul 1998 13:02:46 GMT
From: merzky@physik.hu-berlin.de
Subject: Re: My script stops searching...
Message-Id: <6ofktl$2cr$1@nnrp1.dejanews.com>
In article <6odg2m$cij$1@nr1.vancouver.istar.net>,
"Geoff Wild" <geoff_wild@dynapro.com> wrote:
> I am trying to search every text file on our system for a particular string.
>
> The command line is: test.pl <STRING>
>
> I'm using a script from Larry Wall's Programming Perl book.
>
> The difference is I want the output to a file, I have tried the script with
> the log file as well as to STDOUT - and once I have hit 94 files, the script
> slowly loses cpu, until it uses nothing.
>
> I thought maybe it was dying on a large file - but nope - I moved that file
> to another directory - and the script still stops searching after 94 files.
>
> I get no error messages.....
>
> Anyone have any ideas I can try?
>
> Thanks...Geoff
Hmm, maybe find cannot give back more than 94 names (or a certain amount of
characters)? Or to much opened files? - you don't close...
I would try something like this:
#!/usr/bin/perl
$LOGFILE="/tmp/test.pl.log";
$| = 1;
open (FIND, "find . -print |") || die "Couldn't run find: $!\n";
@files = <FIND>;
close (FIND);
FILE:
foreach $filename (@files) {
chomp $filename;
next unless -T $filename;
if (!open(TEXTFILE, $filename)) {
print STDERR "Can't open $filename - continuing...\n";
next FILE;
}
open(LOG, ">> $LOGFILE");
while (<TEXTFILE>) {
foreach $word (@ARGV) {
if (index($_, $word) >= 0) {
print LOG $filename, "\n";
close (TEXTFILE);
next FILE;
}
}
}
close (TEXTFILE); # too much opened files???
}
close(LOG);
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 14 Jul 1998 09:16:03 -0400
From: "Richard A. Kurnik" <rkurnik@rspac.ivv.nasa.gov>
Subject: Numerous Test Errors
Message-Id: <35AB5A0D.4413@rspac.ivv.nasa.gov>
I have several problems with installing perl5004_04. When I run make
test I get several of the tests that fail. If I can get some insight on
where to start to solve these problems I'd be grateful.
First, I'm running Solaris 2.5 on a Sparc 20 Server. I installed gdbm
and it is the principle item I need installed. It is located in all
its' standard locations.
Here are the test that fail:
lib/anydbm........FAILED at test 0
lib/filecopy......FAILED at test 6
lib/filehand......FAILED at test 0
lib/gdbm..........FAILED at test 0
lib/io_dup........FAILED at test 0
lib/io_pipe.......FAILED at test 0
lib/io_sock.......FAILED at test 0
lib/io_taint......FAILED at test 0
lib/io_tell.......FAILED at test 0
lib/io_udp........FAILED at test 0
lib/io_xs.........FAILED at test 0
lib/ndbm..........FAILED at test 0
lib/odbm..........FAILED at test 0
lib/opcode........FAILED at test 0
lib/open2.........FAILED at test 0
lib/open3.........FAILED at test 0
lib/ops...........FAILED at test 1
lib/posix.........FAILED at test 0
lib/safe1.........FAILED at test 0
lib/safe2.........FAILED at test 0
lib/sdbm..........FAILED at test 0
When I run each test individually they all seem to fail loading
modules. For example when I run the test for gdbm I get back:
"Can't load '../lib/auto/GDBM_File/GDBM_File.so' for module GDBM_File:
ld.so.1: ./perl: fatal: relocation error: symbol not found: main:
referenced in ../lib/auto/GDBM_File/GDBM_File.so at ../lib/DynaLoader.pm
line 166."
All the other errors are very similiar.
Any input at all would be great.
--
Thanks.
END
_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+
Richard A. Kurnik rkurnik@rspac.ivv.nasa.gov
------------------------------
Date: Tue, 14 Jul 1998 13:09:16 GMT
From: dave@mag-sol.com
Subject: Re: portability of -s
Message-Id: <6ofl9s$2up$1@nnrp1.dejanews.com>
In article <oxgoguskgui.fsf@panix.com>,
Yeoh Yiu <squid@panix.com> wrote:
> Does the -s test for file size return the same number
> for the same file if I copy this file to various file systems ?
>
> p85 of the blue camel doesn't say size is measured in bytes
> but I assume it to be so.
If your question is "does -s use the same units on all filesystems?" then the
answer is yes. If your question is "will I get the same number from -s if I
move this file to a different filesystem?" then the answer is perhaps. It
depends on the filesystems, the file type and the transfer method.
If you move an ASCII file between Unix and DOS systems using FTP, most FTP
clients are intelligent enough to convert between the differing line end
representations. You'll then end up with a file that has one byte more (or
less, depending on which way you're going) for each line in the file.
hth,
Dave...
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 14 Jul 1998 13:37:09 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Recommend me Perl!
Message-Id: <6ofmu5$j5s$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
gabor@vmunix.com (Gabor) writes:
:Just curious, but why does it bother you so much. Once you even sent me
:email correcting me because I had you last for Programming Perl. As if
:that makes any difference.
It's quite simple, really: it's about giving credit where credit is due.
If you gave your life and time and blood to something until it made you
physically ill, I dare suspect that you too would prefer that it were
proPERLy attributed. :-)
--tom
--
"If you only have a nail, you tend to see every hammer as a problem."
--Larry Wall
------------------------------
Date: Tue, 14 Jul 1998 14:22:19 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Recommend me Perl!
Message-Id: <35ac6876.5781625@news.tornado.be>
c960901@student.dtu.dk wrote:
>Can it scan a directory for subdirs and
>files and return the names in a string array? Cause that's what I really
>need.
Sure it can. Easily.
If you want a recursive search, you can even use a module: File::Find.
It's part of the standard distribution.
But if you really want some good reasons to use Perl instead of other
languages, here's two: regular expressions, and hashes (formerly known
as "associative arrays").
HTH,
Bart.
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3152
**************************************