[6450] in Perl-Users-Digest
Perl-Users Digest, Issue: 75 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 8 15:07:11 1997
Date: Sat, 8 Mar 97 12: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 Sat, 8 Mar 1997 Volume: 8 Number: 75
Today's topics:
Re: Awk to perl (Tad McClellan)
Field Separators <trobison@erols.com>
Re: Field Separators <trobison@erols.com>
Re: Forms AHHHH...Help !!! (Jules Bean)
Help! Simple Question: Error 501: "Not Supported" (---)
Re: HELP!?! - Perl from UNIX shell??? <zenin@best.com>
Re: Newbie recursion question <fawcett@nynexst.com>
Re: pattern matching question <fawcett@nynexst.com>
Perl made in WinNT to run on UNIX <audible@fox.nstn.ca>
Re: Perl5 references question <merlyn@stonehenge.com>
Re: Possible bug in regular expression form /\d{x,x}/ (Jeffrey)
Re: Possible bug in regular expression form /\d{x,x}/ (Eric Bohlman)
Re: Possible bug in regular expression form /\d{x,x}/ (Eric Bohlman)
Re: putting a text comment space (I R A Aggie)
Re: RAND/SRAND query (Eric Bohlman)
Re: Reading from a file in an array arbitrary ???? <jstrick@mindspring.com>
Regex searches in all files (or selected files) in a di <parkhurs@indiana.edu>
Re: Regex searches in all files (or selected files) in (Nathan V. Patwardhan)
Regular Expression <ccng@nortel.ca>
Re: Regular Expression <ccng@nortel.ca>
Re: Regular Expression <tchrist@mox.perl.com>
Re: Socket timeout implementation on PERL5/Win32 withou (Nathan V. Patwardhan)
sockets: non-blocking accept on BSDOS (Dale Wyttenbach)
Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
utmp/wtmp under Perl (John Goerzen)
Re: utmp/wtmp under Perl <tchrist@mox.perl.com>
Who makes more $$ - Windows vs. Unix programmers? (Future Programmer)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 8 Mar 1997 07:22:29 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Awk to perl
Message-Id: <l6prf5.bm.ln@localhost>
Winston Sia (win@ph.net) wrote:
: Dear Perl Experts:
^^^^^^^^^^^^
You don't need an expert. You can emulate an expert yourself by
taking advantage of the copious free documentation included with
the perl distribution.
Experts wrote them so that they wouldn't have to answer the
same question again and again and again and...
: How do I write the awk commands in Perl?
You write awk commands to a file, and then you run 'a2p' (awk to perl)...
: Below is a sample shell program which I intend to convert to Perl.
shell to perl needs to be done by a person though...
: I'd appreciate any help.
We would appreciate any effort on your part to answer your question
yourself before posting to thousands of computers around the entire
World...
_Included with the perl distribution_ are a bunch of files with a '.pod'
filename extension.
grep awk *.pod
finds only 36 lines. That doesn't seem like too much to read.
The fifth line says "a2p awk to perl translator".
Betcha that would be of help...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 06 Mar 1997 15:07:04 -0500
From: Terry Robison <trobison@erols.com>
Subject: Field Separators
Message-Id: <331F23E8.11D1@erols.com>
I have data in the form:
"248347554","90834598","This is a comment, sometime with multiple commas
inside","dategd","4545","transaction type","7459087"~
I am trying to set the FS equal to ",", including the quotes.
I set FS="\",\"" and print FS. It appears to be ",", but fields break on
a single ".
Can I set a multiple character FS?
Thanks,
T Robison
------------------------------
Date: Thu, 06 Mar 1997 15:14:51 -0500
From: Terry Robison <trobison@erols.com>
Subject: Re: Field Separators
Message-Id: <331F25BB.80F@erols.com>
Terry Robison wrote:
>
> I have data in the form:
>
> "248347554","90834598","This is a comment, sometime with multiple commas
> inside","dategd","4545","transaction type","7459087"~
>
> I am trying to set the FS equal to ",", including the quotes.
>
> I set FS="\",\"" and print FS. It appears to be ",", but fields break on
> a single ".
>
> Can I set a multiple character FS?
>
> Thanks,
> T Robison
My Apologies, wrong newsgroup......
------------------------------
Date: Sat, 08 Mar 1997 14:26:02 -0700
From: jules@mailbox.co.uk (Jules Bean)
Subject: Re: Forms AHHHH...Help !!!
Message-Id: <jules-0803971426020001@thoth.trin.cam.ac.uk>
> >The enctype attribute just will make sure the returned information is
> >written in plain text, and not raw ASCII.
[off-topic: sorry...]
This is the kind of comment guaranteed to confuse newbies!!!
ASCII is plain text... I don't really know what point you're making...
ASCII is a way of encoding plain text in the numbers that computers use
internally, an almost all current computer systems, and the internet, use
ASCII as a text system....
Jules Bean
------------------------------
Date: Sat, 08 Mar 1997 21:43:33 GMT
From: bailey766@aol.com (---)
Subject: Help! Simple Question: Error 501: "Not Supported"
Message-Id: <5fsc7e$4f7@dfw-ixnews4.ix.netcom.com>
I have the Perl interpreter installed on my NT 4.0 server running IIS
3.0. I wrote a simple Perl script that simply writes a string to a
file when it is run (so that I know it was executed). I put together
a simple HTML file with a submit button that runs the Perl program
using the syntax:
<FORM METHOD=POST ACTION="filetest.pl">
<INPUT TYPE="SUBMIT">
</FORM>
etc etc.
When I load this page from my CLIENT machine, a Win95 box with
Internet Explorer 3.0, I get "Error 501- Not Supported". If I load it
using IE3.0 locally, from the SERVER, it thinks I want to download the
file.
Can anyone help out? Also, can anyone tell me where I can look up
these error messages myself? I waded through much of the online docs
and could not find the error codes listed. Is this an IE3.0 error or
a Server error?
Please forward a copy of your response to my email address if
possible.
Thanks!
------------------------------
Date: 8 Mar 1997 14:41:19 GMT
From: Zenin <zenin@best.com>
Subject: Re: HELP!?! - Perl from UNIX shell???
Message-Id: <5frtqf$t8a$1@nntp2.ba.best.com>
Steve <steve@alexandros.cperi.forth.gr> wrote:
: A simple question I hope - but I can't even get a basic PERL script or
: CGI to run from any UNIX shell. If I type in for example menu.cgi or
: menu at the prompt it would return menu.cgi - Command not found.
: I know the program works because it runs ok from within webpages.
: Thanks in advance.
: Steve
Does it run if you use the command:
perl menu.cgi
and/or
./menu.cgi
If so, then one or more of a few things need to happen. If it only
runs with the first command line, your script is not executible. Do
the command:
chmod 755 menu.cgi
If both work, it's (the menu.cgi program) is probably not in your
path.
If you are using csh or tcsh:
setenv PATH $PATH:.
If you are using a real shell like bash, sh, ksh, etc:
PATH=$PATH:.
Either way what they do is put the current directory in your path
so the shell can find the program.
--
Zenin Programing Consultant
Zenin @ Best . com Perl, JavaScript, Web Graphic Design
http://www.best.com/~zenin/ Just another Perl hacker
Spelling mistakes? Their couldn't be. -My modem is error correcting.
------------------------------
Date: 08 Mar 1997 09:09:34 -0500
From: Tom Fawcett <fawcett@nynexst.com>
Subject: Re: Newbie recursion question
Message-Id: <8jd8tascf5.fsf@nynexst.com>
ebohlman@netcom.com (Eric Bohlman) writes:
> Graham Cant (citadel@dircon.co.uk) wrote:
> : Can anyone tell me what is wrong with this piece of code:
>
> [snip]
>
> : sub tree {
> : local($d,$e) = ($_[0],$_[1]);
> ^^^^^
> This is most likely the problem; see below.
>
> : print "called tree with $d,$e\n";
> : if ($e !=0) {
> : $e=$e-1;
> : &tree($m{$d},$e);
> : print "returned $d,$e\n";
> : &tree($f{$d},$e);
> : print "returned $d,$e\n";
> : }
> : }
>
> : I'm trying to make a depth first search, and although the code works fine
> : in BASIC, Perl hates it. I can't get it to transverse back up the tree!
> : On the way down to the first branch the code behaves as expected, but the
> : values I get on the way back are garbage.
>
> Try using my instead of local. A local variable is in scope for any
> subroutine called from the block it's declared in, so when you
> recursively invoke tree, this assignment is trashing the caller's copies
> of $d and $e. With my, on the other hand, the recursive invocation would
> get its own copies of them.
This advice makes no sense to me. It's a simple recursive function so
lexical vs dynamic scoping shouldn't make a difference.
The only problem I found is that the input data isn't chopped, so the third
value (right-hand node name) keeps a newline, which screws up the tree data.
Adding a chop before the split fixed this, and the program seemed to
do the traversal correctly after that, as far as I traced.
In the future try using the -w flag. It won't tell you exactly what the
bug is, but it'll get pretty close.
-Tom
------------------------------
Date: 08 Mar 1997 09:18:54 -0500
From: Tom Fawcett <fawcett@nynexst.com>
Subject: Re: pattern matching question
Message-Id: <8j7mjisbzl.fsf@nynexst.com>
Lee William Jones <lj25+@andrew.cmu.edu> writes:
> I'm trying to do a relaxed pattern match -- i.e. given a string
> sequence, return position(s) where it matches at least x characters in
> the string.
>
> I checked the camel book, but didn't see any operators or syntax for
> something of this sort (perhaps I'm just blind). Short of enumerating
> the possibilities with wildcards filled in (a VERY ugly option) or
> writing another short program to enumerate them for me (still looks very
> ugly), I'm not sure what to do. Call me lazy, but I thought there was
> some built in way to do this.
It's hard to tell from your description, but I doubt there is anything
built-in that will do what you want. So check the modules list:
String::
::Approx Rdpf Approximate string matching and substitution JHI
-Tom
------------------------------
Date: 8 Mar 1997 18:16:30 GMT
From: "Brian Cohen" <audible@fox.nstn.ca>
Subject: Perl made in WinNT to run on UNIX
Message-Id: <01bc2bec$b365ca00$a711ba89@master>
Hi All!
I a very new person to Perl so maybe this question will seem kind of silly.
First of all I'm creating a Perl program in WinNT 4.0 that checks a user
ID that they input into a text box. But what I want to know is, when I
transfer the Perl program over to my ISP on their UNIX machine, will it
still run ok.
Regards,
Michael
audible@fox.nstn.ca
------------------------------
Date: 08 Mar 1997 06:44:09 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: breville@uoguelph.ca (Barry G Reville)
Subject: Re: Perl5 references question
Message-Id: <8cohcuqz12.fsf@gadget.cscaper.com>
>>>>> "Barry" == Barry G Reville <breville@uoguelph.ca> writes:
Barry> How do you dereference an array reference once its part of an array?
Barry> I know how to dereference under normal circumstances
Barry> eg - $arrayref = \@array;
Barry> @newarray = @$arrayref;
Barry> ..And now I have the array back! BUT..
Barry> If the reference is part of an array itself..
Barry> eg - @refarray = ($arrayref,$arrayref2);
Barry> @newarray = ?????;
Barry> And yes I do know how to get at the elements of the array one at a time
Barry> by saying
Barry> $val1 = $$refarray[0][0];
Barry> Please tell me the secret!
It's no secret. "man perlref" tells all. Generally, just write the syntax
of whatever you would normally write to access the data:
@SOMETHING
and now replace the name with a block that returns the reference:
@{$refarray[0]}
That's it. NAME => {REF}. Now, there are a few optimizations for the
common cases... like if REF is merely a scalar variable, you can omit
the braces, but it seems all you learned were the optimizations and
not the general rule. :-)
Other optimizations include ${THING}[0] => THING->[0] and
THING->[0]->[1] => THING->[0][1]. Again, you were already using
those.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 542 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 08 Mar 1997 14:50:42 GMT
From: jfriedl@tubby.nff.ncl.omron.co.jp (Jeffrey)
To: tchrist@mox.perl.com (Tom Christiansen)
Subject: Re: Possible bug in regular expression form /\d{x,x}/
Message-Id: <JFRIEDL.97Mar8235042@tubby.nff.ncl.omron.co.jp>
[mail and post]
Tom Christiansen <tchrist@mox.perl.com> wrote:
|> : if( @dog =~ /\d{5,5}/){
|
|> :When $dog is less that 5 digits the if evaluates to false. Since the
|> :upper limit is also 5. If there are more that 5 digits the if SHOULD
|> :evaluate to false.
|>
|> Oh no it won't.
|
|> Anchors would alter this: /^\d{5}$/
While that's not false, I think you meant \b...\b instead of ^...$ for the
problem at hand.
Jeffrey
----------------------------------------------------------------------------
Jeffrey Friedl <jfriedl@ora.com> Omron Corp, Nagaokakyo, Kyoto 617 Japan
See my Jap<->Eng dictionary at http://www.wg.omron.co.jp/cgi-bin/j-e
O'Reilly's Regular Expression book: http://enterprise.ic.gc.ca/~jfriedl/regex/
------------------------------
Date: Sat, 8 Mar 1997 18:13:39 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Possible bug in regular expression form /\d{x,x}/
Message-Id: <ebohlmanE6qLAr.B6o@netcom.com>
Jeffrey (jfriedl@tubby.nff.ncl.omron.co.jp) wrote:
: Tom Christiansen <tchrist@mox.perl.com> wrote:
: |> Anchors would alter this: /^\d{5}$/
: While that's not false, I think you meant \b...\b instead of ^...$ for the
: problem at hand.
Actaully, \D...\D would be more general, sense the digit string might be
embedded in alphabetics.
------------------------------
Date: Sat, 8 Mar 1997 18:36:39 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Possible bug in regular expression form /\d{x,x}/
Message-Id: <ebohlmanE6qMD3.CEz@netcom.com>
[cancelled and reposted to correct embarrasing spelling errors]
Jeffrey (jfriedl@tubby.nff.ncl.omron.co.jp) wrote:
: Tom Christiansen <tchrist@mox.perl.com> wrote:
: |> Anchors would alter this: /^\d{5}$/
: While that's not false, I think you meant \b...\b instead of ^...$ for the
: problem at hand.
Actually, \D...\D would be more general, since the digit string might be
embedded in alphabetics.
------------------------------
Date: Wed, 05 Mar 1997 09:41:42 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: putting a text comment space
Message-Id: <fl_aggie-ya02408000R0503970941420001@news.fsu.edu>
In article <331D9FE2.6589@tcac.com>, James <hydrotmp@tcac.com> wrote:
+ How would I go about putting in a textarea for a comment section at the
+ bottom of this form. I would like it to have four or five lines
+ available.
+ I have tried but all has failed.
+ This is my .html
[markup deleted]
What, precisely, does this have to do with perl?
James - call me clueless, if you like, but html questions will get
more and better answers in an html newsgroup...
--
Consulting Minster for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Sat, 8 Mar 1997 18:25:18 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: RAND/SRAND query
Message-Id: <ebohlmanE6qLu6.BoC@netcom.com>
Ron & Mary Stephens (asdrs2@gte.net) wrote:
: How then do I call a second random number that is truly random? So far
: I've been using the first random number as the SRAND seed for the second
: call, the second number for the third SRAND seed and so on. But this
: only results in a pattern that isn't truly random. i.e. the first
: number determines the second etc.
Camel, p.224:
"Do *not* call srand multiple times in your program unless you know
exactly what you're doing and why you're doing it. The point of the
function is to 'seed' the rand function so that rand can produce a
different sequence each time you run your program. Just do it once at
the top of your program, or you won't get random numbers out of rand!"
------------------------------
Date: Sat, 08 Mar 1997 13:04:02 -0500
From: John Strickler <jstrick@mindspring.com>
Subject: Re: Reading from a file in an array arbitrary ????
Message-Id: <3321AA12.3725C27B@mindspring.com>
John Strickler wrote:
[quote of question re: reading only part of a file into an array]
> This works for me:
>
> open(F,$some_file) or die("Oops");
> @stuff[0..9] = <F>; # read in 1st 10 lines
> print @stuff;
>
> Note that a list of arbitrary numbers can be used as the subscript to
> select any lines you
> want.
(replying to my own post).
Oops. Mea culpa. This method works, but of course <F> reads in the
_NEXT_ whatever lines, not the
ones selected by the subscripts of stuff. You can populate arbitrary
elements of @stuff, but
the lines come out of $file in normal order, no matter what. Thus,
@stuff[20..29] = <F>
still reads in the first 10 lines.
Sorry if I misled anyone.
--
John Strickler -- Perl/UNIX/C Trainer, Consultant
Jeffersonian Consortium Voice: 919-682-3401
HTTP://WWW.JCINC.COM Facsimile: 919-682-3369
------------------------------
Date: Sat, 08 Mar 1997 09:54:38 -0500
From: David Parkhurst <parkhurs@indiana.edu>
Subject: Regex searches in all files (or selected files) in a directory
Message-Id: <33217DAE.3D66@indiana.edu>
I'd like to use regex to search all *.txt files (say) in a particular
directory that match some pattern. I'm working in Windows95, and I'm a
novice with perl. Has someone written such a program, or could you
provide advice on how to do this (in Windows)?
Thanks for any help.
Dave Parkhurst
------------------------------
Date: 8 Mar 1997 18:41:59 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Regex searches in all files (or selected files) in a directory
Message-Id: <5fsbtn$mm2@fridge-nf0.shore.net>
David Parkhurst (parkhurs@indiana.edu) wrote:
: I'd like to use regex to search all *.txt files (say) in a particular
: directory that match some pattern. I'm working in Windows95, and I'm a
: novice with perl. Has someone written such a program, or could you
: provide advice on how to do this (in Windows)?
Why not use grep() which should be discussed in your documentation?
Ex:
$dir = "C:\\FOO\\BAR";
opendir(DIR, "$dir") || die("dir error: $!");
@entries = grep(/\.txt$/, sort(readdir(DIR))); #grab only .txt, not .txty
closedir(DIR);
print("Directory contained: @entries\n");
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Sat, 08 Mar 1997 10:22:36 -0500
From: Charles Ng <ccng@nortel.ca>
Subject: Regular Expression
Message-Id: <3321843C.73CA@nortel.ca>
What regular expression will match control-L? I don't have a perl book
handy. :(
Thanks,
Charles
------------------------------
Date: Sat, 08 Mar 1997 11:17:57 -0500
From: Charles Ng <ccng@nortel.ca>
Subject: Re: Regular Expression
Message-Id: <33219135.36CD@nortel.ca>
Charles Ng wrote:
>
> What regular expression will match control-L? I don't have a perl book
> handy. :(
Found a perl book and got it! It's /\f/
Charles
------------------------------
Date: 8 Mar 1997 17:25:34 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Regular Expression
Message-Id: <5fs7ee$5bb$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Charles Ng <ccng@nortel.ca> writes:
:What regular expression will match control-L? I don't have a perl book
:handy. :(
That's a very poor excuse: you have the online documentation.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
There is a need to keep from being locked into Open Systems. --IBM sales rep
------------------------------
Date: 8 Mar 1997 18:37:09 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Socket timeout implementation on PERL5/Win32 without alarm() (since it's not implemented ) ?
Message-Id: <5fsbkl$mm2@fridge-nf0.shore.net>
Gary (gniemcew@dti.net) wrote:
: Say I am connecting to a server as a client, I create a socket, bind
: and connect successfully, but the server sends nothing for a long
: while. My client is of course stuck at
: $var = <SOCKET>;
What are you sending the server? It might be waiting for you to send
something back to it, or even an additional \r\n.
When you output $var, what does it give you?
$var = <SOCKET>;
print("Server responded with: $var\n");
or even:
while(<SOCKET>) {
print;
}
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 8 Mar 1997 18:19:47 GMT
From: wytten@cs.umn.edu (Dale Wyttenbach)
Subject: sockets: non-blocking accept on BSDOS
Message-Id: <5fsak3$s9a@epx.cis.umn.edu>
The following perl5 snippet works on Solaris, but on BSDOS
accept always returns EAGAIN, even when it should detect a
connection.
#!/usr/local/bin/perl5 -Tw
require 5.002;
use strict;
BEGIN { $ENV{PATH} = '/usr/ucb:/bin' }
use Socket;
use Carp;
use Fcntl;
sub logmsg { print "$0 $$: @_ at ", scalar localtime, "\n" }
my $port = shift || 2345;
my $proto = getprotobyname('tcp');
socket(Server, PF_INET, SOCK_STREAM, $proto) or die "socket: $!\n";
setsockopt(Server, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)) or die "setsockopt: $!\n";
fcntl(Server, F_SETFL, O_NONBLOCK) || die "fcntl: $!";
bind(Server, sockaddr_in($port, INADDR_ANY)) or die "bind: $!\n";
listen(Server, SOMAXCONN) or die "listen: $!\n";
logmsg "server started on port $port";
my $paddr;
$SIG{CHLD} = \&REAPER;
while ( 1 ) {
$paddr = accept(Client, Server);
($! =~ /temporarily unavailable/) && next;
my($port, $iaddr) = sockaddr_in($paddr);
my $name = gethostbyaddr($iaddr, AF_INET);
logmsg "connection from $name at port $port";
print Client "Hello there, $name, it's now ", scalar localtime, "\n";
}
------------------------------
Date: 8 Mar 1997 17:55:52 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <5fs978$r12@info.uah.edu>
Following is a summary of articles spanning a 7 day period,
beginning at 28 Feb 1997 17:34:52 GMT and ending at
08 Mar 1997 07:47:52 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^(>|:|\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.
Totals
======
Total number of posters: 519
Total number of articles: 1054
Total number of threads: 452
Total volume generated: 1770.0 kb
- headers: 655.3 kb
- bodies: 1053.3 kb (802.0 kb original)
- signatures: 59.2 kb
Averages
========
Number of posts per poster: 2.0
Number of posts per thread: 2.3
Message size: 1719.7 bytes
- header: 636.7 bytes
- body: 1023.3 bytes (779.2 bytes original)
- signatures: 57.5 bytes
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
59 147.5 ( 44.2/ 94.0/ 78.0) Tom Christiansen <tchrist@mox.perl.com>
36 59.2 ( 20.7/ 38.4/ 20.5) Tad McClellan <tadmc@flash.net>
32 49.9 ( 17.6/ 32.2/ 27.7) Nathan V. Patwardhan <nvp@shore.net>
29 47.9 ( 23.3/ 24.6/ 17.8) Tom Phoenix <rootbeer@teleport.com>
20 35.7 ( 13.7/ 21.9/ 14.9) dbenhur@egames.com
19 31.1 ( 11.3/ 15.6/ 8.9) Dave@Thomases.com
14 18.6 ( 8.0/ 8.6/ 8.4) Brian L. Matthews <blm@halcyon.com>
13 19.7 ( 7.3/ 12.5/ 7.5) Honza Pazdziora <adelton@fi.muni.cz>
12 24.3 ( 8.8/ 11.1/ 6.3) Randal Schwartz <merlyn@stonehenge.com>
10 21.5 ( 8.1/ 13.4/ 10.0) jfriedl@wg.omron.co.jp
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
147.5 ( 44.2/ 94.0/ 78.0) 59 Tom Christiansen <tchrist@mox.perl.com>
59.2 ( 20.7/ 38.4/ 20.5) 36 Tad McClellan <tadmc@flash.net>
49.9 ( 17.6/ 32.2/ 27.7) 32 Nathan V. Patwardhan <nvp@shore.net>
47.9 ( 23.3/ 24.6/ 17.8) 29 Tom Phoenix <rootbeer@teleport.com>
38.6 ( 1.0/ 37.6/ 37.5) 2 Steven Katz <skatz@waite.mcp.com>
37.3 ( 5.2/ 32.1/ 31.8) 8 Chris Engel <cengel@nh1adm.uwaterloo.ca>
35.7 ( 13.7/ 21.9/ 14.9) 20 dbenhur@egames.com
34.8 ( 1.0/ 33.9/ 27.1) 2 Bozo@Chicago.land
31.1 ( 11.3/ 15.6/ 8.9) 19 Dave@Thomases.com
24.3 ( 8.8/ 11.1/ 6.3) 12 Randal Schwartz <merlyn@stonehenge.com>
Top 10 Threads by Number of Posts
=================================
Posts Subject
----- -------
17 How to spam - legitimately
11 Where is FAQ?
11 Print to Multiple Filehandles
9 perl program works on command line, but not when run through www server
9 Public domain DES and other crypto code in Perl?
8 Inline subroutines?
8 Which one is the best (pattern matching)
8 Grabbing text of web pages using perl
8 can $_ be dissociated from its contents?
8 Interview With The Internet's Wise Guys Of Perl - Web Week
Top 10 Threads by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Subject
-------------------------- ----- -------
39.7 ( 1.2/ 38.1/ 37.6) 2 IN THE ZONE Newsletter Vol. 2, No. 3 - March 1997
38.7 ( 5.8/ 32.8/ 32.3) 9 perl program works on command line, but not when run through www server
36.3 ( 1.3/ 34.8/ 34.3) 2 perlipc manpage bugs
34.5 ( 1.6/ 32.6/ 25.7) 3 College Students need help with perl script (1/1)
31.2 ( 14.9/ 15.3/ 11.0) 17 How to spam - legitimately
16.9 ( 6.1/ 10.8/ 6.8) 9 Public domain DES and other crypto code in Perl?
16.8 ( 7.0/ 8.2/ 4.2) 11 Print to Multiple Filehandles
16.7 ( 1.3/ 15.5/ 15.5) 3 Getting the most out of comp.lang.perl.misc
16.0 ( 2.5/ 13.2/ 11.3) 4 Perl -- compiled? C converter?
15.3 ( 7.4/ 7.3/ 5.2) 11 Where is FAQ?
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
28 comp.lang.perl.modules
12 comp.mail.misc
12 comp.mail.sendmail
9 sci.crypt
6 comp.infosystems.www.authoring.html
5 comp.lang.perl
4 comp.sys.mac.apps
4 comp.sys.mac.misc
4 comp.lang.perl.tk
4 comp.sys.mac.programmer.codewarrior
Top 10 Crossposters
===================
Articles Address
-------- -------
8 dana@uswest.net
6 "Manfred Schneider" <manfred.schneider@rhein-neckar.de>
5 Tony Ellison[ny][shoplet.com] <ellison@ingress1.murdoch.edu.au>
5 Tim Lorge <inoculation@lorge.com>
5 woutlet@worldnet.att.net
4 natanya@lanw.com
4 matt@callnet.com
4 Cari D. Burstein <cdaveb@best.com>
3 sb@en.muc.de
3 Ronald L. Parker <ron@farmworks.com>
------------------------------
Date: 7 Mar 1997 23:14:26 GMT
From: jgoerzen@complete.org (John Goerzen)
Subject: utmp/wtmp under Perl
Message-Id: <slrn5i18ai.ao0.jgoerzen@complete.org>
How do I access the system's wtmp (or utmp) database from Perl? Under C, I
would use getutent() and utmpname(). I cannot seem to find any equivolent
function under Perl.
Thanks!
--
John Goerzen | Running Debian GNU/Linux (www.debian.org)
Custom Programming |
jgoerzen@complete.org |
------------------------------
Date: 8 Mar 1997 17:22:21 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: utmp/wtmp under Perl
Message-Id: <5fs78d$5ba$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
jgoerzen@complete.org (John Goerzen) writes:
:How do I access the system's wtmp (or utmp) database from Perl? Under C, I
:would use getutent() and utmpname(). I cannot seem to find any equivolent
:function under Perl.
You'll have to make an XS file that interfaces to these --
or just do like we've always done and read and unpack.
Example follows.
--tom
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1997-03-08 10:21 MST by <tchrist@jhereg.perl.com>.
# Source directory was `/home/tchrist'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 1664 -rwxr-xr-x whenon
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
shar_touch=touch
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh17060; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= whenon ==============
if test -f 'whenon' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'whenon' '(file already exists)'
else
shar: Saving whenon (text)
$echo 'x -' extracting 'whenon' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'whenon' &&
#!/usr/bin/perl
X
open (LASTLOG, "< /usr/adm/lastlog") || die "can't open /usr/adm/lastlog: $!";
X
$lastlog_t = 'L A8 A16';
$lastlog_s = length(pack($lastlog_t, ()));
# struct lastlog {
# time_t ll_time;
# char ll_line[8];
# char ll_host[16]; /* same as in utmp */
# };
X
if (!@ARGV) {
X for ( $uid = 0;
X sysread(LASTLOG, $buff, $lastlog_s) == $lastlog_s;
X $uid++
X )
X {
X next unless @p = getpwuid($uid);
X ($time, $line, $host) = unpack($lastlog_t, $buff);
X $uid = $p[2];
X $user = $p[0];
X $uid{$user} = $uid;
X
X ### print STDERR "read $user\n";
X
X $time{$user} = $time || 0;
X $line{$user} = $line || '';
X $host{$user} = $host || '';
X }
X
X for $user ( sort { $time{$a} <=> $time{$b} || $uid{$a} <=> $uid{$b} } keys %time ) {
X $uid = $uid{$user};
X $time = $time{$user};
X $line = $line{$user};
X $host = $host{$user};
X write;
X }
X
}
X
USER: foreach $user ( @ARGV ) {
X if ($user =~ /^\d+$/) {
X unless (@p = getpwuid($user)) { warn "no such uid $user\n"; next; }
X $user = $p[0];
X $uid = $p[2];
X } elsif (!defined ($uid = getpwnam($user))) { warn "no user $user\n"; next; }
X seek(LASTLOG, $uid * $lastlog_s, 0) or die "seek failed: $!";
X ($time, $line, $host) = sysread(LASTLOG, $buff, $lastlog_s) == $lastlog_s
X ? unpack($lastlog_t, $buff)
X : ();
X write;
}
X
format STDOUT_TOP =
@<<<<<<< @>>>>> @<<<<<<< @<<<<<<<<<<<<<<<<<< @*
'user', 'uid', 'line', 'host', 'when'
-------- ------ -------- ------------------- -----------------------
X.
X
format STDOUT =
@<<<<<<< @>>>>> @<<<<<<< @<<<<<<<<<<<<<<<<<< @*
$user, $uid, $line, $host, $time ? scalar localtime $time : "[ never logged in ]"
X.
SHAR_EOF
$shar_touch -am 0924022296 'whenon' &&
chmod 0755 'whenon' ||
$echo 'restore of' 'whenon' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'whenon:' 'MD5 check failed'
91446034fb9ee4e6dafba90166c3ff5c whenon
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'whenon'`"
test 1664 -eq "$shar_count" ||
$echo 'whenon:' 'original size' '1664,' 'current size' "$shar_count!"
fi
fi
rm -fr _sh17060
exit 0
--
Tom Christiansen tchrist@jhereg.perl.com
"The purpose of most computer languages is to lengthen your resume by
a word and a comma." --Larry Wall
------------------------------
Date: Fri, 8 Mar 1997 18:02:19 GMT
From: futureprog@bridge.net.NOSPAM.PLEASE (Future Programmer)
Subject: Who makes more $$ - Windows vs. Unix programmers?
Message-Id: <5qsxov$gkm@skyway.bridge.net>
Subject says it all. Based on your personal experience and statistics,
where a good programmer can make more money - in Windows or Unix arena?
Unix appeals more to me and is more advanced technically, but I am
afraid that it is losing the market share to Windows 95. I want to be in
the consulting field.
I am a recent college graduate in NYC and have offers to work in
both fields. Please do not start Windows vs. Unix OS flamewar.
Your insighful observations are appreciated. Please followup.
------------------------------
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 75
************************************