[9003] in Perl-Users-Digest
Perl-Users Digest, Issue: 2621 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 17 06:07:36 1998
Date: Sun, 17 May 98 03:00:24 -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 Sun, 17 May 1998 Volume: 8 Number: 2621
Today's topics:
CPAN and perl, version 5.004_04 <jwest@netnw.com>
Determining data types using Win32::ODBC <dmitri-b@usa.net>
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. (Sitaram Chamarty)
Re: Does Perl have a IDE?I don't like command line. (Sitaram Chamarty)
Re: Does Perl have a IDE?I don't like command line. (Ilya Zakharevich)
Re: Does Perl have a IDE?I don't like command line. (Marek Jedlinski)
Re: form data <webmaster@fccjmail.fccj.org>
Re: form data <jlampard@quakerstate.com>
Re: form data <webmaster@fccjmail.fccj.org>
Re: form data <danboo@negia.net>
Re: How to delete an element in an array? (Kevin Reid)
Re: localtime() <ruediger@perl.pl>
Re: New IDE for Perl (Sitaram Chamarty)
Newbie discussion (Hans Malmberg)
NT Blues? Try DoS! <webmaster@fccjmail.fccj.org>
Text Wrangling Article <webmaster@fccjmail.fccj.org>
Re: Tip: Sets (William Denton)
Re: Which perl? (new user question) <robsmith@writeme.com>
Why doesn't this match? <steffi@shell8.ba.best.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 16 May 1998 20:28:11 -0700
From: "Jim Westveer" <jwest@netnw.com>
Subject: CPAN and perl, version 5.004_04
Message-Id: <895375698.744390@slave2.aa.net>
Question about CPAN
I just downloaded perl, version 5.004_04 and CPAN 1.36 -- Perl compliles and
runs fine, but CPAN can not locate an ftp site.
It looks like it is looking for the location
ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY
when perhaps it should be looking in
ftp://ftp.perl.org/pub/perl/CPAN/MIRRORED.BY
Has any one else had this problem....solution???
J. Westveer
jwest@netnw.com
------------------------------
Date: 17 May 98 00:40:13 GMT
From: "Dmitri Budchenko" <dmitri-b@usa.net>
Subject: Determining data types using Win32::ODBC
Message-Id: <01bd8156$4f8c3080$5e5992c6@senspro>
Is there any way to determine data types of fields in Access database
operated through Win32::ODBC? If not, can it be done programmatically
(analyze the kind of information stored)?
------------------------------
Date: 16 May 1998 21:50:39 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jlfpf$24e$1@ultranet.com>
smcdow@arlut.utexas.edu (Stuart McDow) writes:
>fsg@ultranet.com writes:
>> Actually, if you want to do that, please call me at (508) 898 6490.
>> Data General makes a product called 'TermServer in a Box', which is
>> a rack mounted NT machine that does multi-user display, has
>> clustered reliability, and includes a really sweet RAID array. It
>> supplies multi-user capability to Windows Terminals (and some X
>> terminals), many of them, pretty much seamlessly. It's a really
>> _great_ product.
>I haven't heard of it, and I'm a little skeptical. Are you saying that
>5, or fifteen, or fifty, or 500 people could run, say Word,
>simultaneously on different displays?
That's the deal, yep. They all run applications which are kept on
the server; they don't have to have local storage.
> If so, then how come the whole
>world hasn't heard about it?
Well, they have. You just haven't been listening on those particular
channels, I bet. DG's solution is one of the first to market that
actually works, and DG has traditionally had really poor marketing --
maybe that's why?
Felix
------------------------------
Date: 16 May 1998 21:58:17 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jlg7p$25l$1@ultranet.com>
smcdow@arlut.utexas.edu (Stuart McDow) writes:
>Lloyd Zusman <ljz@asfast.com> writes:
>>
>> But I still agree with your main point: Sun-based systems are
>> generally more expensive than those built on an Intel platform.
>If you factor in the cost of machine and network maintenance, I don't
>think this holds true.
TCO is extremely hard to figure, and is pretty near insensible anyway.
The Microsoft religious nuts can pick situations where using "productivity"
(Office) apps is extremely important, and Unixheads can pick situations
where, e.g., CAD, or heart donor databases, etc., are important.
>> Unix boxes from Sun et al are starting to come down in price, but NT
>> still has a lot of momentum right now in the corporate desktop
>> world,
>This is being driven by know-nothing executives, and not by IT
>professionals. I predict, that unless MS gets their act together soon
>and introduces a *much* more reliable OS than the current NT, we will
>see a slow but wholesale move back to Unix-based IT installations.
It's more likely that NT growth will just slow. NT does actually
solve an interesting problem -- the small workgroup server, where
Unix is not really competition due to price/complexity and Novell
has committed suicide.
But these discussions, while amusing, have nothing to do with Perl.
Felix
------------------------------
Date: 17 May 1998 03:33:07 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jllpj$jdj$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, fsg@ultranet.com writes:
:This isn't one of those things where you want everyone else's stuff
:to be free, but you want to make money off teaching, is it? That
:would be kinda sad.
What a despicable, mendacious, intentionally hurtful statement, Felix.
That was your goal, and you've succeeded. You've lied, and I'm hurt.
Now get thee to my $hitli$t and begone from my life forever.
Your allegation that I write free online perl documentation and answer
people's questions gratis for conspiratorious surreptitious reasons of
avarice say far more about what makes you tick, sir, than it does me.
Everyone knows how anti-moneygrubbingpigdog I am. I don't tell people
that they need to go out and buy my books. I don't tell them that then
need to pay me to take my classes. I don't tell people that if they'll
buy me dinner I'll grace them with my company. I would hurl doing so.
I tell people to access the free online stuff to learn Perl, just like
most of us did. If that's not good enough, then I let them make their
own choices. I wouldn't dream of telling someone to pay me for squat.
You're projecting.
I work very hard to make knowledge free. I intentionally edit manpages
before copying them into the books, because going the other way would
be unethical, and you wouldn't get the information for free. Tell me,
what have *you* done to help the free Perl community, Felix?
It's scumbag, left-handed insults like yours that recall to me what a
shitty world we live in. Thanks for the reminder. Good bye and good
riddance.
--tom
--
At MIT the server is the unit of invention. --Rob Pike
------------------------------
Date: 17 May 1998 02:36:01 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jm0gh$2ro$1@ultranet.com>
[courtesy cc of this posting sent to cited author via email]
Tom writes:
> In comp.lang.perl.misc, fsg@ultranet.com writes:
> :This isn't one of those things where you want everyone else's stuff
> :to be free, but you want to make money off teaching, is it? That
> :would be kinda sad.
>
> What a despicable, mendacious, intentionally hurtful statement, Felix.
> That was your goal, and you've succeeded. You've lied, and I'm hurt.
Hold on a moment there, buddy. You said that a solution the company
I work for was "fleeceware, just like everything else in that world."
I asked you if you intended that we not make any money, and you accuse
me of _lying_? I didn't even assert anything. If you're fantasizing
that I suspect that you're trying to finesse Perl so that you make a living
off teaching, then you have an overactive, suspicious and erroneous
imagination.
> Your allegation that I write free online perl documentation and answer
> people's questions gratis for conspiratorious surreptitious reasons of
> avarice say far more about what makes you tick, sir, than it does me.
You're being bizarrely paranoid. I alleged nothing, and especially not
this wild paragraph. I don't believe it, either; so normally I'd apologize
for the misunderstanding. But since your imaginative rantings defy reason,
I'm fairly sure it wouldn't do any good.
> I tell people to access the free online stuff to learn Perl, just like
> most of us did. If that's not good enough, then I let them make their
> own choices. I wouldn't dream of telling someone to pay me for squat.
> You're projecting.
(rolls eyes) Projecting? Yeesh, Tom, you've figured out my master plan
to get people to pay me for Perl help. Curses foiled now I must return
to the laboratory etc., etc.
> I work very hard to make knowledge free. I intentionally edit manpages
> before copying them into the books, because going the other way would
> be unethical, and you wouldn't get the information for free. Tell me,
> what have *you* done to help the free Perl community, Felix?
Your ego seems pretty stung. You okay in there good buddy?
> It's scumbag, left-handed insults like yours that recall to me what a
> shitty world we live in. Thanks for the reminder. Good bye and good
> riddance.
Maybe I was mistaken in thinking that all this hideous flaming of the
newbies is a calculated if ill-fated move designed to produce results.
Perhaps, instead, it's a manifestation of a _serious_ temper problem.
Just so everyone _else_ is totally clear, I was not questioning Tom's
motives; I was asking him if, since my company apparently produces
"fleeceware", he disbelieves in the model of selling goods for money and
would instead prefer that everything be services (a common enough theory
that in my opinion happens to be laughable). I explicitly deny believing
that Tom is "answering people's questions gratis for conspiratorious
[sic] surreptitious reasons of avarice" [sic].
Tom's a great guy who it was at least once fun to have a beer with,
though now I must recommend that if you do, you steer the conversation
well away from scripting languages or his involvement in teaching.
Maybe ask him about Magic?
Felix
------------------------------
Date: 17 May 98 04:17:26 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <slrn6lsfdq.5ud.sitaram@ltusitaram.diac.com>
On 14 May 1998 19:56:50 GMT, Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
>You are missing the most important point: having VIEW.EXE does not
>prohibit me grepping PODs, using *your* improved solutions, etc.
Agreed. Maybe I'll look into that CGI thing you mentioned and put
it up somewhere...
...trouble is, CGI needs a web *server*, and the people who cause
the most trouble by asking FAQs etc are precisely the ones whose
"OS" doesnt have a builtin web *server*.
------------------------------
Date: 17 May 98 04:17:30 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <slrn6lsgh2.5ud.sitaram@ltusitaram.diac.com>
On 14 May 1998 21:33:25 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:
>Tell me again why these people are programming if they aren't
>cut out for it? I don't consider ability to send mail equivalent
One answer:
My b-i-l uses Matlab for most of his work, but there are times
when Matlab can't do certain things, and he needs to massage some
data in some way. Perl to the rescue.
He is a post-doc researcher in something related to memory (human)
and the visual cortex or something - no math or programming
background.
Research grants don't run to hiring programmers to do his work for
him :-)
------------------------------
Date: 17 May 1998 07:11:04 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jm2i8$hbq$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Sitaram Chamarty
<sitaram@diac.com>],
who wrote in article <slrn6lsfdq.5ud.sitaram@ltusitaram.diac.com>:
> Agreed. Maybe I'll look into that CGI thing you mentioned and put
> it up somewhere...
>
> ...trouble is, CGI needs a web *server*, and the people who cause
> the most trouble by asking FAQs etc are precisely the ones whose
> "OS" doesnt have a builtin web *server*.
Nowadays it takes 2-3 lines of Perl to write a server. So at least
when starting from command line, you may start the server before
calling the browser.
Ilya
------------------------------
Date: Thu, 14 May 1998 00:15:59 GMT
From: cicho@polbox.com (Marek Jedlinski)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <355a35b2.48412107@news.nask.org.pl>
Keywords: If you're happy and you know it, clunk your chains.
gbacon@cs.uah.edu (Greg Bacon) wrote:
>In article <3558eb24.38542625@news.nask.org.pl>,
> cicho@polbox.com (Marek Jedlinski) writes:
>: I'm not sure what you call "standard", and I'll happily allow that the
>: ActiveState win95 port is not, but it so happens that the ActiveState
>: distribution does *not* include perldoc.
>
>Then the ActiveState ``ports'' are both nonstandard and broken. If
>you're so cursed as to be forced to use a win32 platform, I highly
>recommend Sarathy's binary distribution (if you can't build the standard
>distribution yourself).
It was on my "get it later" list for some time. It's coming down the wire
just as I type this. Thanks for the recommendation.
>: (Pet peeve: modules, of course. Hint: telling a win95 user to use
>: Html::Parser for HTML jobs is potentially worse than no response at all,
>: unless you add "and before you use it, install perl on Linux". [In my case,
>: perl refuses to compile entities.pm; plus I find the documentation
>: somewhat, well, obscure.)
>
>You should submit bug reports and/or patches to the author. Be willing
>and prepared to assist the author in debugging the problem.
True and some day I will (I hope), but as a newcomer to perl I tend to look
for mistakes on my side (the likelihood of me doing something wrong is
significantly greater of the likelihood of the CPAN moduile being broken).
Of course sometimes this assumption may backfire...
>: Similarly, any module that depends on external C
>: libraries is useless for the ActiveState port, unless the module was
>: specifically made/ported for that OS (such as it is).
>
>If that is the case, then I would write the ActiveState port off as
>useless as well.
To an extent. Then there's availability of (the latest) gcc and all
required libraries, etc, and the portability of the original C code (and my
rather feeble ability to fix said C code).
>: >Programming languages aren't and should never be everyday things.
>:
>: One could say that nuclear power plants aren't, either, yet I bet they
>: color-code control switches there, too :)
>
>Such a comparison between programming languages and operator panels is
>invalid.
Oh well, let's disagree. I think the comparison is valid inasmuch as both
cases share an angle: the fact that foo is powerful and complex by nature
does not imply that the complexity needs to be willfully increased (beyond
what's inescapable). But that's *really* minor :)
.marek
--
After things go from bad to worse, the cycle will repeat itself.
http://come.to/fnord/
------------------------------
Date: Sun, 17 May 1998 02:03:11 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: form data
Message-Id: <355E4385.D489CA0A@fccjmail.fccj.org>
JD Lampard wrote:
>
> so sorry wise guy! Larry WALL, i'm sorry for the typo in your name--right
> finger wrong hand.
No rest for the weary :-)
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
PS - It's not my name :-) In case you can't read.
------------------------------
Date: 17 May 1998 02:28:23 GMT
From: "JD Lampard" <jlampard@quakerstate.com>
Subject: Re: form data
Message-Id: <01bd813b$ad994ac0$1ee5ced0@jlampard.quakerstate.com>
you !@#$%^&! i know it's not your name--read what i wrote. i apologized
for my mistake to both YOU and Larry Wall!
i hope this clears things up.
Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org> wrote in article
<355E4385.D489CA0A@fccjmail.fccj.org>...
> JD Lampard wrote:
> >
> > so sorry wise guy! Larry WALL, i'm sorry for the typo in your
name--right
> > finger wrong hand.
>
> No rest for the weary :-)
>
____________________________________________________________________________
> Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
> Florida Community College at Jacksonville | 501 W. State St. | Jax, FL
32202
> mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
>
>
> PS - It's not my name :-) In case you can't read.
>
------------------------------
Date: Sun, 17 May 1998 05:45:36 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: form data
Message-Id: <355E77A6.46AEA1F8@fccjmail.fccj.org>
Try this CGI:
#!/usr/bin/perl -w
use Fcntl qw(:flock);
use strict;
use diagnostics;
my $ctr = 0;
open (IFILE, "cntr.txt") || die("Can't open Counter Data File: $!\n");
while (<IFILE>) {
chomp;
$ctr = $_;
}
close(IFILE) || die("Can't close Counter Data File: $!");
open (OFILE, ">cntr.txt") || die("Can't open Counter Data File: $!\n");
flock(OFILE, LOCK_SH);
print OFILE ++$ctr;
close(OFILE) || die("Can't close Counter Data File: $!");
print "Location: /pixel.jpg\n\n";
-Sneex- :-)
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
------------------------------
Date: Sun, 17 May 1998 02:32:37 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: form data
Message-Id: <355E8485.6492EE22@negia.net>
Bill 'Sneex' Jones wrote:
[SNIP]
> open (IFILE, "cntr.txt") || die("Can't open Counter Data File: $!\n");
> while (<IFILE>) {
> chomp;
> $ctr = $_;
> }
> close(IFILE) || die("Can't close Counter Data File: $!");
>
> open (OFILE, ">cntr.txt") || die("Can't open Counter Data File: $!\n");
> flock(OFILE, LOCK_SH);
> print OFILE ++$ctr;
> close(OFILE) || die("Can't close Counter Data File: $!");
>
> print "Location: /pixel.jpg\n\n";
if you want to read data from a file, modify it and then write it back
to that very same file it is best to maintain your flock for the
duration of these exercises. a typical idiom is something like:
open (FILE, "+<myfile.txt") || die $!;
flock FILE, 2;
$line = <FILE>;
seek FILE, 0, 0;
truncate FILE, 0;
print FILE &process($line);
close(FILE);
using your method you might actually miss some counts, or get mis-reads
and subsequent mis-writes. oh the horror. :-)
and i beleive your "Location" header is in error. a _full_ URI is
required by RFC 2068.
cheers,
--
Dan Boorstein home: danboo@negia.net work: danboo@y-dna.com
"THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
- Cosmic AC
------------------------------
Date: Sat, 16 May 1998 22:46:57 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: How to delete an element in an array?
Message-Id: <1d958jt.awitof1gm5gkeN@slip-32-100-246-239.ny.us.ibm.net>
Tom Christiansen <tchrist@mox.perl.com> wrote:
> It's all pretty darn trivial. BTW, there's almost
> certainly a module out there on CPAN that does this. :-)
http://www.perl.com/CPAN-local//modules/by-category/06_Data_Type_Utilities/Set/
(line length changed to avoid hard wrapping)
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Sun, 17 May 1998 11:45:11 +0200
From: Koenich <ruediger@perl.pl>
Subject: Re: localtime()
Message-Id: <355EB1A7.49AF6D9E@perl.pl>
Frank Winkler @home wrote:
> Hi there !
>
> Can anybody give me a hint how I can easily compute the day number (in the
> year) of an arbitrary date? For today I can use localtime[7] but to feed this
> with some other date I have to convert it into UTC - for which I found no PERL
> routine. Or has anyone written some own code for this job?
>
There is a module Date::DateCalc in the CPAN archive which will give you some
functions for your job.
ruedi
------------------------------
Date: 17 May 98 04:17:33 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: New IDE for Perl
Message-Id: <slrn6lsuee.5ud.sitaram@ltusitaram.diac.com>
On Fri, 15 May 1998 17:36:16 -0400, Birgitt Funk
<birgitt@order.booktraders.com> wrote:
>All the wise men are using emacs, does that mean one really
>can't skip it ? Or is it just because you are not only wise,
The leanest, meanest editor that has the features *you* want is
best. You mentioned vim - that's what I use too. Has some very
nice extras over standard vi, without the kitchen sink.
Sitaram
--
I once saw this on someone's sig: Emacs is my O/S, Linux is my
device driver. Pretty funny, and is also why I dont use Emacs - I
already have an O/S, thank you!
------------------------------
Date: Sun, 17 May 1998 11:09:31 +0100
From: hansmbg@algonet.se (Hans Malmberg)
Subject: Newbie discussion
Message-Id: <1d965qu.1u198zo13gt4hsN@du78-147.ppp.algonet.se>
I've read the postings concerning 'newbie lists' and I
would appreciate some kind of newbie helps.
Many of us are not born English speaking, and it isn't
always easy to solv problems on one's own. Myself I have
invested in books and downloaded lots of files, but
the available information is (to me..) very compressed.
As computer programming isn't my profession, I'm doing
it as a pure personal hobby and I have no friends to talk
with or discuss Perl on an eye-to-eye basis.
I want to thank all you people who has helped me with
answering those embarrassing questions I've posted in
this news area. But the constant repeating of answers
like
1.
> No need to post questions like that...
> Use the docs that COME WITH the perl distribution.
> That is why they are included in the distribution.
2.
> or buy the O'reilly book.
> Nearly all questions can be answered out of it too.
hezitates me from asking current issues with which I have problems.
I have the O'Reilly book.
I have the distribution.
But, I have to confess I don't understand all of it, and I have
difficulties in solving some of my problems just with those resources.
I wouldn't mind if
comp.lang.perl.newbies
was existant too.
Just now I'm struggling with how to open a data file and use
the text in it as three hash lists from a perl program.
Have a nice day all of you, today south Sweden is enjoying
the most fantastic early summer. I'll enjoy it too.......
Regards,
--
/Hans --- LUND 13.10'30(E 55.43'24(N
------------------------------
Date: Sun, 17 May 1998 02:53:16 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: NT Blues? Try DoS!
Message-Id: <355E4F42.34C12F29@fccjmail.fccj.org>
The following if perl 5.004 and should be a single line...
perl -MIO::Socket -e
'IO::Socket::INET->new(PeerAddr=>"some.windoze.box:139")->send("bye",MSG_OOB)'
Enjoy!
-Sneex-
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
------------------------------
Date: Sun, 17 May 1998 02:14:04 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Text Wrangling Article
Message-Id: <355E4612.D1CD9A9A@fccjmail.fccj.org>
Trying to catch up on my reading, I found above mentioned article in
Unix Review's "Performance Computing" by Randal Schwartz.
Very good article :-) It talks about the usage of this code:
@{[]} which allows you to use arbitrary expressions.
Anyways, here is a spin on what I got out of it. Something short, but
useful. I run it under CRON every hour or so.
------------------- Begin code... ----------------------------------
#!/usr/bin/perl -w
#
# SysAdmin-eMailer.pl... Mails Systems Status Info, regularly via CRON...
# Written by Bill Jones, FCCJ Webmaster; 16 May 1998 @ 20:45...
#
use Mail;
use strict;
my $myMail = Mail::new;
$myMail->{from} = 'you@there.net';
$myMail->{reply} = 'me@here.net';
$myMail->{to} = 'anyone@whereever.com';
$myMail->{subject} = "Update at @{[scalar localtime]}";
$myMail->{server} = "get.your.own.server.com";
$myMail->{message} = qq{System Info for @{[`hostname` =~ /(.*)/]}:
Summary of Disk Free Space [df -ka]:
@{[`df -ka`]}
Users Currently Logged-in [who]:
@{[`who`]}
System & Users Up-time [w]:
@{[`w`]}
Last 20 Accesses:
@{[`last -20`]}
Network Status [-r option]:
@{[`netstat -r`]}
Process Status:
@{[`ps efa`]}
And finally, your Fortune:
@{[`/usr/games/fortune`]}
};
# How many copies to send? Will always send at least 1...
my $nctr = 1;
while (1) {
my $retcode = Mail::send;
print "$retcode\n";
last if ($nctr++ > -1);
}
------------------- End code..... ----------------------------------
Enjoy!
-Sneex- :-)
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster
PS - Sometimes I wish I could find the [delete] key
when I am reading this newsgroup...
------------------------------
Date: 16 May 1998 11:24:20 -0400
From: buff@interlog.com (William Denton)
Subject: Re: Tip: Sets
Message-Id: <6jkb34$ipm@shell1.interlog.com>
Nathan Torkington <gnat@frii.com> wrote:
: Then I was asked to tech-read an upcoming book on working with
: CS-style algorithms and data structures in Perl, and I had an
: epiphany.
What's the title, who wrote it? Sounds very interesting.
Bill
--
--
William Denton : Toronto, Ontario, Canada : buff@interlog.com
http://www.vex.net/~buff/
------------------------------
Date: Sun, 17 May 1998 04:30:11 -0400
From: "Rob Smith" <robsmith@writeme.com>
Subject: Re: Which perl? (new user question)
Message-Id: <6jm3qt$6eo$1@snoopy.uscsumter.edu>
The 486 would be perfect for Redhat Linux and you would still have some use
for the 486. A 486 running windows is almost useless in my honest opinion.
I would recommend learning on the Unix box...
<cut>
>What would be the best way for me to learn? Learn the basics on MacPerl and
>then alter my scripts for Unix, or learn on Unix in the first place. I do
have
>an old 486 with Windows that I'm not really using too much. Would it be
worth
>it (or possible) to make this a Unix machine?
<cut>
------------------------------
Date: 16 May 1998 19:38:41 -0700
From: Robert Nicholson <steffi@shell8.ba.best.com>
Subject: Why doesn't this match?
Message-Id: <yl3pvhdhb9q.fsf@shell8.ba.best.com>
Why doesn't the reexp match?
DB<6> n
main::(bla.pl:8): %Header = ( 'FRONTSTUFF', split( /^(\w[-\w]+):\s+/m, $Headers ) );
DB<6> p $Headers
>From .@norway.it.earthlink.net Sat May 16 17:07:23 1998
Received: from norway.it.earthlink.net (norway-c.it.earthlink.net [204.119.177.49]) by shell8.ba.best.com (8.8.8/8.8.BEST) with ESMTP id RAA29115 for <steffi@shell8.ba.best.com>; Sat, 16 May 1998 17:06:36 -0700 (PDT)
Received: from mail.earthlink.net (1Cust58.max14.kansas-city.mo.ms.uu.net [153.35.222.186]) by norway.it.earthlink.net (8.8.7/8.8.5) with SMTP id RAA12267; Sat, 16 May 1998 17:04:56 -0700 (PDT)
From: .@earthlink.net
Date: Sat, 16 May 98 18:57:16 EST
To: .@norway.it.earthlink.net
Subject: Affordable Dental/Optical Care
Message-ID: <713845920@msn.com>
Status: RO
X-Status:
DB<7> n
main::(bla.pl:17): parse_address( 'From', \%From );
DB<7> s
main::parse_address(bla.pl:11): my ( $key, $h ) = @_;
DB<7> n
main::parse_address(bla.pl:12): ( $h->{ address } ) = $Header{ $key } =~ /(\w[-\w.]*@\w[-\w.]+)/;
DB<7> p $Header{From}
.@earthlink.net
DB<8> p $_
DB<9>
ie. $From{address} is no value afterwards.
------------------------------
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 2621
**************************************