[8779] in Perl-Users-Digest
Perl-Users Digest, Issue: 2395 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 22 22:07:28 1998
Date: Wed, 22 Apr 98 19:00:34 -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 Wed, 22 Apr 1998 Volume: 8 Number: 2395
Today's topics:
Re: ask people to wait <rootbeer@teleport.com>
Re: beginnings.... <mike@borg.com>
Re: CGI-Mail Problem (Martien Verbruggen)
Re: Changing case of specific characters in string <rootbeer@teleport.com>
Re: Count some word in a string. <robban@it-konsult.com>
Defending Perl (Marjorie Roswell)
Re: Defending Perl (Michael J Gebis)
Re: Defending Perl (Andy Wardley)
Re: foreach trouble <quentin@jihad.amd.com>
Re: Get keystroke immediately without <RETURN> (Martien Verbruggen)
Re: Getting rid of the DOS console window when running scott@softbase.com
Re: Help: To Kill an Object <vallon@pearl.fi.bear.com>
Re: How can I get the correct answer? <tturton@cowboys.anet-dfw.com>
Re: How to read lines between two keywords in a file (Joel Coltoff)
Re: how to use perl behind a firewall? <dgoddard@us.oracle.com>
Re: if ($string eg "y") or if ($string == "y") (Andrew M. Langmead)
Local paths on W95 m144103303@abonados.cplus.es
Many users, only one of me!! <bland@sprint.ca>
Re: Many users, only one of me!! (Abigail)
Re: Newbie Q: How do I run Perl on WinNT? scott@softbase.com
Re: Perl 5, IIS, WinNT 4.0 <jkry3025@comenius.ms.mff.cuni.cz>
Perl lets you change constant value irishman@technologist.com
Re: Perl lets you change constant value <lr@hpl.hp.com>
Re: perl library to read excel file <rootbeer@teleport.com>
Re: Perl WIN32 Remote Process Monitoring <igor.k@usa.net>
Re: PL/SQL and perl <dfetter@shell4.ba.best.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 22 Apr 1998 16:09:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Sleep <mhchau@cse.cuhk.edu.hk>
Subject: Re: ask people to wait
Message-Id: <Pine.GSO.3.96.980422090433.6132M-100000@user2.teleport.com>
On 22 Apr 1998, Sleep wrote:
> So I want to prompt a messag
It sounds as if you want to make a remote browser do something. The people
in a newsgroup about browsers may be able to help you to find out what you
can make a browser do, and what commands you'll send to accomplish that.
It may also be that you could use the methods in one of Randal's Web
Techniques columns. Hope this helps!
http://www.stonehenge.com/merlyn/WebTechniques/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 22 Apr 1998 12:12:43 -0400
From: "Michael Wil. Swiercz" <mike@borg.com>
Subject: Re: beginnings....
Message-Id: <353E16F7.32E0@borg.com>
One further note:
If you are planning on porting this to NT in the future and using IIS
version 3.0 or 4.0, here are some things to watch for:
IIS Version 3.0
===============
Part of the installation FAQs for IIS describes an additional
association of the .pl extension to PERL.EXE, such that IIS knows what
to use when it pulls a *.pl file from a web site. Although the FAQ
provides the registry path as to where to put this, it doesn't tell you
exactly what you have to put in the registry. It just states "associate
.pl with C:\PERL\BIN\PERL.EXE". There is more to it.
Using REGEDIT, travel to:
HKEY_LOCAL_MACHINE / SYSTEM/CurrentControlSet / Services / W3SVC /
Parameters / ScriptMap
add a new string as follows:
Key: .pl
Value: C:\perl\bin\perl.exe %s %s
Most novices, including myself a year ago, based it on other examples
and simple put in
C:\perl\bin\perl.exe
as the value. If this is the case, IIS will launch perl but time out.
The %s %s allows for the CGI parameters.
IIS Version 4.0
===============
Microsoft has, yet again, changed the way things happen under version
4.0. Script mapping is now set up through the Internet Service Manager,
rather than Registry settings. Although this certain is more intuitive,
it was not readily obvious in the release documentation. I found myself
adding registry settings and wondering why nothing was working as
expected.
Using ISM go to the website setup and right click for its Properties.
Click on the "Home Directory" tab. At the bottom under "Application
Settings" click on the "Configuration" button. A "Script Mapping" window
will show all existing maps. The Perl script map should be
.pl C:\perl\bin\perl.exe %s %s
If it doesn't already exist, then add a new script map.
Apparently case is important, as Earl Hood had found out. If you already
had IIS 3.0 configured properly and upgraded to version 4.0, the
installer will automatically have extracted the registry settings and
placed them in the new configuration format. However, when MS does that
it CAPS the association as follows:
.pl C:\PERL\BIN\PERL.EXE %S %S
Apparently, %S and %s have two different meanings. Perl will work with
%s but not %S. Go figure?
Best Regards,
Mike :)
------------------------------
Date: 23 Apr 1998 01:18:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CGI-Mail Problem
Message-Id: <6hm4tt$9va$4@comdyn.comdyn.com.au>
In article <6hiahi$9s3$1@slsgcz.stgl.sel.alcatel.de>,
GRau@alcatel.de (Gaby Rau) writes:
> BTM, the perl-Script works, if not invoked via CGI, but from command line ...
This means that it is not a perl problem. So you shouldn't crosspost
to c.l.p.m
Martien
PS. Also contact your sysadmin, because they have their system
configured wrongly.
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: Wed, 22 Apr 1998 16:46:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: martinja@exis.net
Subject: Re: Changing case of specific characters in string
Message-Id: <Pine.GSO.3.96.980422094512.6132O-100000@user2.teleport.com>
On Wed, 22 Apr 1998 martinja@exis.net wrote:
> I believe Perl can do this, but I'm not sure how to do it. I want uppercase
> all characters inside of <>, but not uppercase characters inside of inner
> quotation marks. Example <img src="home.gif"> becomes <IMG SRC="home.gif">.
You (almost certainly) want to parse HTML. There is a module HTML::Parse
on CPAN which should be useful. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 22 Apr 1998 14:43:02 GMT
From: "Robert Friberg" <robban@it-konsult.com>
Subject: Re: Count some word in a string.
Message-Id: <01bd6dfc$e8e5c380$c82da8c0@robban.ittek.org>
Chao-cheng Huang <cchuang@ms.nctu.edu.tw> wrote:
>
> Assume I have a string
> $s = "aa....aa....aa....aa....aa" ;
> Ans I would like to calculate how much times "aa" happened.
> I have these two code:
>
> $cnt = $s =~ s/(aa)/$1/g ; # $cnt = 5
> $cnt = $s =~ /aa/g ; # $cnt = 1
The s-operator returns the number of substitutions made.
In a scalar context the m-operator returns true (1) if any matches
were made or false ('') for no matches. In a list-context the matching
strings ($1, $2, $3, ...) are returned.
$s = "aa....aa....aa....aa....aa" ;
$cnt = (undef) = $s =~ /(aa)/g;
# $cnt == 5
/Robban
------------------------------
Date: Wed, 22 Apr 1998 16:11:18 GMT
From: roswell@umbc.edu (Marjorie Roswell)
Subject: Defending Perl
Message-Id: <353e152d.10406811@news>
I'd like to answer the fellow who wrote this in response to my brief
perl advocacy on a mailing list.
"Perl does indeed offer alot of power, especially when working with
data. (And its being free certainly doesn't hurt!!) However, it
offers problems as well. Very few people use Perl, and since it is
interpreted it has some performance and installation problems. It is
almost easier to work in the power of C or C++.
So: How many people use perl?
Is it hard to install? (I don't think so.)
Does it have performance problems?
Oh, the fellow was responding to my query about whether folks were
writing GIS translators in Perl. I'm sad to see only one "geographic"
application at www.perl.com. I bet there's thousands out there that
people simply haven't submitted.
_________________________________________________________
Marjorie Roswell, Spatial Analyst
UMBC Center for Health Program Development and Management
1000 Hilltop Circle Fx: (410)455-6850
Baltimore, MD 21250 E: roswell@umbc.edu
Ph: (410)455-6802 http://umbc.edu/~roswell/mipage.html
_________________________________________________________
------------------------------
Date: 22 Apr 1998 23:21:55 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Defending Perl
Message-Id: <6hlu2j$l8o@mozo.cc.purdue.edu>
Keywords: bench bend glimpse sway
mjd@op.net (Mark-Jason Dominus) writes:
}In article <353e152d.10406811@news>, Marjorie Roswell <roswell@umbc.edu> wrote:
}>Anonymous contributor says:
}>>since it is interpreted it has some installation problems.
}Anyone who sees an implicit connection between `interpreted' and
}`installation problems' must have a real pointy little head.
Hmm.
Can I ship a script to you and guarantee it will work? No.
You'll only need to change the #!/usr/bin/perl5 line, but to some
people, this could be a big deal. (For example, I can't put perl
scripts on a CD.)
So his head might not be as pointy as you think.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Wed, 22 Apr 1998 17:04:53 GMT
From: abw@cre.canon.co.uk (Andy Wardley)
Subject: Re: Defending Perl
Message-Id: <ErtrG6.Iv9@cre.canon.co.uk>
Marjorie Roswell <roswell@umbc.edu> wrote:
>Very few people use Perl, and since it is
>interpreted it has some performance and installation problems. It is
>almost easier to work in the power of C or C++.
This sounds like the answer of someone who doesn't know perl and doesn't
want it to be used in your organisation for that very reason.
But that's probably not the kind of answer you can give...
>So: How many people use perl?
Who knows? If you want a back-of the-envelope guess, I'd say as many people
use perl as there are web sites in the World.
That's not to say that every web site uses perl (although I would guess
that the majority of people use perl for CGI scripting). Nor is it to
say that perl is only used on web sites. On the contrary, CGI scripting
is just one of the many tasks at which perl excels.
But add it all together, jiggle it around a bit and put a finger in the
air and it's probably a fairly good guess to say "about as many as there
are web sites".
That's still a largely intangible number, but one that your average man
on the Clapham Superhighway Omnibus can perhaps relate to a little better.
>Is it hard to install? (I don't think so.)
The good news is that binary versions are available for many platforms.
Compiling and installing your own version is a little trickier, but still
well within the grasp of anyone who has used a 'C' compiler or has access
to the doumentation.
>Does it have performance problems?
Perl code runs very fast. Almost as fast as C or C++. The performance
hit that people talk about concerns the fact that the perl code is
compiled immediately before it is run. It happens fast, but obviously
not as fast as in a pre-compiled language. The Perl Compiler is on the
way. Whether or not this will make things better is a contentious
issue.
The important point is that Perl code will be considerably easier and
faster to write than anything in C or C++. In many cases, we're talking
orders of magnitude. Perl has hundreds, if not thousands, of "plug-in
modules" which can make a considerable difference to the time, effort
and cost involved in development.
Your mileage will vary considerably, particularly with respect to the
kind of application you're considering developing, but this is a rough
guide based on my own experience.
A
--
Andy Wardley <abw@kfs.org> http://www.kfs.org/~abw
Signature lost in transit. We apologise for any inconvenience caused.
------------------------------
Date: 22 Apr 1998 08:45:59 -0500
From: Quentin Fennessy <quentin@jihad.amd.com>
Subject: Re: foreach trouble
Message-Id: <ximd8eaezqg.fsf@jihad.amd.com>
>>>>> "Peter" == Peter A Fein <p-fein@uchicago.edu> writes:
Peter> I'm having a bit of difficulty with the following foreach
Peter> loop:
print STDERR "1 val ", $self->{section_order}, " type ", ref($self->{section_order}), "\n";
foreach my $i ($self->{section_order}) {
print STDERR "2 val ", $i, " type ", ref($i), "\n";
do more stuff, using $i as a hash key;}
it outputs:
1 val ARRAY(0x80c768c) type ARRAY
2 val ARRAY(0x80c768c) type ARRAY
Peter, the output of your ref() call tells you that $self->{section_order}
is a reference to an array (or list). But when you use it in a foreach
loop you must explicitly dereference this reference,
so that perl can operate on it as a list. That sentence needs a rewrite!
Check out how $self->{section_order} is dereferenced:
foreach my $i ( @{$self->{section_order} }) {
print STDERR "2 val ", $i, " type ", ref($i), "\n";
}
Peter> This is one of my first scripts & consultation with the
Peter> Camel Book hasn't resulted in any answers. Help is
Peter> appreciated.
I suggest you read perldsc(1). References and dereferences are worth
a few doses of caffeine and some thought.
If you plan to use these Perl5 features I hope you are referring to
the 2nd edition of the Camel. Have fun!
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: 23 Apr 1998 01:34:28 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Get keystroke immediately without <RETURN>
Message-Id: <6hm5r4$9va$7@comdyn.comdyn.com.au>
In article <6sMxCfdFZZB@wharp.rhein-main.de>,
haert@wharp.rhein-main.de (Michael Haertfelder) writes:
> Well, the headline said it already:
# perldoc perlfaq
# perldoc perlfaq8
/How do I get one key from the terminal at a time, under POSIX?
You might also try to see if Term::ReadKey is installed, or install
it. I think that also allows you to do this, if you're not on a POSIX
box.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: 22 Apr 1998 16:00:48 GMT
From: scott@softbase.com
Subject: Re: Getting rid of the DOS console window when running a Perl program
Message-Id: <6hl47g$gcr$2@mainsrv.main.nc.us>
Go to http://www.skwc.com/essent and look at the Grab Bag of command
line programs for Win32 systems. One of them is "hide", which will hide
any window so it disappears from the desktop and the taskbar. A batch
file that launched the Perl program and then hid the window would make
it disappear from sight, *and* you could get it back easily if you
needed to monitor the process for some reason.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: 22 Apr 1998 21:03:58 -0400
From: Justin Vallon <vallon@pearl.fi.bear.com>
Subject: Re: Help: To Kill an Object
Message-Id: <x6ehg3lmjr5.fsf@pearl.fi.bear.com>
I think it is, in general, simpler to let perl's garbage collection
to work. That is, as long as you don't have access to the object, then
perl is free to clean up.
So, if you are stepping through an array, use shift or pop, or undef
the elements as you are going along.
Jerome Bradenbaugh <jerome.bradenbaugh@firstunion.com> writes:
> Dear Readers,
>
> I'm developing a web spider that recurses through an array of URLs. In
> order to index each document, I create a new UserAgent object.
>
> This works fine, but I think the object remains after it has performed
> its dirty work. Is there a way to kill an object after each use, or is
> there perhaps a way to request multiple documents with the same object?
>
> Please enlighten me using the e-mail address below.
>
> TIA,
>
>
> Jerry Bradenbaugh
> First Union National Bank
--
-Justin
vallon@bear.com
------------------------------
Date: Wed, 22 Apr 1998 08:30:31 -0500
From: Tom Turton <tturton@cowboys.anet-dfw.com>
Subject: Re: How can I get the correct answer?
Message-Id: <353DF0F7.13F1657C@cowboys.anet-dfw.com>
Bart Lateur wrote:
> James Yang wrote:
>
> >But I got the following result after I execute this program
> >
> >55.46 + 50 -100 = 5.46000000000001
> >1553.05 + 50 - 1600 = 3.04999999999995
> >
> >Is it a bug or I can get the correct answer in the other way?
>
> That's floating point for ya. You can get the correct answer, in the
> examples that you presented anyway. "All" you have to do is calculate
> the results in cents, and divide by 100 for printout.
>
> $\ = "\n";
> $number = 55.46 + 50 -100;
> print $number;
> $cents = 5546 + 5000 -10000;
> print $cents/100;
> Result:
> 5.46000000000001
> 5.46
>
Or, (wasn't this already mentioned by someone? if so, sorry about the
repetition)following the above example:
printf "\$number = %5.2f\n", $number;
Result:
$number = 5.46
(Hey, thanks for using that "$\" variable - I wasn't aware of that option
until looking it up!)
---Tom Turton
------------------------------
Date: Wed, 22 Apr 1998 14:43:37 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: How to read lines between two keywords in a file
Message-Id: <6hkvls$7uc@netaxs.com>
In article <353DF56B.9A858CBA@cae.cig.mot.com>,
Ying Peng <peng@cae.cig.mot.com> wrote:
>
>I'd like read through lines between two keywords. For example:
>
>H-daok-N/A-1998<--Keyword1
>/home/daok/f1
>/home/daok/f2
>.
>.
>/home/daok/f?
>H-peng-N/A-N/A<--Keyword2
>
Something like this might work for you.
open( IN, "data.txt") || die "Can't open file because $!";
while(<IN>)
{
if ( m#H-daok-N/A-1998# .. m#H-peng-N/A-N/A# )
{
print $_;
}
}
-- contents of data.txt --
H-daok-N/A-1998
/home/daok/f1
/home/daok/f2
.
.
/home/daok/f?
H-peng-N/A-N/A
don't care
more don't care
still don't care
>What I want to do is to find the first keyword and start reading the
>following lines before the next keyword. Suppose the data in a file
>called "data.txt". My problem is that which statement can read line by
>line in a file like $newline=<INFILE>?.
If the keywords can appear multiple times then you probably have to
read the whole file using $newline=<INFILE>. If not then you can
exit when you see the last keyword. One trick in solving this problem
is knowing when to turn processing on and off. A state machine can solve
this but in lots of cases the range operator " .. " make for much more
compact code.
>Your help will be highly appreciated.
--
Joel Coltoff
I'd explain it, but there's a lot of math. -- Calvin
------------------------------
Date: Wed, 22 Apr 1998 18:10:45 -0700
From: Denis Goddard <dgoddard@us.oracle.com>
To: Yuming Huang <yh39@research.att.com>
Subject: Re: how to use perl behind a firewall?
Message-Id: <353E9515.C5DAA619@us.oracle.com>
Yuming Huang wrote:
>
> I tired to use perl to access a website outside our firewall and failed.
> [...]
> does anyone know how to config perl to make it access outside firewall?
>
The answer to your original question would generally be in the format of
a flame, no matter how gently I try to avoid doing so. Therefore, I will
re-cast your question in the format of a request.
I am going to assume that you REALLY mean:
"Please give me a sample snippet of code that accesses HTTP servers via
an HTTP Proxy server"
The answer to THAT is:
1. If you have not already done so,
get LWP from CPAN and install it at your site.
2. Execute the following code:
#!/usr/bin/perl5
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->proxy('http','http://your-proxy-host.com');
$stupid_url="http://ourworld.compuserve.com/homepages/d_goddard";
$request=new HTTP::Request('GET',$stupid_url);
$response=$ua->request($request);
$raw_html_content=$response->content();
print $raw_html_content;
__END__
You will need to substitute your proxy's name; check your Netscape proxy
settings for this. You will probably want to check out HTML::Parser if
you
are going to print "just the text part" of the $raw_html_content
You will want to read the documentation:
perldoc LWP
perldoc LWP::Simple
perldoc LWP::UserAgent
perldoc HTTP::Request
perldoc HTML::Parser
-Denis
--
__ __ _ __ __
~~~~(__)|-< /-\(__ |__(-_
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Denis Goddard Fave langs: PL/SQL, Perl5 |"I see the heads of men
arise
email: dgoddard@us.oracle.com |with hungry minds and open
eyes!
ourworld.compuserve.com/homepages/d_goddard| -Rush, from 2112: _The
Oracle_
------------------------------
Date: Thu, 23 Apr 1998 01:27:25 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: if ($string eg "y") or if ($string == "y")
Message-Id: <EruEpp.I70@world.std.com>
Yeu-Perng Nieh <ynieh@fhcrc.org> writes:
>if ($string eg "y") and if ($string == "y")?
>It seems to me that the latter does not work for string matching.
>Even $string is something totally different from "y",
>the if statement is always true. Any comments?
Since "==" is the numeric equality operator, Perl converts "y" to a
number. When perl converts a string into a number, it starts looking
at the first non whitepace character for something number-ish (maybe a
preceding plus or minus, then digits, then maybe a decimal point, then
maybe more digits.) Once it finds something that doesn't fit into its
idea of a number, it stops.
So, the string "y", when viewed as a number, is 0. The second if
statement isn't always true. It is true if $string any number other
than 0.
--
Andrew Langmead
------------------------------
Date: Wed, 22 Apr 1998 11:22:23 -0600
From: m144103303@abonados.cplus.es
Subject: Local paths on W95
Message-Id: <6hl5fv$kr1$1@nnrp1.dejanews.com>
Hi
I know that's a newbie question but I'm getting nuts trying to make Perl
scripts under W95, unfortunately our Web-server is on a win95 machine and the
only thing I found are problems,problems,problems.......
I'm trying to persuade the people on the office to install an Apache server
but for the moment..............
Ok, the question is :
How I put a local path in a perl script????........and.........
Where I can find documentation about running perl under W95??
----If someone could help me it could be great(I'm desperate)-----
Thanks in advance
Chuck
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 22 Apr 1998 09:35:36 -0400
From: Bojan Landekic <bland@sprint.ca>
Subject: Many users, only one of me!!
Message-Id: <353DF228.3B1873B2@sprint.ca>
Okay, I know this might not be 100% Perl related, as opposed to being a
general principle in programming, but I'll ask anyway, assuming someone
here is willing to lend a hand.
I am using the Perl5.003, on the system which I have to develop with
(unfortunatly it is Win95). At home I run Linux 2.0.33 and Perl runs
fine there as well as on the Win95 system....Just so you all know what I
am setup here (so far, no problems have been found between taking files
to/from work, so all Perl scripts from my Linux box run under the 95box,
for now!)
My problem is this. I am designing a "login" and a "logout" program for
our Intranet and have run into some problems. There are approximately
1,000 users, and at any given time 100-200 of them need to be "logged
in".. now this part I have finished. I also need to keep track of their
total hours a day, a week, for 2 weeks, for a month,...etc... This is
posing me a little problem. I cannot decide which is better. Keep one
file with things like username:time:action: with action being "LOGIN" or
"LOGOUT" and then just have a script which goes through this file and
calculates time based on the username provided to it. OR, the other
option is to have a separate file for each user with the same
information. The problem with the first one is, what happenes after
about 2 months, or even after about a week of usage, the file would grow
tremendously. This same problem partially exists with the second
solution, but to a much smaller scale. Anyone have any ideas about
this?
I also need to add the ability for "users" to check how long they have
been on today, in the last 3 days, in the last week, generally how long
they've been on for the last n days. The second method would make this
faster, but that would mean I have a lot of files (1000 files?)...
Another thing is I need to have a list of those who are currently logged
in. With the first method, I would have to have a separate file from
which I would have to add/remove usres as they login/logout (sort of a
loginlogout file).. or, just create a new directory called "online" and
put their username.txt file in there, and then just list the contents of
the directory.. but how fast/slow is this if it's done every few
seoncds, on about 100 computers?? Or is it better to simply open up a
file and read it's contents every few seconds on 100-200 computers...?
Or is there an alternative to this problem as well?
Any ideas would be TREMENDOUSLY appreciated. I have actually done
everything I have written as "I need to do this" so far, but I'm not
happy with the way it works (too many http-equiv refresh tags in the
html!). I'm looking for alternative, faster ways of doing what I need
to do.
Any and all help would be aprpeciate if it's posted here, or e-mail to
me directly at bland@sprint.ca
Thanks for your very valuable time and expertise,
Bojan Landekic
------------------------------
Date: 22 Apr 1998 16:18:58 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Many users, only one of me!!
Message-Id: <6hl59i$cuv$1@client3.news.psi.net>
Bojan Landekic (bland@sprint.ca) wrote on MDCXCV September MCMXCIII in
<URL: news:353DF228.3B1873B2@sprint.ca>:
++ Okay, I know this might not be 100% Perl related, as opposed to being a
++ general principle in programming, but I'll ask anyway, assuming someone
++ here is willing to lend a hand.
++
++ I am using the Perl5.003, on the system which I have to develop with
++ (unfortunatly it is Win95). At home I run Linux 2.0.33 and Perl runs
++ fine there as well as on the Win95 system....Just so you all know what I
++ am setup here (so far, no problems have been found between taking files
++ to/from work, so all Perl scripts from my Linux box run under the 95box,
++ for now!)
++
++ My problem is this. I am designing a "login" and a "logout" program for
++ our Intranet and have run into some problems. There are approximately
++ 1,000 users, and at any given time 100-200 of them need to be "logged
++ in".. now this part I have finished. I also need to keep track of their
++ total hours a day, a week, for 2 weeks, for a month,...etc... This is
++ posing me a little problem. I cannot decide which is better. Keep one
++ file with things like username:time:action: with action being "LOGIN" or
++ "LOGOUT" and then just have a script which goes through this file and
++ calculates time based on the username provided to it. OR, the other
++ option is to have a separate file for each user with the same
++ information. The problem with the first one is, what happenes after
++ about 2 months, or even after about a week of usage, the file would grow
++ tremendously. This same problem partially exists with the second
++ solution, but to a much smaller scale. Anyone have any ideas about
++ this?
What's wrong with the wtmp and utmp files most Unix systems keep anyway?
Wouldn't that give you the information? If it grows too big, just run
a small job every now and then that sums up the information, stores it
in a file (one line per user) and erases the wtmp/utmp file(s).
++ I also need to add the ability for "users" to check how long they have
++ been on today, in the last 3 days, in the last week, generally how long
++ they've been on for the last n days. The second method would make this
++ faster, but that would mean I have a lot of files (1000 files?)...
Parse the output of what the last command gives you?
++ Another thing is I need to have a list of those who are currently logged
who, finger, and w will give you that.
++ in. With the first method, I would have to have a separate file from
++ which I would have to add/remove usres as they login/logout (sort of a
++ loginlogout file).. or, just create a new directory called "online" and
++ put their username.txt file in there, and then just list the contents of
++ the directory.. but how fast/slow is this if it's done every few
++ seoncds, on about 100 computers?? Or is it better to simply open up a
++ file and read it's contents every few seconds on 100-200 computers...?
++ Or is there an alternative to this problem as well?
Here I get confused. You have at any given time 100-200 users that are
simultaniously logged in to 100-200 computers?
++ Any ideas would be TREMENDOUSLY appreciated. I have actually done
++ everything I have written as "I need to do this" so far, but I'm not
++ happy with the way it works (too many http-equiv refresh tags in the
++ html!). I'm looking for alternative, faster ways of doing what I need
++ to do.
What do HTTP and HTML have to do with logging in to a system?
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
Date: 22 Apr 1998 16:03:07 GMT
From: scott@softbase.com
Subject: Re: Newbie Q: How do I run Perl on WinNT?
Message-Id: <6hl4br$gcr$3@mainsrv.main.nc.us>
The most important thing is to install the ISAPI DLL version of Perl
on either Internet Information Explorer (IIS) or the FrontPage
Personal Web Server (PWS). Neither of these do anything with
command line Perl. I've never gotten a command line version to work,
but the ISAPI version works great.
One the ISAPI DLL installs and associates itself with .pl, you should
be able to run any Perl CGI program with no problems.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: Wed, 22 Apr 1998 19:13:03 -0700
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
Subject: Re: Perl 5, IIS, WinNT 4.0
Message-Id: <353EA3AF.215@comenius.ms.mff.cuni.cz>
DF wrote:
>
> I wonder if somebody can give me a hand on this one.
>
> We are running WEB server with Front Page. Perl 5 installed and running. The
> problem comes when I try to pass variables from WEB page to Perl. It does
> not take any parameters from WEB pages, all variables are blank. For
> example, when sending a registration form through e-mail, Perl never sends
> it because no variables are getting passed to Perl, it gives and error that
> required fields must be filled, although they are filled.
> I guess, this is quite stupid installation problem, but I cannot figure it
> out.
>
> Any help will be appreciated,
>
> DF
Unless you show us a little piece of code we cannot do anything
for you. Make a very short example script and send it here.
You are most probably look for the parameters on a wrong place.
You should use some module to get&decode the CGI parameters
( CGI.pm on http://www.perl.com/CPAN/
Deurl.pm on http://www.fmi.cz/private/Jenda
)
And tell us the version of IIS. There is quite some difference between
IIS3.0 and IIS4.0.
Jenda
------------------------------
Date: Wed, 22 Apr 1998 11:30:28 -0600
From: irishman@technologist.com
Subject: Perl lets you change constant value
Message-Id: <6hl5v5$lpj$1@nnrp1.dejanews.com>
% cat test.pl
#!/usr/local/bin/perl -w
*CONST = \40;
$CONST++;
print STDOUT "CONST = $CONST\n";
% test.pl
CONST = 41
Call me a pedant, but I think constants should stay constant. Note that
$CONST-- also works and produces the result 39. Any other operation that I
tried returns "Modification of a read-only value attempted at test.pl line 3."
which is what I expect.
I'm running perl5.002 (yeah, yeah, I know) on a Sun Sparcstation 5.
Can anyone shed some light on this behavior?
===========================================================================
Steve Dobson, somewhere in Cyberspace
"Mr. Reagan, you're no George Washington"
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 22 Apr 1998 10:30:38 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Perl lets you change constant value
Message-Id: <6hl9fo$3aj@hplntx.hpl.hp.com>
irishman@technologist.com wrote in message
<6hl5v5$lpj$1@nnrp1.dejanews.com>...
>% cat test.pl
>#!/usr/local/bin/perl -w
>*CONST = \40;
>$CONST++;
>print STDOUT "CONST = $CONST\n";
>% test.pl
>CONST = 41
>
>Call me a pedant, but I think constants should stay constant. Note that
>$CONST-- also works and produces the result 39. Any other operation
that I
>tried returns "Modification of a read-only value attempted at test.pl
line 3."
>which is what I expect.
>
>I'm running perl5.002 (yeah, yeah, I know) on a Sun Sparcstation 5.
>
>Can anyone shed some light on this behavior?
Yes. It is fixed in perl 5.004.
--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com
------------------------------
Date: Wed, 22 Apr 1998 16:02:00 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: "Karel.DeBruyne" <dbruyne@uia.ua.ac.be>
Subject: Re: perl library to read excel file
Message-Id: <Pine.GSO.3.96.980422090143.6132L-100000@user2.teleport.com>
On Wed, 22 Apr 1998, Karel.DeBruyne wrote:
> I need a tool to fetch me some information out of an excel file.
If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-) Hope this helps!
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 22 Apr 1998 17:48:46 -0700
From: "Igor Krivokon" <igor.k@usa.net>
Subject: Re: Perl WIN32 Remote Process Monitoring
Message-Id: <6hm2ub$s85$1@news.ncal.verio.com>
warren@jen.co.il wrote in message <6hlnt2$jsb$1@nnrp1.dejanews.com>...
>In article <353D2F78.8400AB93@tir.com>,
> reboot@tir.com wrote:
>>
>> Does anyone know of a way to monitor processes running on a remote/network
>> server? Thanx in advance for any info.
>
>I don't know, but I've been wondering for a while how to monitor processes
>running locally on Win32 (all processes, not just processes I created), and
>I'm hoping anyone answering your question can answer mine, too. On UNIX I
>open a pipe from ps to do this.
>
Win32 SDK has an example named pviewer - it does local and remote
processes and threads monitoring, priority change etc.
(I think, you can download it freely from Microsoft's MSDN site)
I don't remember all the details, but it seems to me,
you can get all this information from registry.
So, I would recomend that you check
1) Any books on Windows registry (see HKEY_PERFORMANCE_DATA)
2) Win32::Registry perl module
Regards,
Igor Krivokon
<igor.k@usa.net>
------------------------------
Date: 23 Apr 1998 01:21:06 GMT
From: David Fetter <dfetter@shell4.ba.best.com>
Subject: Re: PL/SQL and perl
Message-Id: <6hm522$s07$1@nntp1.ba.best.com>
zhanglei <zhlei@beijing.china.com> wrote:
> How can I make Oracle PL/SQL into perl program?
There is not (yet) an automatic way to do this that I know of. Please
post some of the code, and maybe we can give you some pointers, er, I
mean references.
D.
--
David Fetter 888 O'Farrell Street Apt E1205
shackle@ren.glaci.com San Francisco, CA 94109-7089 USA
http://www.best.com/~dfetter +1 415 567 2690 (voice)
print unpack ("u*",q+92G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R"@``+)
The only "intuitive" interface is the nipple. After that, it's all learned.
Bruce Ediger (bediger@teal.csn.org)
The nipple interface is a very much learned.
Tamar Levy (tamar@clearthink.com),
new mom.
------------------------------
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 2395
**************************************