[7189] in Perl-Users-Digest
Perl-Users Digest, Issue: 814 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 5 01:07:16 1997
Date: Mon, 4 Aug 97 21:00:22 -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 Mon, 4 Aug 1997 Volume: 8 Number: 814
Today's topics:
Re: "Powered by Perl" logo found. Details inside. <rkd7949@ballard.ca.boeing.com>
Re: all subs in one file or many? speed differences <gwhassan@prodigy.net>
Are subs in a modules predeclared? <chris@ixlabs.com>
Re: Buy any Perl book in print <tom@mitra.phys.uit.no>
Re: cpu strain <rootbeer@teleport.com>
Determining the most efficient method of... (ucs)
filtering CR & CRLF from file <shane@fammed.ohio-state.edu>
Re: filtering CR & CRLF from file ("John Dallman")
Re: function pointer dereferencing <tom@mitra.phys.uit.no>
Re: function pointer dereferencing (Pete Jordan)
Re: help: "easy" select distinct routine... (Tina Marie Holmboe)
Re: How to check if a variable is defined, without usin (Chris Schleicher)
Inserting within a string? (Burt Lewis)
Re: Perl : Is there a HOWTO somewhere ? <rootbeer@teleport.com>
Re: Read ahead in file <rootbeer@teleport.com>
Saving the state of a form from invocation to invocatio qnainfo@mindspring.com
Simple Socket Question <tech@penn.com>
Re: Sorting a password file <rootbeer@teleport.com>
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
sysread of tape on IRIX-6.2 (NOT CGI related!) (Will Morse)
Text formatting <troy@sba.miami.edu>
Re: Trouble With : Delimited Database <rootbeer@teleport.com>
Re: Trouble With : Delimited Database <philen@ans.net>
Using 'chmod' in a script to protect data files... <wef@miso.wwa.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 4 Aug 1997 22:01:44 GMT
From: "Richard K. Downer" <rkd7949@ballard.ca.boeing.com>
Subject: Re: "Powered by Perl" logo found. Details inside.
Message-Id: <33E65148.5CC2@ballard.ca.boeing.com>
Viper wrote:
>
> http://www.4images.com/ntperl has a "Powered by Perl for Win32" logo
> on the main page. This logo may be freely used as long as the ALT
> tag is used with the image and its states "Logo by 4images.com".
>
> A small price to pay for use of the logo.
Hmmmm.... It says on this web site that "O'Reilly said we can't use
camels on this site... So we use Rhinos." How many people think of Perl
when they see a Rhino?
This is very odd, considering that O'Reilly uses 18th and 19th century
woodcuts for their covers because they are in the public domain and thus
O'Reilly doesn't have to worry about copyrights. How can O'Reilly
prevent anyone from using the image of a camel in connection with Perl?
In connection with a book about Perl, maybe. Given the public domain
source of their cover art, how can they even prevent someone else from
using the exact same woodcuts?
--
Rick Downer
rkd7949@ballard.ca.boeing.com
These opinions are not mine, they're Boeing's. Boeing paid me while I
opined them, so Boeing owns them. But Boeing might not agree with them.
------------------------------
Date: Mon, 04 Aug 1997 20:35:19 -0500
From: Greg Hassan <gwhassan@prodigy.net>
To: dboorstein@ixl.com
Subject: Re: all subs in one file or many? speed differences
Message-Id: <33E68357.F961BC5F@prodigy.net>
Dan Boorstein wrote:
> hello all,
>
> i have a good size script (=~ 1200 lines) which contains about 75
> subroutines. i am wondering how this affects start up time
> on the script. since any single execution of the script only calls
> 10 - 15 of the subs, is there considerable extra overhead during
> compiling and initialization due to the 60 - 65 unused subs?
I usually do if statements with require's for only the necessary code.
when scripts start to get too big. I think it makes a difference in
load time
but I have not run any time tests.
-Greg
--
===============================================================
Greg Hassan, Web Developer
The Independent Solution (CGI, Java, C, Perl, Oracle)
http://www.hassan.com/, 1-701-235-3239
===============================================================
Need a cool gift? http://www.hassan.com/cooie/
Or add your favorite url here: http://www.hassan.com/urlsaver/
===============================================================
------------------------------
Date: Mon, 04 Aug 1997 11:26:47 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Are subs in a modules predeclared?
Message-Id: <33E61EE7.2435@ixlabs.com>
I noticed I do not have to use () after my argumentless subs called from
modules. e.g. Module->Dostuff;
Is this because they are automatically predeclared?
------------------------------
Date: 04 Aug 1997 16:25:30 +0000
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: Buy any Perl book in print
Message-Id: <nqod8ntgbk5.fsf@mitra.phys.uit.no>
ikrakow@shore.net (Ira Krakow) writes:
> OK. Which Perl books are the best?
That's a FAQ.
See http://www.perl.com/perl/critiques/
> Ira
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Mon, 4 Aug 1997 17:09:30 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "Ekim E. YARDIMLI" <tetnys@ibm.net>
Subject: Re: cpu strain
Message-Id: <Pine.GSO.3.96.970804165533.12101F-100000@kelly.teleport.com>
On Mon, 4 Aug 1997, Ekim E. YARDIMLI wrote:
> i'm planing to build a 20000 entries two dimensional array file, and
> would like to do a search though this file, though i don't have a clue
> about how much cpu power it will take to do this search.
> I'm planing to use a remote host, and wonder if this might cause any
> harm to the rest of the os?
Yep, it might. :-)
A lot depends upon the efficiency of your algorithm and the data in the
file. Imagine if you have to find a book in a library where books are
shelved according to the Dewey Decimal system - but all you know is that
the tenth word on page 67 is "thimble". There the indexing is very poor
for the data you have to search on. But if you knew folks would be looking
for books by the words on a certain page, you could organize a good index
of those words, making it fast and efficient. (The index, on the other
hand, might become as voluminous as the rest of the library. Something has
got to give.)
Analogously, if you can index your file according to its searching needs,
that would be a big help. There are some Perl modules which may help with
this, or you could make your own.
Of course, you can keep from overloading the system by allowing no more
than one concurrent search and by lowering the priority of the process.
This may have undesirable side effects, though. :-)
For good searching, indexing, and sorting algorithms, check out Knuth's
book on the subject. But this isn't really on-topic for c.l.p.misc, since
this isn't a Perl problem (and I'm giving you no Perl code, as I'm sure
you've noticed). It seems to be a Computer Science question, so that would
be a different place than this newsgroup (even though you intend (wisely!)
to implement your solution in Perl). It's analogous to wanting to know a
good route to drive your Toyota to Disneyland: It's not a Toyota question,
and it's barely a Disneyland question.
Good luck with your project!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 04 Aug 1997 11:24:00 -0800
From: ucs@<europa.com> (ucs)
Subject: Determining the most efficient method of...
Message-Id: <ucs-ya02408000R0408971124000001@199.2.194.10>
In reading the posts in the NG, I frequently encounter comments regarding
execution speed and resource consumption:
1) So, are there any general rules for figuring this out on my own?
e.g. use system programs like sort when they're available.
2) Suggestion to authors / editors:
How about a summary appendix on optimizing your code for processing time
and / or memory use? The one true holy tome has plenty of suggestions
sprinkled throughout the book, but I'm looking for an organizational
change, not a content change.
(Yeah, I know optimizing is a nebulous word, I used it purposely. I
wouldn't want to limit suggestions to whatever my imagination can produce.)
------------------------------
Date: 4 Aug 1997 19:45:18 GMT
From: Shane Zatezalo <shane@fammed.ohio-state.edu>
Subject: filtering CR & CRLF from file
Message-Id: <5s5bge$8tj$1@charm.magnus.acs.ohio-state.edu>
Anyone have an easy way to filter a file
to change to<->from cr & crlf?
I've got a few datafiles that I need to import
into a minisql & perl database. However, the
files came from the messydos world. When my perl
program goes through them to get the data
out of them, sometimes it gets caught up on the
^M's (emacs show's em).
The files are huge, so editting them by hand
is not something I want to do.
I tried something like this, but it didn't work:
#!/usr/bin/perl -w
$datadir="/home/shane/datafiles";
open (INFILE,"$datadir/b3") || die "cannot open file";
open (OUTFILE,">$datadir/b4") || die "cannot open file";
$line = <INFILE>;
$new ="\r";
$orig ="\n";
while ($line ne "")
{
$line =~ s/$orig/$new/g;
print OUTFILE ($line);
$line = <INFILE>;
}
close (INFILE) || die "cannot close file";
close (OUTFILE) || die "cannot close file";
exit;
------------------------------
Date: Mon, 4 Aug 1997 20:53:04 GMT
From: jgd@cix.compulink.co.uk ("John Dallman")
Subject: Re: filtering CR & CRLF from file
Message-Id: <EEEq0G.CxA@cix.compulink.co.uk>
In article <5s5bge$8tj$1@charm.magnus.acs.ohio-state.edu>,
shane@fammed.ohio-state.edu (Shane Zatezalo) wrote:
> Anyone have an easy way to filter a file
> to change to<->from cr & crlf?
>
> I've got a few datafiles that I need to import
> into a minisql & perl database. However, the
> files came from the messydos world. When my perl
> program goes through them to get the data
> out of them, sometimes it gets caught up on the
> ^M's (emacs show's em).
To transform MS-DOS format to UNIX format:
s/\r\n/\n/;
To reverse, s/\n/\r\n/;
Or if on DOS/Windows/NT, creative use of binmode() allows you to do it
automatically.
---
John Dallman, jgd@cix.co.uk. A micro-FAQ on things I keep getting asked:
#!perl is at ftp://.../CPAN/ports/msdos/tips-tricks/hbp_403.zip, Perl for
NT/Win 95 can be found at http://www.activeware.com, with an excellent FAQ
file at http://www.endcontsw.com/people/evangelo/Perl_for_Win32_FAQ.html
and no, I don't have the slightest idea what's wrong with your CGI script.
Try http://www.perl.com/perl/faq/idiots-guide.html
------------------------------
Date: 04 Aug 1997 13:09:49 +0000
From: Tom Grydeland <tom@mitra.phys.uit.no>
Subject: Re: function pointer dereferencing
Message-Id: <nqohgd6f61u.fsf@mitra.phys.uit.no>
Randal Schwartz <merlyn@stonehenge.com> writes:
> You didn't take that far enough:
>
> sub {
> print "hello, ", (join ", ", @_), "!\n";
> } -> qw(Tom Randal Larry);
>
I've been playing with this for a few days now. I have this to contribute:
sub AUTOLOAD{print}map{$_->($_)}split//=>"Just another Perl hacker,";
> Eeek. Eeek.
Indeed.
> Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Mon, 04 Aug 1997 19:12:37 GMT
From: pete@horus.cix.vapethis.co.uk (Pete Jordan)
Subject: Re: function pointer dereferencing
Message-Id: <memo.19970804201238.41895A@horus.cix.co.uk>
Tom Grydeland <tom@mitra.phys.uit.no> obfuscated:
> sub AUTOLOAD{print}map{$_->($_)}split//=>"Just another Perl hacker,";
Nice one :)
I /love/ this language...
Pete Jordan
= = = = = = = = = = = = = = = = = = = = = = =
Horus Communications
http://www.horus.cix.co.uk/
= = = = = = = = = = = = = = = = = = = = = = =
"'Not twisted,' Salzy once said of her own
passion, 'it is helical. That sounds better.'"
------------------------------
Date: 4 Aug 1997 12:36:00 GMT
From: tina@scandinaviaonline.se (Tina Marie Holmboe)
To: jorgen.gustafsson@emw.ericsson.se (Jvrgen Gustafsson)
Subject: Re: help: "easy" select distinct routine...
Message-Id: <5s4ibg$5f0$1@news1.sol.no>
[Posted and mailed]
In article <33e590e4.7311873@news>,
jorgen.gustafsson@emw.ericsson.se (Jvrgen Gustafsson) writes:
> Hello, can someone help me out with a "select distinct" routine:
Not impossible :)
> Guess that this is pretty simple (but not simple enough for me...)
> My "infile.txt" containing the following:
>
>
> 121.1.224.14,row1
> 121.1.224.14,row2
> 22.14.156.67,row3
> 54.89.23.63,row4
> 54.89.23.63,row5
> 54.89.23.63,row6
>
> wan't to do a select distinct on the IP-Adress column and save the
> result to a new file like below (all other lines discarded):
>
>
> 121.1.224.14,row1
> 22.14.156.67,row3
> 54,89,23,63,row4
This is typically one of those problems which associated arrays solve
almost by itself. As you know, an associated array uses strings as its
index'es - distinct strings. This means you can:
1) Read in the datafile, and
2) Split each line into two fields, eg.
field1=121.1.224.14
field2=row1
3) Hash this on field1, thusly:
$array_to_use{$field1} = $field2 ;
when you are done, the array will contain what you want.
> (Please reply by email if possible...)
As per request.
--
Tina Marie Holmboe tina@mail.scandinaviaonline.se
The opinions expressed above are mine, and should in no way or under any
circumstances be associated with Scandinavia Online AB unless this disclaimer
is explicitly revoked.
------------------------------
Date: 4 Aug 1997 14:14:42 -0700
From: chrissch@cs.uoregon.edu (Chris Schleicher)
Subject: Re: How to check if a variable is defined, without using eval????
Message-Id: <5s5go2$ctl@psychotix.cs.uoregon.edu>
In article <xz2204qnlmo.fsf@uebemc.siemens.de>,
Ronald Fischer <rovf@earthling.net> wrote:
>I can do that with
> if(eval "defined \$$name") { ... }
>but since I try to bypass eval whenever possible, I would like to know
>if there is a solution that does not use eval?
Why do you think you need eval()?
[~] 378 % perl -de 1
Loading DB routines from perl5db.pl version 1
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 1
DB<1> $name = 'foo'
DB<2> $foo = 5
DB<3> print defined $$name
1
DB<4> undef $foo
DB<5> print defined $$name
DB<6>
Hope this helps,
--Chris
--
Chris Schleicher Office: 541/346-3998
Univ of Oregon CIS GTF email: chrissch@cs.uoregon.edu
URL: http://www.cs.uoregon.edu/~chrissch/
------------------------------
Date: 4 Aug 1997 18:01:56 GMT
From: Burt lewis@ici.net (Burt Lewis)
Subject: Inserting within a string?
Message-Id: <5s55ek$nj1$1@bashir.ici.net>
I think this is simple, but once again I can't seem to get it.
I have a string: aaaaaaaaaaaaaa
I want to insert the letter x after the 5th a
new string: aaaaaxaaaaaaaaa
Appreciate any help on this.
Burt Lewis
burt@ici.net
------------------------------
Date: Mon, 4 Aug 1997 10:58:28 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Kevin Sik <sikwyk@cs.curtin.edu.au>
Subject: Re: Perl : Is there a HOWTO somewhere ?
Message-Id: <Pine.GSO.3.96.970804105734.27878Q-100000@kelly.teleport.com>
On Mon, 4 Aug 1997, Kevin Sik wrote:
> I am starting out to learn Perl. I was thinking to resort to buying a
> book but is there any good -concise-freely available manual available
> besides the man pages ?
If you have questions about Perl after you've looked at the docs and FAQs
available through CPAN, please post your questions here. Thanks!
http://www.perl.com/CPAN/
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 4 Aug 1997 09:32:55 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mark Guz <mguz@sol.co.uk>
Subject: Re: Read ahead in file
Message-Id: <Pine.GSO.3.96.970804093220.27878J-100000@kelly.teleport.com>
On Mon, 4 Aug 1997, Mark Guz wrote:
> What I would like to do is at one point in the loop is look at the
> next line in the file and compare it with the current line
You probably want to use seek() and tell(), both documented in
perlfunc(1). Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 04 Aug 1997 22:41:12 -0600
From: qnainfo@mindspring.com
Subject: Saving the state of a form from invocation to invocation
Message-Id: <870751758.16780@dejanews.com>
Is there a cgi script in Perl that will allow me to pass
information on a form from page to page each time the
order form is accessed until it is filled out with the
collected information?
Right now, when I invoke the form, I get an entirely new
form with no previous input.
Do you know of anyone I can contact that will incorporate
the necessary scripts into my web pages for a reasonable
price?
Thank you,
Robert
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Mon, 04 Aug 1997 13:46:37 +0000
From: Technical Support <tech@penn.com>
Subject: Simple Socket Question
Message-Id: <33E5DD3F.1FBD60AF@penn.com>
Anybody know why I can not do the following:
I am trying to write a scoket based program that will spit out some
text, ask the user for a name, and spit out user related text. What
happens is that when I run the program, the socket is opened, it does
the input and then spits out ALL of the text (before and after). I have
the code written so it should print, then read, then print, but it seems
to like to read first. any ideas?
Cliff Friedel
cfriedel@penn.com
PS- I am writing and reading to the socket like a filehandle if this
helps the problem at all. Thanks.
------------------------------
Date: Mon, 4 Aug 1997 12:21:09 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: paries@advicom.net
Subject: Re: Sorting a password file
Message-Id: <Pine.GSO.3.96.970804121920.16467F-100000@kelly.teleport.com>
On Mon, 4 Aug 1997 paries@advicom.net wrote:
> Thanks for any help or pointers to doc.
http://www.perl.com/perl/faq/
http://www.perl.com/perl/
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 4 Aug 1997 19:35:30 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <5s5au2$74u$1@info.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 26 Jul 1997 09:28:37 GMT and ending at
02 Aug 1997 09:24:40 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" e-mail address and name.
- Original Content Rating is the ratio of the original content volume
to the total body volume.
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Find the NewsScan junkyard at http://www.cs.uah.edu/~gbacon/clpm/
Excluded Posters
================
perlfaq-suggestions@mox.perl.com
Totals
======
Total number of posters: 454
Total number of articles: 1021 (328 with cutlined signatures)
Total number of threads: 405
Total volume generated: 1682.3 kb
- headers: 690.1 kb (13,941 lines)
- bodies: 922.4 kb (29,018 lines)
- original: 648.0 kb (21,162 lines)
- signatures: 67.4 kb (1,333 lines)
Original Content Rating: 0.7025
Averages
========
Number of posts per poster: 2.2
Number of posts per thread: 2.5
Message size: 1687.2 bytes
- header: 692.2 bytes (13.7 lines)
- body: 925.1 bytes (28.4 lines)
- original: 649.9 bytes (20.7 lines)
- signature: 67.6 bytes (1.3 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
76 136.9 ( 64.2/ 59.7/ 39.7) Tom Phoenix <rootbeer@teleport.com>
33 61.3 ( 19.4/ 31.5/ 19.7) Mike Stok <mike@stok.co.uk>
25 44.6 ( 17.4/ 27.2/ 15.7) Tad McClellan <tadmc@flash.net>
20 34.2 ( 14.9/ 19.2/ 9.8) Simon Fairey <sfairey@adc.metrica.co.uk>
19 33.2 ( 13.5/ 19.7/ 11.4) Doug Seay <seay@absyss.fr>
18 23.8 ( 10.4/ 13.4/ 8.1) Aaron Sherman <ajs@lorien.ajs.com>
16 22.9 ( 8.6/ 14.3/ 8.3) Eric Bohlman <ebohlman@netcom.com>
15 25.6 ( 11.0/ 14.5/ 9.6) petri.backstrom@icl.fi
12 18.4 ( 8.8/ 9.6/ 5.2) Larry D'Anna <ldanna@hotmail.com>
12 25.7 ( 9.2/ 12.0/ 6.8) Randal Schwartz <merlyn@stonehenge.com>
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
136.9 ( 64.2/ 59.7/ 39.7) 76 Tom Phoenix <rootbeer@teleport.com>
61.3 ( 19.4/ 31.5/ 19.7) 33 Mike Stok <mike@stok.co.uk>
44.6 ( 17.4/ 27.2/ 15.7) 25 Tad McClellan <tadmc@flash.net>
34.2 ( 14.9/ 19.2/ 9.8) 20 Simon Fairey <sfairey@adc.metrica.co.uk>
33.2 ( 13.5/ 19.7/ 11.4) 19 Doug Seay <seay@absyss.fr>
25.7 ( 9.2/ 12.0/ 6.8) 12 Randal Schwartz <merlyn@stonehenge.com>
25.6 ( 11.0/ 14.5/ 9.6) 15 petri.backstrom@icl.fi
23.8 ( 10.4/ 13.4/ 8.1) 18 Aaron Sherman <ajs@lorien.ajs.com>
23.7 ( 1.3/ 22.4/ 20.1) 2 "Lior" <toot@inter.net.il>
22.9 ( 8.6/ 14.3/ 8.3) 16 Eric Bohlman <ebohlman@netcom.com>
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
------ -------------- ----- -------
1.0000 0.8 / 0.8 3 Leonid Lamburt <leonid@cs.bu.edu>
1.0000 1.8 / 1.8 3 William [Billy] Harrison <harrison@ug.cs.dal.ca>
1.0000 1.7 / 1.7 3 Chris Nandor <pudge@pobox.com>
0.9981 1.6 / 1.6 3 Brett Denner <Brett.W.Denner@lmtas.lmco.com>
0.9959 0.7 / 0.7 3 Ricardo Marek <ricky@ornet.co.il>
0.9626 1.1 / 1.1 3 Burt Lewis <burt@ici.net>
0.9215 1.2 / 1.3 3 Bart Lateur <bart.mediamind@tornado.be>
0.9191 9.5 / 10.3 6 Nathan V. Patwardhan <nvp@shore.net>
0.9101 0.9 / 1.0 4 Jay Eckles <eckje@rhodes.edu>
0.9041 1.4 / 1.5 3 Mark Schwartz <mcs@in.net>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
------ -------------- ----- -------
0.4201 0.8 / 2.0 3 Jay Rogers <jay@rgrs.com>
0.4196 0.9 / 2.2 5 A. Deckers <I-hate-cyber-promo@man.ac.uk>
0.4112 1.5 / 3.6 4 Michael Ching <MChing@POBoxes.com>
0.3967 1.0 / 2.5 4 brian d foy <comdog@computerdog.com>
0.3935 3.6 / 9.1 11 Thomas Lachlan XMS x4206 <etltsln@etlxd30.ericsson.se>
0.3866 1.7 / 4.4 4 "John Bokma" <jbokma@caiw.nl>
0.3629 1.4 / 3.7 5 Darin Burleigh <burleigh@hackberry.chem.niu.edu>
0.3432 3.8 / 10.9 10 Charles DeRykus <ced@bcstec.ca.boeing.com>
0.1990 0.4 / 2.3 3 Glenn West <westxga@ptsc.slg.eds.com>
0.1626 1.0 / 6.1 3 kraina@geocities.com
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
36 Too many people in this group are arrogant #*(@# (Re: Checking for valid Email...)
18 Unix time, local time, year 2000 question.
11 security holes in perl 5.00401 @_@
10 interesting sorting problem
10 comment
10 HELP: perl 5.001 WinNT
9 Print Web Page a la netscape
9 [Q] Checkbox forms in Perl
9 Stripping ^M from a variable. How?
8 comments in regular expressions (wish list)
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
75.0 ( 32.9/ 37.9/ 22.6) 36 Too many people in this group are arrogant #*(@# (Re: Checking for valid Email...)
31.4 ( 13.5/ 16.1/ 10.0) 18 Unix time, local time, year 2000 question.
24.6 ( 1.5/ 23.0/ 20.2) 2 Help: Form2mail
20.6 ( 8.4/ 11.4/ 7.8) 11 security holes in perl 5.00401 @_@
18.5 ( 4.5/ 13.6/ 7.9) 5 Why does perl do this?
16.9 ( 6.8/ 10.0/ 5.4) 10 interesting sorting problem
14.8 ( 6.6/ 7.9/ 5.8) 9 Print Web Page a la netscape
14.2 ( 5.3/ 8.6/ 3.9) 8 file extensions
14.2 ( 0.6/ 13.5/ 13.5) 1 File::Find bugs (and patches)
13.3 ( 5.2/ 7.7/ 4.6) 7 Trouble With : Delimited Database
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
19 comp.lang.perl.modules
5 comp.lang.perl
4 comp.mail.misc
4 comp.databases.sybase
4 comp.lang.javascript
4 uchi.comp.unix
3 alt.fan.e-t-b
3 comp.unix.questions
2 misc.forsale.computers.pc-specific.misc
2 comp.databases
Top 10 Crossposters
===================
Articles Address
-------- -------
8 Richard E. Depew <red@redpoll.mrfs.oh.us>
4 cflam@hk.super.net
3 Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
3 "Eric D. Friedman" <friedman@uci.edu>
3 mlm47@columbia.edu
3 Ricardo Marek <ricky@ornet.co.il>
2 Dick Adams <rdadams@access5.digex.net>
2 vas@vas.tsu.tomsk.su
2 Soren Dayton <csdayton+usenet@cs.uchicago.edu>
2 "Ron L. Helms" <helmrl@aur.alcatel.com>
------------------------------
Date: 4 Aug 1997 13:40:45 -0500
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: sysread of tape on IRIX-6.2 (NOT CGI related!)
Message-Id: <5s57nd$l54$1@Starbase.NeoSoft.COM>
Hi,
I am trying to read 8mm tapes on an SGI Power Challenge using either
read or sysread. I have done this before with success when I knew
the blocksize up front, but in this program, which is basically
a tape copy not unlike the BSD tcopy program except with some
extra smarts for certain formats of tapes.
The problem is that I do not know the blocksize of the tapes up front.
I need to discover the size as I read the tape. The tape may
also have varying sizes of blocks. It may also have several files
stacked on the tape and I need to read to a double eof.
I am thinking sysread instead of read as I don't want the buffering.
What I have tried is the sysread command with a huge blocksize,
which as I read the perl books (Programming Perl, 2ed) I should
be able to do
#This is a contrived snippit, not may actual code
open (IN,"</dev/rmt/tps130d5nsv");
$blocksize = 64 * 1024;
$count = -1;
while ($count != 0 )
{
$count = sysread (IN, $block, $blocksize);
print "$count\n";
}
and sysread should read $blocksize bytes into $block and if it can't
read them all tell me how many it did get in $count. I am getting
$count == undef, and nothing in the block. I tried a length($block)
to be sure that I am not getting anything despite the error indicated
by $count == undef.
I am getting some whining on the system console which tells me the
blocksizes don't match, and tells me what the actual blocksize is,
which is similar to how the tcopy program in BSD works, but I
can't figure how to get this to tell my program and not bother
the console.
Perhaps I am going about this in the wrong way. I would be very open
to suggestions.
Thanks in advance.
Will
--
# Copyright 1997 Will Morse. Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
#
# Gravity, # Will Morse
# not just a good idea, # Houston, Texas
# it's the law. # will@starbase.neosoft.com
#
# These are my views and do not necessarly reflect anyone else/
------------------------------
Date: Mon, 4 Aug 1997 10:57:45 -0400
From: Troy Poppe <troy@sba.miami.edu>
Subject: Text formatting
Message-Id: <Pine.OSF.3.96.970804105436.20204A-100000@homer.bus.miami.edu>
Im using the format NAME = ... structure to generate some HTML tags,
unfortunately, I am being forced to use @<< in the NAME="" part of the
HTML tag, and this is causing my INPUTs to a form to come out with spaces
if the value of the variable I am putting into this particular field is
not 3 characters long. Is there a zero supression field for the format
tag? or is there another way to produce properly formatted text (based
upon a certain cloumn, instead of a tab separated field.)?
Thanks... Much appreciated.
-----
Troy Poppe School of Business
Unix Support and Software Development
Systems Administrator University of Miami
------------------------------
Date: Mon, 4 Aug 1997 09:31:44 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Armando Ortiz <aortiz@vcnet.com>
Subject: Re: Trouble With : Delimited Database
Message-Id: <Pine.GSO.3.96.970804092500.27878I-100000@kelly.teleport.com>
On Mon, 4 Aug 1997, Armando Ortiz wrote:
> Ok...here's what I now have as the script:
>
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs){
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%(a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $FORM{$name} = $value;
> }
Hasn't somebody already told you that you're doing this the hard way?
(And, perhaps, the wrong way.) You should really use CGI.pm.
> open (NAMES,"data.dat");
Got to check that return value.
open NAMES, "data.dat"
or die "Can't read data.dat: $!";
> while (<NAMES>) {
> ($fname,$lname,$address,$zip) = split(':',$_);
> if ($zip =~ /$FORM{$buffer}/) {
What's $FORM{$buffer}? If you had turned on warnings (hint, hint) Perl
should have reminded you that you're using an uninitialized value. I think
you meant $FORM{zip}, or something like that. But you probably didn't
really want to use a regular expression anyway. (Did you know that that
code could crash your script?)
next unless $zip eq $FORM{zip}; # Maybe this?
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 4 Aug 1997 15:26:48 -0400
From: Phillip Lenhardt <philen@ans.net>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Trouble With : Delimited Database
Message-Id: <Pine.GSO.3.95.970804152122.1295B-100000@earn.aa.ans.net>
On Mon, 4 Aug 1997, Tom Phoenix wrote:
> On Mon, 4 Aug 1997, Armando Ortiz wrote:
>
> > Ok...here's what I now have as the script:
> >
> > read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> > @pairs = split(/&/, $buffer);
> > foreach $pair (@pairs){
> > ($name, $value) = split(/=/, $pair);
> > $value =~ tr/+/ /;
> > $value =~ s/%(a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> > $FORM{$name} = $value;
> > }
>
> Hasn't somebody already told you that you're doing this the hard way?
> (And, perhaps, the wrong way.) You should really use CGI.pm.
>
> > open (NAMES,"data.dat");
>
> Got to check that return value.
>
> open NAMES, "data.dat"
> or die "Can't read data.dat: $!";
I think in general it is a bad idea to use die in a script that is sending
html unless you have already sent the header (ie. Content-type:
text/html\n)) since whoever is trying to access the page when die gets
called is going to experience a hang. Even then, what end user wants to
see you diagnostic message? I would recommend using the Carp.pm module or
writing your own subroutine/package for handling errors in cgi scripts.
------------------------------
Date: Mon, 04 Aug 1997 13:51:22 -0500
From: Wef <wef@miso.wwa.com>
Subject: Using 'chmod' in a script to protect data files...
Message-Id: <33E624AA.7A50@miso.wwa.com>
Suppositions:::
You have a data file that is opened for reading from a CGI script.
You don't want the data file to be opened via a browser command line.
You don't want to lock the data file.
Questions:
Can you use the 'chmod' command in the script to set the "read"
permission before the script opens a data file? And then can you
reset the permissions on the data file, so it can't be read by anyone?
--------------------------------
Here's the code:
# The OPEN_DATAFILE subroutine
# Open the datafile and put each line into and array
sub open_datafile {
# set the permissions for the $datafile so the script can read it...
chmod 0604, $datafile;
open(FIRMFILE,"$datafile") || die "Can't open $datafile.\n";
# Put each line in datafile into an array called @lines
@lines = <FIRMFILE>;
close(FIRMFILE);
# set the permissions for the $datafile so no-one can read it...
chmod 0600, $datafile;
}
--------------------------------
------------------------------
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 814
*************************************