[8391] in Perl-Users-Digest
Perl-Users Digest, Issue: 2008 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 3 10:16:42 1998
Date: Tue, 3 Mar 98 07:00:32 -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 Tue, 3 Mar 1998 Volume: 8 Number: 2008
Today's topics:
Authorisation and Perl (Edwin)
Re: Authorisation and Perl <friedman@uci.edu>
Re: Authorisation and Perl buzkoff@geocities.com
Re: Can I open a filehandle on a scalar? (Kevin Reid)
Re: Courthouse and Perl <mindmore@mindless.com>
Re: Extracting text from a logfile <friedman@uci.edu>
Re: Extracting text from a logfile <jdf@pobox.com>
Re: Faxing from Perl <jerryp.usenet@connected.demon.co.uk>
Re: Help please: Conversion problems from numeric to as (victor)
Re: Help please: Conversion problems from numeric to as (Odie Deth)
HTTP <peredina@bedford.progress.com>
Re: Is dynamic loading of subroutines possible? <friedman@uci.edu>
Job offered: Database Admin, Washington DC (Chris Winters)
Re: Perl performs a second miracle. Prepare for canoni (Mike Ellwood)
Re: Read/write GIF/JPG (Michael Fuhr)
Re: Read/write GIF/JPG <jdf@pobox.com>
Re: regex problem - problem with * <eike.grote@theo.phy.uni-bayreuth.de>
Re: rounding off numbers [FAQ] (Mike Stok)
Re: rounding off numbers <jdf@pobox.com>
Re: rounding off numbers (Real)
Re: top like module out there? (Samuel Ockman)
Re: using -e on a wildcard match (Tom Grydeland)
Re: Variables in regular expressions (newbie) (Tom Grydeland)
Re: Which database system to use? <fty@utk.edu>
Re: why no Case statment? (Kevin Reid)
Re: Why PERL? [Re: Beginner in trouble] (Mike Ellwood)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 3 Mar 1998 15:12:03 +0100
From: edwin@equilibrate.net (Edwin)
Subject: Authorisation and Perl
Message-Id: <MPG.f662e1db628a38b989681@news.xs4all.nl>
Hello everyone,
I encountered a challenge wenn i was trying to implement authentication
into a perl script.
Basicly what I want is one cgi-bin directory for various site's and put
some redaction perl script that can alter a dbase in that cgi-bin
directorie. To let poeple use them I want a password verification on the
scripts, but because there in one directorie for different users I can't
use the default appache solution (Blocking the intire directory and only
allow specific). I also don't wanna use the default html authentication
solution because then the password get's send unencrypted in stead of
basic 64 encrypted. And I first would have a html page that checks the
authentication. I have it running using different dir's and the common
solution.
So basicly what i'm trying to accomplish is sending something like
HTTP/1.0 401 Unauthorized and a WWW-authentication: basic
realm="user" causing the browser to pop up the ident window. So far i get
stuck trying to get the browser to pop-up the ident windows, I think
meanly because Appache send out a HTTP/1.0 200 before starting my script.
Has anyone experience with this, maybe giving me some pointers to get on
the way. Maybe it's posible to play the appache deamon to the client. It
all works the way i have it now, but this would be a much nicer solution
and give's more opertunities for different solutions.
If anyone could help me on the way or anyone has a script providing such
a solution it would make me very happy :-)
Grtz Edwin Cools
edwin@equilibrate.net
------------------------------
Date: 3 Mar 1998 14:16:59 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Authorisation and Perl
Message-Id: <6dh3cr$6dq@news.service.uci.edu>
Edwin,
I made a real effort to read this with an open mind (despite your
tortuous prose), but I can't find anything in here that has to do
with Perl. Looks to me like you want to comp.infosystems.www.*
groups.
In article <MPG.f662e1db628a38b989681@news.xs4all.nl>,
Edwin <edwin@equilibrate.net> wrote:
<Hello everyone,
<
<I encountered a challenge wenn i was trying to implement authentication
<into a perl script.
<
<Basicly what I want is one cgi-bin directory for various site's and put
<some redaction perl script that can alter a dbase in that cgi-bin
<directorie. To let poeple use them I want a password verification on the
<scripts, but because there in one directorie for different users I can't
<use the default appache solution (Blocking the intire directory and only
<allow specific). I also don't wanna use the default html authentication
<solution because then the password get's send unencrypted in stead of
<basic 64 encrypted. And I first would have a html page that checks the
<authentication. I have it running using different dir's and the common
<solution.
<
<So basicly what i'm trying to accomplish is sending something like
<HTTP/1.0 401 Unauthorized and a WWW-authentication: basic
<realm="user" causing the browser to pop up the ident window. So far i get
<stuck trying to get the browser to pop-up the ident windows, I think
<meanly because Appache send out a HTTP/1.0 200 before starting my script.
<
<Has anyone experience with this, maybe giving me some pointers to get on
<the way. Maybe it's posible to play the appache deamon to the client. It
<all works the way i have it now, but this would be a much nicer solution
<and give's more opertunities for different solutions.
<
<If anyone could help me on the way or anyone has a script providing such
<a solution it would make me very happy :-)
<
<Grtz Edwin Cools
<edwin@equilibrate.net
--
Eric D. Friedman
friedman@uci.edu
------------------------------
Date: Tue, 03 Mar 1998 09:49:57 -0500
From: buzkoff@geocities.com
Subject: Re: Authorisation and Perl
Message-Id: <34FC1895.7D1A@geocities.com>
Directory processed by Apache's
:File httpd.conf
<Location /sea>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
:File http://localhost/sea/zz.pl
print "HTTP/1.0 401 Unauthorized and a WWW-authentication: basic
realm='user'";
# print "HTTP/1.0 200 OK\n";
print "";
print "Content-Type: text/html\n\n\n";
print "Hello, unautorized user<BR>";
print "one more line\n";
------------------------------------------------------------
By the way, the silly question is - where the autenticated users arrive
from?
The core UNIX users are not through by this script.
------------------------------
Date: Tue, 3 Mar 1998 09:53:59 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Can I open a filehandle on a scalar?
Message-Id: <1d58gb4.9m460e1j8sb14N@slip166-72-108-66.ny.us.ibm.net>
Luis J. Martinez <luis@utdallas.edu> wrote:
> I want to open a filehandle on a scalar string rather than a file, so I can
> do file operations on it. Is there a way to do this?
Save this code in your library folder as Tie/StrFile.pm:
#!perl -w
package Tie::StrFile;
if (!defined $,) {$, = ""}
sub min {
my ($a, $b) = @_;
$a > $b ? $b : $a;
}
sub TIEHANDLE {
my ($class, $data) = @_;
return bless {
data => $data,
posi => 0,
}, $class;
}
sub PRINT {
my ($self, @list) = @_;
$self->{data} .= join($,, @list);
1;
}
sub PRINTF {
my $self = shift;
($self->{data} .= sprintf(@_)) ?1:0;
}
sub READ {
my ($self, $bufx, $size, $offset) = @_;
local *buf = \$_[1];
$offset ||= 0;
$buf = defined($buf) ? $buf : "";
$size = min($size, length($self->{data}) - $self->{posi});
my $dat = substr($self->{data}, $self->{posi}, $size);
$self->{posi} += $size;
substr($buf, $offset, length $dat) = $dat;
return length $dat;
}
sub READLINE {
my $self = shift;
if (wantarray) {
my @strs = split(/\n/, substr($self->{data}, $self->{posi}));
$self->{posi} = length $self->{data};
return @strs
} else {
my $rd = substr($self->{data}, $self->{posi});
(my $dat) = $rd =~ /(^.*?\n)/;
$self->{posi} += length $dat;
(length($dat) ? $dat : undef);
}
}
sub GETC {
my $self = shift;
substr $self, $self->{posi}++, 1;
}
__END__
And here is some sample code:
#!perl -w
tie *HNDL, "Tie::StrFile", "uno\ndos\ntres\n";
print scalar <HNDL>;
print scalar <HNDL>;
read HNDL, $buf, 3;
print $buf, "\n";
print HNDL "quattro";
print <HNDL>;
__END__
This produces:
uno
dos
tre
squattro
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Tue, 03 Mar 1998 16:08:30 +0200
From: Fain <mindmore@mindless.com>
To: Butch Bridges <bridges@brightok.net>
Subject: Re: Courthouse and Perl
Message-Id: <34FC0EDE.3C68240D@mindless.com>
Butch Bridges wrote:
> Yes, please do send me some links so I can learn more about Perl and
> what it can do. Our court records are in .DBF files already. Just
> need to convert them for use on the Net. Thanks.
>
> > Butch Bridges wrote:
> >
> > > I am trying to decide if Perl is the way to go with placing our
> > court
> > > records on the Net so the public can access them. Is it very
> > > complicated? Please reply by email with any suggestions or help. I
> >
> > > really know nothing about doing this. Thanks....... Butch Bridges
> > >
> > > bridges@brightok.net
> > > Ardmore, Oklahoma
> >
> > Yes... perl is the best way to do this because it make for easy Data
> >
> > access and the language is not to complicated.
> >
> > If you want to learn perl I recommend going to a search engine and
> > typing Perl Tutorial" or something like that. If you would when I get
> > home (I'm at work right now) I could send you some really links to
> > learn
> > it,. It will take some time to learn it and especially to learn what
> > you
> > need to do what you are talking about (and even more so if you haven't
> >
> > had any past programming experience (in any language)). However if you
> >
> > would like to learn I can give you a few good places to start that
> > would
> > get you in the right direction.
> >
> > Just let me know.
> >
> > - Nathan Fain
> > mindmore@mindless.com
ok. I went to www.perl.com last night and they have a link for tutorials. I
don't know how good they are but you may check there anyway (you never
know).I know of 2 really good tutorials at:
http://www.upstatepress.com/dave/tutor.html
One comes after the other and are really easy and short. I assume you know
that you need a server (or webspace) with CGI access.
Hope that helps.
another really good place to go for CGI is www.cgi-resources.com (they have
a archive of hundreds of useable CGI scripts).
Happy CGI'ing and if you need anymore help just let me know.
- Nathan Fain
mindmore@mindless.com
------------------------------
Date: 3 Mar 1998 14:13:18 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Extracting text from a logfile
Message-Id: <6dh35u$647@news.service.uci.edu>
In article <34fd7096.12875509@news.mindspring.com>,
Christopher Jowell <Jowell@mindspring.com> wrote:
<Hi,
<
< Using WIn95 and the latest offering of PERL from Activestate
<I'm trying to extract this line from a text file
<
<03FEB98 16:49
<
< What I'm having problems with is that I need the date in one
<key of a hash and the time in another. I'm also trying to learn the
Why not split the line on whitespace?
while (<>)
{
chomp; # strip newline
my ($date,$time) = split /\s+/; #split on whitespace into 2 vars
$hash{$date} = 1;
$hash{$time} = 1;
}
--
Eric D. Friedman
friedman@uci.edu
------------------------------
Date: 03 Mar 1998 09:40:31 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Extracting text from a logfile
Message-Id: <hg5fx2g0.fsf@news.concentric.net>
jowell@mindspring.com (Christopher Jowell) writes:
> Using WIn95 and the latest offering of PERL from Activestate
Which is old. You should consider getting the Win32 5.004_02 bindist
from
http://www.perl.com/CPAN-local/authors/Gurusamy_Sarathy/
> I'm trying to extract this line from a text file
> 03FEB98 16:49
>
> What I'm having problems with is that I need the date in one
> key of a hash and the time in another. I'm also trying to learn the
> most eloquent reqexp to match the date and time in this format. I
A regex would be overkill for this job. You'll want to read several
things: perlfunc (looking for "split"), perldata (to understand
hashes), and the book "Learning Perl." The split builtin turns a
string into a list; you may then use the elements of that list as the
key and value of a hash element. I hope this is helpful.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Tue, 3 Mar 1998 06:51:20 +0000
From: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Re: Faxing from Perl
Message-Id: <sY90jAAoh6+0EwdK@connected.demon.co.uk>
In <comp.lang.perl.misc>
Martin Wong <martin@highway-innovations.com.sg>, writes:
>Dear all,
>
>is there any way I can fax a document/text file in Perl on a win32 based
>NT platform? Maybe I can use an external program or something.
>
>Any ideas?
>
>Drop me an email : martin@highway-innovations.com.sg
Not a Perl solution but this one is free quick and easy so it fits the
ethos.
TCP run an (almost) world-wide free email to fax gateway. See TCP
website for more details.
Syntax :
remote-printer.Your_fax_title_here@441322347459.iddd.tpc.int
`Real' number is 01322 347459
Omit the leading 0 of the number and insert country code.
No spaces.
Turns sendmail into a fax gateway without writing a line of code !
--
Jerry Pank mailto:jerryp@connected.demon.co.uk
Hm... my new killfile isn't detecting you're posting from Windows.
Darn it.
-- Tom C. in comp.lang.perl.misc recently.
------------------------------
Date: Tue, 03 Mar 1998 13:37:26 GMT
From: churchjv@boat.bt.com (victor)
Subject: Re: Help please: Conversion problems from numeric to ascii
Message-Id: <34fc06b0.11304236@news.axion.bt.co.uk>
On Sat, 21 Feb 1998 13:10:55 -0500, Brent <brent@sympatico.ca> wrote:
> I'm trying to convert a number to a letter based upon the ascii
>...
> I have tried using the $userid[$i]=chr($randomnum) within a loop
>however from extensive testing, the chr() function doesn't seem to be
>returning anything.
I had a lot of trouble getting at the contents of a string: the trap
is that square brackets don't do what you would expect from other
languages. I suspect yr problem may be in the LHS rather than in the
chr() function. Try using substr($userid,i,1) = chr ...
hth
------------------------------
Date: Tue, 03 Mar 1998 14:38:40 GMT
From: odie@algonet.seREMOVE (Odie Deth)
Subject: Re: Help please: Conversion problems from numeric to ascii
Message-Id: <34fc1565.7325518@194.213.69.148>
Earlier, Brent <brent@sympatico.ca> wrote:
> I have tried using the $userid[$i]=chr($randomnum) within a loop
>however from extensive testing, the chr() function doesn't seem to be
>returning anything. I tested this by performing a dump of the variable
>contents prior and after conversion attempt.
I think I can see the problem here. In a TP string, $string[0] holds
the length of the string. To create an eight-character password, for
instance, you must insert the line:
$userid[0]:=chr(8);
somewhere, to make the string eight characters long.
---
Odie Deth - odie@algonet.se - http://www.algonet.se/~odie
------------------------------
Date: Tue, 03 Mar 1998 09:39:50 -0500
From: Curt Peredina <peredina@bedford.progress.com>
Subject: HTTP
Message-Id: <34FC1636.9A3A482@bedford.progress.com>
Im trying to write a ping utility for my site which utilizes HTTPS.
I have a working pgm for HTTP, but cannot get it to work with HTTPS.
Could someone give me an idea of how best to implement this,
possibly using the HTTP, LWP, or some other module which I have not yet
found?
Any information pointing me in the correct direction would be
appreciated.
Thanks in advance....
------------------------------
Date: 3 Mar 1998 13:58:57 GMT
From: "Eric D. Friedman" <friedman@uci.edu>
Subject: Re: Is dynamic loading of subroutines possible?
Message-Id: <6dh2b1$5k1@news.service.uci.edu>
In article <6dfqnk$sul$1@nnrp1.dejanews.com>, <gbrock@email.sjsu.edu> wrote:
<Hi. I was wondering if someone could help me out. I would like to
<know if it is possible to dynamically load a perl subroutine while
<it is running? Basically, I am trying to execute a perl subroutine,
<but I don't know what it is called yet. So I ask the user to input the
Check out eval in man perlfunc.
--
Eric D. Friedman
friedman@uci.edu
------------------------------
Date: Tue, 03 Mar 1998 13:25:50 GMT
From: cwinters@clark.net (Chris Winters)
Subject: Job offered: Database Admin, Washington DC
Message-Id: <34fd034c.1623512@news.clark.net>
IREX, a non-profit organization founded in 1968 to administer
academic exchanges between the United States and the Soviet
Union, is looking for a Database Administrator.
Brief descriptions:
<HR Stuff>
Database Administrator
Maintenance and development of enterprise database systems and
intranet site. Must have 3 years experience in database
development, with 2 years in SQL environment. Some experience
with internet programming (Perl, Javascript) required. Knowledge
of Sybase/Scalable SQL/ODBC a big plus. Excellent benefits.
</HR Stuff>
You don't have to be a Perl wizard to get this job, but you
should be able to deal with:
-( Win32::ODBC or DBD::ODBC on NT ) and DBD::mSQL
-OOP
-Generating Javascript from Perl
-Lots of undocumented and sometimes obfuscated code :)
Knowledge of internationalization issues (particularly Cyrillic)
is helpful also.
It ain't rocket science, but I'm just trying to help.
Chris Winters
Webmaster (www.irex.org)
------------------------------
Date: 3 Mar 1998 14:37:58 GMT
From: mwe@unixfe.cc.rl.ac.uk (Mike Ellwood)
Subject: Re: Perl performs a second miracle. Prepare for canonizaton!
Message-Id: <6dh4k6$12ha@newton.cc.rl.ac.uk>
William Denton (buff@interlog.com) wrote:
: I looked through the documentation and couldn't find anything on this
: wonderful behaviour. I grepped /usr/local/lib/perl5 on "miracle" and
: stringsed /usr/local/bin/perl on the same word, but nothing came up.
: I'm not one to complain about Perl docs, but really, this feature
: should be more widely known.
perldoc nightelves
?
--
Mike.Ellwood@rl.ac.uk
------------------------------
Date: 3 Mar 1998 07:25:10 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: Read/write GIF/JPG
Message-Id: <6dh3s6$er4@flatland.dimensional.com>
Mark McKay <kitfox@golden.net> writes:
> Anyone know where I can find modules to read/write the GIF and JPEG file
> formats?
You can find all sorts of modules on the Comprehensive Perl Archive
Network (CPAN):
http://www.perl.com/CPAN/CPAN.html
--
Michael Fuhr
http://www.dimensional.com/~mfuhr/
------------------------------
Date: 03 Mar 1998 09:46:41 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Read/write GIF/JPG
Message-Id: <g1kzx25q.fsf@news.concentric.net>
Mark McKay <kitfox@golden.net> writes:
> Anyone know where I can find modules to read/write the GIF and JPEG file
> formats?
I general, when you're seeking a module, you should begin your search
at the CPAN, which can be reached via the web at
http://www.perl.com/CPAN-local/
In this case, your search will end there, as well!
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Tue, 03 Mar 1998 14:36:46 +0100
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: regex problem - problem with *
Message-Id: <34FC076E.167E@theo.phy.uni-bayreuth.de>
Hi,
David Waring wrote:
>
> I cannot for the life of me figure out this problem. I am not new to
> regex's but this confuses me. I am simply trying to grab a number frome a
> line but if I use \d* it does not work while \d+ does. Here is a printout
> of my code and the result:
>
> [69] /www/bwaring/cgi-pvt>m a.pl
> #!/usr/local/bin/perl
>
> $line="blah blah blah 100 blah blah";
> if ($line=~/(\d*)/){
> $num=$1;
> print "found it\n";
> }
> print "num= $num\n";
>
> [70] /www/bwaring/cgi-pvt>a.pl
> found it
> num=
> [71] /www/bwaring/cgi-pvt>
>
> Why is this not working?
'\d*' matches zero, one, two,... digits. As Perl begins its search
at the beginning of the string it first matches "zero digits"
("between" beginning of string and first character). And because
this zero length sub string matches your pattern ('\d*') Perl is
content and finishes its work ...
When you use the pattern '\d+', you force Perl to search for at least
one digit, and after finding one it takes a look if it can find some
more in the following characters to make an even better matching.
Bye, Eike
--
=======================================================================
>>--->> Eike Grote <eike.grote@theo.phy.uni-bayreuth.de> <<---<<
-----------------------------------------------------------------------
Home Page, Address, PGP,...: http://www.phy.uni-bayreuth.de/~btpa25/
-----------------------------------------------------------------------
PGP fingerprint: 1F F4 AB CF 1B 5F 4B 1D 75 A1 F9 C5 7B 3F 37 06
=======================================================================
------------------------------
Date: 3 Mar 1998 14:55:24 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: rounding off numbers [FAQ]
Message-Id: <6dh5ks$5vu@news-central.tiac.net>
In article <01bd467f$4c4c4660$2d1809a8@sarkar.income.com.sg>,
S. Sarkar <s027119@income.com.sg> wrote:
>Is there any function by way of which we can round off numbers like
>123.456789 to the nearest 2 digits after decimal point. similarly for
>converting 123 to 123.00 (while displaying amounts for eg.).
>
>also i am using Perl 5.001 for WIN NT and when printing 123.40 i always get
>123.4
If you have a look at section 4 of the FAQ (maybe by browsing
http://www.perl.com) you'll see it mentions printf, so
$formatted = sprintf ('%.2f', $value);
might do what you want. sprintf is based on the C library function of the
same name, and is described in the perlfunc manual page.
Please take the time to check out the frequently asked questions, in
recent distributions there's a perlfaq document. If you don't have the
perlfaq document then it's available on line at CPAN sites.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 03 Mar 1998 09:27:40 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: rounding off numbers
Message-Id: <k9abx31f.fsf@news.concentric.net>
"S. Sarkar" <s027119@income.com.sg> writes:
> Is there any function by way of which we can round off numbers like
Please consult the documentation that comes with perl: you'll want to
read the section of "perlfunc" that explains the "printf" and
"sprintf" builtins.
> also i am using Perl 5.001 for WIN NT
That is an old version. You'll want to download the bindist of
5.004_02 which can be found in
http://www.perl.com/CPAN-local/authors/Gurusamy_Sarathy/
> if you people think this is too easy donot answer but aviod flaming me. I
> am on a hot seat anyway.
Please devote a couple of days to perusing the documentation that
accompanies Perl. Pay particular attention to the "perlfaq[1-9]?"
documents. Then you'll know whether or not a given question is "too
easy" before coming here and sticking your butt into boot range.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Tue, 3 Mar 1998 15:55:48 +0100
From: real@earthling.net (Real)
Subject: Re: rounding off numbers
Message-Id: <MPG.f66385b7b63bd61989689@news.surfnet.nl>
S. Sarkar wrote;
> Is there any function by way of which we can round off numbers like
> 123.456789 to the nearest 2 digits after decimal point. similarly for
> converting 123 to 123.00 (while displaying amounts for eg.).
Don't know of any function but how about this :
int($number * 100 + 0.5) / 100
Hope this helps,
Real
------------------------------
Date: 2 Mar 1998 01:22:56 GMT
From: ockman@varesearch.com (Samuel Ockman)
Subject: Re: top like module out there?
Message-Id: <slrn6fk2fm.f0.ockman@var2.varesearch.com>
Why not just use the output of commands like ps, free, and uptime. They
will give you all the information that's in top.
On 27 Feb 1998 18:54:27 GMT, John Erjavec V <jev@pconline.com> wrote:
>I am trying to get some output from the top command from remote sites.
-Sam
--
Samuel Ockman | Work Linux? | VA Research
Director of Software | Work with us. | Proud Corporate
(650) 934-3666 ext. 133 | e-mail jobs@ | Sponsor of Guerilla
Cellular: 650-53-Emacs (3-6227) | varesearch.com | Linux Development
------------------------------
Date: 3 Mar 1998 13:03:18 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: using -e on a wildcard match
Message-Id: <slrn6fnvsl.v8j.Tom.Grydeland@mitra.phys.uit.no>
On 02 Mar 1998 23:35:36 -0500,
Jonathan Feinberg <jdf@pobox.com> wrote:
> Of course, there's always
>
> @files = `ls *.err`;
If you really, really want to use a glob, try
@files = glob("*.err");
instead. I'd still advise {open,read,close}dir, though.
> Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: 3 Mar 1998 13:05:22 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Variables in regular expressions (newbie)
Message-Id: <slrn6fo00i.v8j.Tom.Grydeland@mitra.phys.uit.no>
On Tue, 03 Mar 1998 04:43:41 -0600,
edwin@mindless.com <edwin@mindless.com> wrote:
> Hi,
Hello,
> I was wondering, is it possible
> to use a variable inside a regular expression?
man perlfaq6
man perlre
> Edwin
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: Tue, 03 Mar 1998 09:40:30 -0500
From: Jay Flaherty <fty@utk.edu>
To: Andreas Greulich <andreas.greulich@mbox.bfi.admin.ch>
Subject: Re: Which database system to use?
Message-Id: <34FC165E.8D7DF586@utk.edu>
Try mySQL ( www.mysql.com ) and use the DBI/DBD interface...jay
Andreas Greulich wrote:
> - staying with Sprite ("If it works, don't fix it" :-)
> - switiching to another database sytem that's available shareware or
> already on my
> system (Soalris 2.5.1)
> - Buying an independent database software like Oracle and use a Perl
> interface
> (as far as I understood Oraperl and similar require an Oracle server)
--
**********************************************************************
Jay Flaherty fty@utk.edu
"Once in awhile you get shown the light, in the strangest of places if
you look at it right" - R. Hunter
**********************************************************************
------------------------------
Date: Tue, 3 Mar 1998 09:53:55 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: why no Case statment?
Message-Id: <1d4xllk.ztywpm1xktqw0N@slip166-72-108-66.ny.us.ibm.net>
Tzadik Vanderhoof <stvhoof@netvision.net.il> wrote:
> Why doesn't Perl have a real Case statement? I've read what the Camel
> book says about the "alternatives", but none of them are really as nice
> as a real Case statement supported directly by the language. I realise
> that this is something that probably only Larry could answer, and I've
> heard he no longer sees this newsgroup, but maybe someone has some ideas
> about this...
>
> Tzadik
There are good reasons for lack of a case statement, and one is that a
case statement built into the language would not be as flexible as one
you make yourself.
This dosen't mean it has to be ugly, though; see the code after the
comment that says "like Pascal":
#!perl -w
# --- Simple but ugly
sub foo {print "one\n"}
sub bar {print "two\n"}
%jtable = (
1 => \&foo,
2 => \&bar,
3 => sub {print "three\n"}
);
for (1..3) {
&{$jtable{$_}}
}
# --- like Pascal
sub case ($@) {
my ($value, %cases) = @_;
&{$cases{$value}};
}
for (1..3) {
case ($_,
1 => sub {print "uno\n"},
2 => sub {print "dos\n"},
3 => sub {print "tres\n"}
);
}
__END__
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 3 Mar 1998 12:12:37 GMT
From: mwe@unixfe.cc.rl.ac.uk (Mike Ellwood)
Subject: Re: Why PERL? [Re: Beginner in trouble]
Message-Id: <6dgs3l$12ha@newton.cc.rl.ac.uk>
"Whatever, the magical bead eventually grew into this rather odd-looking
Amulet you see before you today. See it glitter, almost like a pearl.
That was another joke. Really! I assure you! Ah well. I was a freshman once
too.."
Larry Wall, Foreword to first edition of Learning Pearl by Randal L Schwartz
and Tom Christiansen
(2nd edition)
--
Mike.Ellwood@rl.ac.uk
------------------------------
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 2008
**************************************