[10720] in Perl-Users-Digest
Perl-Users Digest, Issue: 4319 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 29 23:07:33 1998
Date: Sun, 29 Nov 98 20:00:19 -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 Sun, 29 Nov 1998 Volume: 8 Number: 4319
Today's topics:
Re: "ELSE" command in Perl?? (Ken Williams)
A top-ten program <stmintz@yahoo.com>
Any good books for a Newbie? (Tim Schaab)
Re: Any good books for a Newbie? <damonbrent@earthlink.net>
comparing two strings case insensatively <Pap22@erols.com>
Re: comparing two strings case insensatively <jacklam@math.uio.no>
Re: comparing two strings case insensatively (Tad McClellan)
Re: comparing two strings case insensatively <due@murray.fordham.edu>
Free Webmaster Resources heliumweb@my-dejanews.com
Re: Help with this example anyone? <trent@jps.net>
How do I execute another program from a CGI script? <sc17@doc.ic.ac.uk>
Re: How do I execute another program from a CGI script? <damonbrent@earthlink.net>
Re: how to get `date` in perl for win32 (newbie) <nobody@nowhere.com>
Is there a way to edit NT ACL info using Perl? jenmei@my-dejanews.com
Re: Is there a way to edit NT ACL info using Perl? <perlguy@technologist.com>
Re: localtime () - perl's bug ? <gellyfish@btinternet.com>
MacPerl file handling problem? <matt@tvml.co.uk>
MIME::Lite imchat@ionet.net
Newbie from Ottawa, Ontario Canada (Susie)
Re: Obfuscation of perl scripts <ebohlman@netcom.com>
perl for windows 95 teltti@hotmail.com
Re: perl for windows 95 <perlguy@technologist.com>
Re: Perl in NT login script <metcher@spider.herston.uq.edu.au>
Using a variable as an argument to use lib <habegger@bitpipe.com>
Re: Y2K work - need suggestions <no@spam.org>
Re: Y2K work - need suggestions <no@spam.org>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 29 Nov 1998 18:27:55 -0600
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: "ELSE" command in Perl??
Message-Id: <ken-2911981827550001@min-mn6-04.ix.netcom.com>
In article <73crae$o7d$0@206.165.167.210>, "Allan M. Due"
<due@murray.fordham.edu> wrote:
>>> if( $web = "" )
>
>Ah, Hall and Schwartz to the rescue. To paraphrase (or almost quote) any
>quantity used in a Boolean context is converted to a string and then, if
>that string is null or exactly equal to 0, the test is false. Otherwise it
>is true. So $web is set to False above and the same result would be seen
>for $web = 0, but anything else returns true. Cool.
Not quite. $web is not set to False (there's no such thing in Perl as
just "False"), it's set to "" (the empty string). The value returned from
any assignment is the left-hand side of the assignment, which in this case
is "". Then Perl checks whether this value is true or false. "" is
always false.
Here's a little storyline about what Perl is thinking with that code:
Code:
if ($web = "") { ... }
Perl thinks:
Let's set $web to the empty string, and return the value of that assignment.
Result:
if ("") { ... }
Perl thinks:
Is the condition equal (as a string) to '0' or ''? If so, return false.
Otherwise, return true.
Result:
if (false) { ...stuff not executed... }
Here's an interesting question: if you used tie($web, ...) to change the
assignment behavior of $web, could you get 'if ($web = "")' to return a
true value? Haven't found the answer to this in the docs.
------------------------------
Date: Sun, 29 Nov 1998 20:18:18 -0600
From: "Sean Mintz" <stmintz@yahoo.com>
Subject: A top-ten program
Message-Id: <73suvh$ug8$1@Masala.CC.UH.EDU>
The code i currently have for the program is this:
open(STAT, "stat"); ^ or die "can't open file: $!\n";
@stats = <STAT>;
$line = 0;>
foreach $game_number (keys %PLAYER1) {
$rating1 = $white_rating{$game_number};
$white = $player1{$game_number};
foreach $stat (@stats) {
$line++;
if($stat =~ /([^ ]+) ([0-9]+)/) {$r1 = $2;}
if($rating1 > $r1) {$stat_line[$line] = "$white $rating1";}
if($rating1 < $r1) {$stat_line[$line] = $stat;}
}
}
foreach $line_stat ($stat_line) {print "$line_stat\n";}
If you have any idea on how to make that work or know a better way, please
send them to stmintz@yahoo.com. Thank you in advance.
Sean Mintz --- stmintz@yahoo.com
------------------------------
Date: Mon, 30 Nov 1998 00:34:09 GMT
From: schaab@cs.wisc.edu (Tim Schaab)
Subject: Any good books for a Newbie?
Message-Id: <3661e795.495622071@news.supernews.com>
Hello all in Perl land!
I'm new at Perl, in fact totaly new. Are there any books out
there in the plethera of bound tree carcuses that can teach me Perl
5.0?
Thanks In Advance!
Tim Schaab
------------------------------
Date: Sun, 29 Nov 1998 21:19:12 -0500
From: brent verner <damonbrent@earthlink.net>
Subject: Re: Any good books for a Newbie?
Message-Id: <366200A0.7A03EDCC@earthlink.net>
Tim Schaab wrote:
>
> Hello all in Perl land!
> I'm new at Perl, in fact totaly new. Are there any books out
> there in the plethera of bound tree carcuses that can teach me Perl
> 5.0?
>
> Thanks In Advance!
> Tim Schaab
no, a book will not teach you perl. only you can learn it. the best
perl book IMHO is the O'Reilly title - Programming Perl -- better
known as the camel book. this book in conjunction with the plethora
of freely available source code will have you flinging good perl
code pretty quickly.
hth.
brent
------------------------------
Date: Sun, 29 Nov 1998 17:11:34 -0500
From: "Pap" <Pap22@erols.com>
Subject: comparing two strings case insensatively
Message-Id: <73sgsu$dqt$1@winter.news.rcn.net>
Looked around, couldn't find it...I'll need to get that Perl book this
weekend!
I tried =~ but it isn't what I'm looking for. Would I need to convert both
of them to upper/lower case and THEN compare them?
Thank you.
------------------------------
Date: Mon, 30 Nov 1998 01:49:30 +0100
From: Peter John Acklam <jacklam@math.uio.no>
Subject: Re: comparing two strings case insensatively
Message-Id: <3661EB9A.73C1BB04@math.uio.no>
Pap wrote:
>
> I tried =~ but it isn't what I'm looking for. Would I need to convert
> both of them to upper/lower case and THEN compare them?
Well, you can always try to compare them first, and convert the case
only if they differ, with something like
$same = $str1 eq $str2 || lc $str1 eq lc $str2;
Peter
--
Peter J. Acklam - jacklam@math.uio.no - http://www.math.uio.no/~jacklam
------------------------------
Date: Sun, 29 Nov 1998 19:57:17 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: comparing two strings case insensatively
Message-Id: <t1us37.gfr.ln@flash.net>
Pap (Pap22@erols.com) wrote:
: Looked around, couldn't find it...I'll need to get that Perl book this
: weekend!
You already have something far *better* than *any* book available.
Even better than whatever "that Perl book" might be.
Namely the documentation that is shipped with the
perl distribution.
Can't do a "word search" on the full text of a book.
It is a piece of cake with the standard docs.
Though searching for "case insensitive" doesn't find it,
even if you spell "insensitive" correctly...
Search for "case-insensitive" in the 'perlop' man page
and all will be revealed.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 30 Nov 1998 02:09:34 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: comparing two strings case insensatively
Message-Id: <73suou$n3i$0@206.165.167.196>
Pap wrote in message <73sgsu$dqt$1@winter.news.rcn.net>...
>Looked around, couldn't find it...I'll need to get that Perl book this
>weekend!
www.amazon.com
www.bookpool.com
>I tried =~ but it isn't what I'm looking for. Would I need to convert both
>of them to upper/lower case and THEN compare them?
You forgot your old friend i.
#!/usr/local/bin/perl -w
use strict;
my $foo = 'STRING THING';
my $bar = 'string thing';
if ($foo =~ /$bar/i) {print "They match!\n"}
else {print "They don't.\n"}
HTH
AmD
------------------------------
Date: Mon, 30 Nov 1998 00:03:23 GMT
From: heliumweb@my-dejanews.com
Subject: Free Webmaster Resources
Message-Id: <73snc5$vsp$1@nnrp1.dejanews.com>
Hello
WebKnowHow.Net is a web development directory with over 950 resources,
including tutorials, FAQ's, books, and scripts for subjects such as CGI, Perl,
Java, HTML, Web Design, Graphics, Web Promotion and more. There is also a free
search engine submission section. If you know of a good web development
resource, be sure to add it to our database.
Visit us at http://webknowhow.net
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 29 Nov 1998 13:18:28 -0800
From: Trent <trent@jps.net>
Subject: Re: Help with this example anyone?
Message-Id: <3661BA24.462D@jps.net>
Allan M. Due wrote:
> Now think about it, just because you split @lines doesn't mean changes you
> make to $customerdata are also made to @lines. @lines remains unchanged.
> If you want to change @lines you need to modify it directly.
Problem Solved. (Thanks Robert!)
$line = join ',', @customerdata;
....one simple line I did't realize needed to be there.
Thanks to all of you for your replies. They
are greatly appreciated!
Without your help I would still be pulling out hair
and asking my wife for yet another cup of coffee...
Sincerely,
Trent Hare
------------------------------
Date: Sun, 29 Nov 1998 17:47:03 +0000
From: Samantha Cheung <sc17@doc.ic.ac.uk>
Subject: How do I execute another program from a CGI script?
Message-Id: <36618897.999344E0@doc.ic.ac.uk>
I cannot get my CGI script to execute code that rearranges a file and
then searches through a file based on some information collected from
the form.
This is just one example of needing another program to execute when a
form has been submitted. The program prepares files and collects
information ready to be used later.
I have tried including the code in the CGI script, but it does not
appear to work and I cannot think of a way to start the execution of the
program in another file from the CGI script.
I hope that there is a solution, but I just do not know about it being a
beginner to PERL.
Can you help?
Samantha Cheung
Imperial College, London.
------------------------------
Date: Sun, 29 Nov 1998 21:12:34 -0500
From: brent verner <damonbrent@earthlink.net>
Subject: Re: How do I execute another program from a CGI script?
Message-Id: <3661FF12.13359461@earthlink.net>
Samantha Cheung wrote:
>
> I cannot get my CGI script to execute code that rearranges a file and
> then searches through a file based on some information collected from
> the form.
>
> This is just one example of needing another program to execute when a
> form has been submitted. The program prepares files and collects
> information ready to be used later.
>
> I have tried including the code in the CGI script, but it does not
> appear to work and I cannot think of a way to start the execution of the
> program in another file from the CGI script.
>
> I hope that there is a solution, but I just do not know about it being a
> beginner to PERL.
>
> Can you help?
>
> Samantha Cheung
> Imperial College, London.
look through the camel book for information on --
system('myotherexecutableproggie');
or
@outputlines = `myotherexecutableproggie`; [notice: these are
backticks
not single quotes]
hth.
brent
------------------------------
Date: Mon, 30 Nov 1998 11:12:40 +1100
From: Nobody <nobody@nowhere.com>
Subject: Re: how to get `date` in perl for win32 (newbie)
Message-Id: <3661E2F8.5B48528B@nowhere.com>
Steve Alpert wrote:
>
> j9feng@my-dejanews.com wrote:
>
> >
> >
> >The following codes work fine under linux,
> >
> >my $date=`date`;
> >
> >but it will not work under win95, because the command 'date' under
> >Is there a way to get the current date?
> would you believe:
>
> perl -e "print `date /t`"
Surely if portability is the issue, you would be better off using only
perl internal functions rather than relying on the underlying OS
features. Admittedly date is a fairly trivial function - try instead:
my $tot_size = `ls -lRa . | awk 'BEGIN {x=0} {x += $5} END {print
x}'`
as native Win95 (no cheating by using MKS toolkit now).
This would be a lot more elegant using opendir, readdir and so on - only
one version of the source need be maintained and distributed. The
standard guidelines for cross-platform portability apply of course - if
you MUST use native OS calls, at least isolate them so porters have an
easier job (this is by no means limited to perl).
AC.
------------------------------
Date: Sun, 29 Nov 1998 21:23:07 GMT
From: jenmei@my-dejanews.com
Subject: Is there a way to edit NT ACL info using Perl?
Message-Id: <73sdvf$oh5$1@nnrp1.dejanews.com>
Hi! Perl seems like it'd be a perfect candidate to edit Access Control List
(e.g. file permissions) information ... if there's a way to get access to that
stuff. Is there?
Here's an example of something I think Perl would be an easier alternative to
using cacls: Adding four or five people to all directories in a tree that
include "proj" in the name.
Thanks!
Jen
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 29 Nov 1998 18:16:32 -0600
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: Is there a way to edit NT ACL info using Perl?
Message-Id: <3661E3E0.9271F31@technologist.com>
I think that the "Learning Perl on Win32 Systems" or one of the other
O'Reilly NT books has Perl examples on how to do this.
I use Perl as a front-end to XCACLS and it has helped me out quite a
bit, especially with permissions!
Good luck,
Brent
--
Java? I've heard of it, it is what I drink while hacking Perl! -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: 29 Nov 1998 19:58:02 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: localtime () - perl's bug ?
Message-Id: <73s90a$k2$1@gellyfish.btinternet.com>
On Sun, 29 Nov 1998 10:53:38 -0800 Larry Rosler <lr@hpl.hp.com> wrote:
> [Posted to comp.lang.perl.misc and copy mailed.]
>
> In article <73rsh3$bv$1@gellyfish.btinternet.com> on 29 Nov 1998
> 16:25:07 -0000, Jonathan Stowe <gellyfish@btinternet.com> says...
>> On Sun, 29 Nov 1998 14:16:34 GMT Gareth Rees <garethr@cre.canon.co.uk> wrote:
>> > Larry Rosler <lr@hpl.hp.com> wrote:
>> >> sprintf('%.2d.%.2d.%.2d', $year % 100, $mon + 1, $mday),
>> >
>> > This look like a bug to me. It prints "98.11.29", but the current year
>> > is 1998, not 98.
>>
>> Thats not a bug thats a deliberate design decision ;-P
>
> What means the emoticon? You are right on! It took me many more words
> to say the same thing.
>
;-P is more of a na na na na na na schoolyard thing of light disaproval as
I see it. A seriously meant point but i dont want the recipient to take it
too bad.
Anyhow George (er sorry) Gareth must see the point now - surely ...
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 29 Nov 1998 23:27:35 +0000
From: Matt Seddon <matt@tvml.co.uk>
Subject: MacPerl file handling problem?
Message-Id: <3661D864.438AEEDD@tvml.co.uk>
I have come across one of those ARGH problems.
About 4 days ago I needed a script to extract some data from a 64 meg text
file (it was basically parseing SQL statments and writing out the relevent
ones to another file, but i digress). Aha I thought... time to go home, I'll
write it on my laptop (G3 Powerbook).
The problem is, under MacPerl, if you attempt to use the open command (actual
tiny snippet enclosed):
open DATAFILE, "requests.sql"
it suddenly decides to eat up about 15 - 20 seconds caching the entire file...
I actually ended up using a smaller, 3 meg file to prototype the code. When I
moved the script back over to linux, it worked a treat...
Any ideas?
------------------------------
Date: Mon, 30 Nov 1998 03:28:32 GMT
From: imchat@ionet.net
Subject: MIME::Lite
Message-Id: <366210b4.307512379@news.ionet.net>
After looking at the MIME::Lite Module closer I find that it
has to be installed to the perl directories which I have no access to
on my server. Anyone know of a program that can interface with
procmail to do the same thing? Sorry, but I'm being pulled in three
different directions right now to try this from scratch.
The project I'm working on is already complete, except that
sending the generated file by email would be so much better than
having the file reside on the server.
Any morsel of info would be appreciated. A link maybe?
------------------------------
Date: Mon, 30 Nov 1998 04:48:46 GMT
From: susiecox@sprint.ca (Susie)
Subject: Newbie from Ottawa, Ontario Canada
Message-Id: <366ab3c7.14311382@news.sprint.ca>
Hi there. My name is Susie. I want to learn Perl very badly. I have no
programming experience other than writting scripts for popups for
Mirc. <Yea I know...lol> In January I'm starting my diploma to become
a Programmer Analyst so yes there is hope for me but Perl is not
offered on this course and I've been advised by a few companies here
that I should learn it. I've bought O'Reilly's books..."Learning Perl
on Win32 Systems" and "Programming Perl". I started reading the
Learning Perl one and I somewhat understand what it's saying but I'm
getting confused. So with this I went searching on the web for a
tutorial that may be more basic than Learning Perl. I found one <I
thought> at http://www.netcat.co.uk/rob/perl/win32perltut.html
It seems good but I'm still confused. I think my problem is that I've
not seen Perl work. I'm confused about it's output and where it is
used. Am I sounding confused? I certainly am.<smile> In any case I've
subscribed to this newsgroup and a couple of others and I try finding
stuff on newbies and maybe seeing if I could find something out that
would help but I can't seem to find anything. If there is anyone out
there who thinks they could help me please contact me and if anyone
lives here in the Ottawa region it would be great to see how Perl
actually works. Oh yes, and I tried to find out about someone offering
a course but to no avail. Thank you all for your time.
Cheers,
Susie
------------------------------
Date: Sun, 29 Nov 1998 22:23:38 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Obfuscation of perl scripts
Message-Id: <ebohlmanF37FJE.G6@netcom.com>
Vlad Volkov <vvolkov@benton.com> wrote:
: I work for software consulting company whose clients are paying for
: delivered product - a set of routines that provides solution for certain
: business issue.
: If the program is written in C++ or VB, they are not getting the source
: code,
: because they have not PAID for it. Delivered software is a complete solution
: according
: to tech. spec. If, after certain time, the spec changes, we expect the
: client to come back
: with more work, not find somebody in-house to hack our code.
: I understand that it hurts the client but why give people
: things they have not paid for?
If you're in a situation where unless your code is hidden, the client will
dump you and "find somebody in-house to hack your code" then something's
very wrong. This situation can only arise if it would be more
cost-effective (in terms of total cost, including opportunity cost) for
the client to do that, and the only way that can happen is if you're not
providing actual value to the client.
Normally, the reason a client out-sources software development to a
consultant is that doing it in-house would not be cost-effective. Most
of the time, the client *could* do the work in-house but it would be a
bad business decision for them to do so because their staff's time is
better spent doing enterprise-specific things that only they can do
effectively. For them to take time away from these things to do
something that someone else could do would be to incur an opportunity
cost.
The main value you provide to the client is the ability to get the
software developed without all the overhead and opportunity cost that
would come from doing it in-house. After that comes the fact that because
software development is your whole business, you can do a better job of
it than someone who has to do it in addition to a whole bunch of other
tasks. You can focus on what you know to do best, and your client's
people can focus on what *they* know to do best.
In short, the client who tries to lower his costs by "stealing"
externally-developed code is almost always going to shoot himself in the
foot. You shouldn't have to worry about them beyond putting a clause in
your contract stating that if they modify your code and then need help
with it, you're going to charge them an hourly rate to do it.
------------------------------
Date: Sun, 29 Nov 1998 16:16:48 -0800
From: teltti@hotmail.com
Subject: perl for windows 95
Message-Id: <3661E3F0.35776759@hotmail.com>
Hello, I just downloaded Active Perl (Win32) and installed it. I am a
beginner to this language, however I do know how to program in Basic,
Pascal, Cobol, Visual Basic & MS Access. In fact, I have some
familiarity with HTML as well. After I installed PERL, the only thing I
see in the Start Menu is Online Documentation for ActivePerl.
Did I install something improperly?
Isn't this version of Perl supposed to be for Win95 and have a GUI?
How do I debug code if there is no environment to work in? (that is,
there has got to be a program that I launch to work with creating cgi
scripts and code, right?)
Many thanks!!!
------------------------------
Date: Sun, 29 Nov 1998 18:14:21 -0600
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: perl for windows 95
Message-Id: <3661E35D.969E6AB3@technologist.com>
teltti@hotmail.com wrote:
>
> Hello, I just downloaded Active Perl (Win32) and installed it. I am a
> beginner to this language, however I do know how to program in Basic,
> Pascal, Cobol, Visual Basic & MS Access. In fact, I have some
> familiarity with HTML as well. After I installed PERL, the only thing I
> see in the Start Menu is Online Documentation for ActivePerl.
> Did I install something improperly?
> Isn't this version of Perl supposed to be for Win95 and have a GUI?
> How do I debug code if there is no environment to work in? (that is,
> there has got to be a program that I launch to work with creating cgi
> scripts and code, right?)
>
> Many thanks!!!
ActivePerl does NOT ahve a GUI. The only real "Perl GUI" I know of is
by SolutionSoft. It is called PerlBuilder, but it is not free.
Perl has a built-in debugger and great error messages. I normally use
something like Notepad when programming in Windows. Perl really doesn't
need a GUI interface.
The only reason C and C++ now have GUI interfaces is because to program
Windows apps there is so much code to create the windows that gets
reproduced, the GUI makers simply did it for you.
Good luck,
Brent
--
Java? I've heard of it, it is what I drink while hacking Perl! -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Mon, 30 Nov 1998 09:41:17 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: Perl in NT login script
Message-Id: <3661DB9D.2B051D87@spider.herston.uq.edu.au>
1. Perl doesn't need to be in the path.
2. Perl can just live in the netlogon share, which means you can invoke
it from the logon batch file like this:
%0\..\perl.exe %0\..\myperl.pl
3. What are those semicolons at the end of your lines?
--
Jaime Metcher
quinnrob@my-dejanews.com wrote:
>
> I wanted to run a perl program I've created from a NT login script. The
> program will backup files to the server. Currently the only way I think I can
> get perl to work, without installing it on each PC, is to attempt to mount a
> drive letter to a share on the server containing perl and run the file.
> Ideas?
>
> Here's the basic concept in the script:
>
> 1. I /d (dismount any previously connected drive letters)
> 2. I mount all new drives including the drive with Perl
> 3. I attempt to run Perl -
>
> g:\winset %path%=g:\perl\bin;
> g:\bin\perl.exe g:\myperl.pl;
>
> In this example I've tried to use the winset utility that comes with 95 to
> set the path to the Perl bin directory. When I run the batch file I only get
> a "bad command or file name" message.
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 29 Nov 1998 19:15:00 -0500
From: Jay Habegger <habegger@bitpipe.com>
Subject: Using a variable as an argument to use lib
Message-Id: <3661E383.9EE1D501@bitpipe.com>
Perl Experts:
I have a situation where I need to move several scripts among several
different machines. On all of these machines I'm unable to install my
perl libaries in one of the standard places. To date I've just used a
use lib statement in each program. However, moving them around
and always commenting/un-commenting the appropriate libarary path
is getting to be a pain. I've written a short eval routine that
determines
where the program is running, acquires the lib path and places it
in a variable $LIB. Unfortunately, this doesn't seem to work.
The code structure :
# Code here.
use lib $LIB;
use my_module;
# Do work.
fails silently. That is, it compiles ok and only reports an error when
it
attempts to load my_module and can't find it. The contents of $LIB
do not get appended to @INC. I even tried the simple code:
# Code here.
my $force_lib = '/my_lib_path';
use lib $force_lib;
use my_module;
# Do work.
and this also fails. All directories are world readable and the code
works
fine if I use a string literal as the argument to use, but it doesn't
work if
I use the variable.
This is observed on both sunos 4.1.4 and BSDI.
Any suggestions?
Thanks!
- J
------------------------------
Date: 30 Nov 1998 02:31:32 GMT
From: Citizen Joe <no@spam.org>
Subject: Re: Y2K work - need suggestions
Message-Id: <73t024$h29$1@ns2.foothill.net>
In comp.unix.admin Andrew M. Langmead <aml@world.std.com> wrote:
> Citizen Joe <no@spam.org> writes:
>>It has occured to me that maybe my program is slow because there is a lot
>>of reads and writes to a disk, not because of remsh. My directory tree is
>>organized this way:
> Have you seen the perl profiling tool?
> <URL:http://reference.perl.com/module.cgi?Devel::DProf> it might give
> you a better idea of where your program is spending its time.
> If your program is spending too much time in calling remsh, is there
> some possiblity that you could group all of the calls to remsh for the
> same machine into one call? Instead of
I am almost sure that the bottleneck is writing / reading to the disk. It
takes a few milliseconds to read/write a 512 byte block. I have realized I
do it too much in the script. I will fix it ASAP.
Thanks.
------------------------------
Date: 30 Nov 1998 02:36:32 GMT
From: Citizen Joe <no@spam.org>
Subject: Re: Y2K work - need suggestions
Message-Id: <73t0bg$h29$2@ns2.foothill.net>
In comp.unix.admin John Kroll <krollj@worldnet.att.net> wrote:
> In addition to your script, I assume you have done the system adminish
> thing and have identified all the HP-UX patches you will need to
> make the OS components Y2K compliant? Remember that HP-UX 9.xx is
> not going to be made Y2K compliant, and HP-UX 10.20 requires quite
> a few patches to make it Y2K compliant.
Yeah, I am aware of that. I am not responsible for system upgrades to 10.20
and patches. I am only responsible for components.
>> Here is where the problem is. The script takes too long to execute. It
>> takes about 10 seconds for each component and I just can't figure out a way
>> to get around that. 10 seconds x 150 components x 300 machines = 450000
>> seconds to check all the components on all the machines or 125 hours, when
>> I am done.
> Is there any reason why you can't run all the machines in parallel?
> Then its 10 seconds to launch all the remote shells, then 10 seconds *
> 150 components, or about half an hour. If your scanning program
> emails its output back to you, its something the machines can run on
> Sunday afternoon and you can look through the results on Monday.
Thanks. I can do 2 things. First, I will minimize disk I/O. Secondly, I can
do it in parallel, but this can have consequences in terms of network
load. I don't want to pump too much stuff at the same time. I will have to
dicuss this with the network people who know what the through-put is. I
will do (1) and see how much that helps before I do anything else. I would
rather wait 10 hours for a script with no network load than do it half an
hour and stress it out, even at night.
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4319
**************************************