[11281] in Perl-Users-Digest
Perl-Users Digest, Issue: 4881 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 12 14:07:28 1999
Date: Fri, 12 Feb 99 11:00:17 -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 Fri, 12 Feb 1999 Volume: 8 Number: 4881
Today's topics:
Re: "cloning" tied hashes <bmb@ginger.libs.uga.edu>
Re: "Learning Perl" <bmb@ginger.libs.uga.edu>
Re: "Learning Perl" <david@inxpress.net>
Data Proc project (al)
Re: DESPERATE Help required PLEASE! (Greg Ward)
Re: DESPERATE Help required PLEASE! (Graham Ashton)
Re: File Creation ? (Clinton Pierce)
Re: fun with strings... <uri@home.sysarch.com>
Re: Insecure $ENV{ENV} complaint from -T (Greg Ward)
Re: Perl function to reboot NT Server? <jimmy@globalSpam.org>
Re: perl5 release (Greg Ward)
Re: PFR: read_file, write_file (Ilya Zakharevich)
Re: PFR: UTC_to_Epoch (Abigail)
Re: Problems Installing Perl 5.005 on Sloaris 2.6 (Greg Ward)
Re: Python vs. Perl vs. tcl ? <aqumsieh@matrox.com>
Split string <ughridk@bbbhotmail.com>
Re: Split string <david@inxpress.net>
Re: Trouble 'make'ing CPAN Modules! (Greg Ward)
Re: Trouble 'make'ing CPAN Modules! <david@inxpress.net>
Re: Unable to output after system call and opening anot (Kathy Lessa)
Re: Win32 perl how to do system(set var= $var) sirron@mail.mcoe.k12.ca.us
Re: Win32 perl how to do system(set var= $var) sirron@mail.mcoe.k12.ca.us
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 12 Feb 1999 12:45:48 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: "cloning" tied hashes
Message-Id: <Pine.A41.4.02.9902121243000.35848-100000@ginger.libs.uga.edu>
On 12 Feb 1999, Ilya Zakharevich wrote:
> Looks like 5.004. Right? A lot of things were fixed since then.
5.004, correct. We're working on that upgrade, honest!
(That's not the "royal 'we'", but the "pass the buck 'we'".)
Regards,
-Brad
------------------------------
Date: Fri, 12 Feb 1999 13:05:42 -0500
From: Brad Baxter <bmb@ginger.libs.uga.edu>
To: Bill Garrett <bgarrett@hamilton.net>
Subject: Re: "Learning Perl"
Message-Id: <Pine.A41.4.02.9902121302140.35848-100000@ginger.libs.uga.edu>
On Fri, 12 Feb 1999, Bill Garrett wrote:
> I got the book "Learning Perl" and for some reason some of the
> source code doesn't work.
> I took this code exactly from the book and it doesn't work:
> #!/usr/local/bin/perl -w
> print "What is your name?";
> $name = <STDIN>;
> chomp ($name);
> print "Hello, $name!\n";
>
> What could be the problem?
> Does it only run from the shell?
Where exactly are you trying to run it?
Did you run it from the shell?
Define, "doesn't work", exactly.
That exact code works fine for me.
Exactly yours, :-)
-Brad
------------------------------
Date: Fri, 12 Feb 1999 12:54:24 -0600
From: "David M. Lloyd" <david@inxpress.net>
Subject: Re: "Learning Perl"
Message-Id: <36C478E0.40A67255@inxpress.net>
Did you remember to 'chmod +x filename'? (Assuming UNIX of course. :)
Bill Garrett wrote:
>
> I got the book "Learning Perl" and for some reason some of the
> source code doesn't work.
> I took this code exactly from the book and it doesn't work:
> #!/usr/local/bin/perl -w
> print "What is your name?";
> $name = <STDIN>;
> chomp ($name);
> print "Hello, $name!\n";
>
> What could be the problem?
> Does it only run from the shell?
--
===========================================================
David M. Lloyd mailto:david@inxpress.net
Administrator
Internet Express, Inc.
802 W. Broadway, Suite 0101
Madison, WI. 53713-1866
Voice: (608) 663-5555 http://www.inxpress.net
Fax: (608) 663-1818 mailto:admin@inxpress.net
Data: (608) 663-5551 mailto:support@inxpress.net
===========================================================
------------------------------
Date: Fri, 12 Feb 1999 12:35:14 -0600
From: "Red Hat Linux User(al)" <aal@airmail.net>
Subject: Data Proc project
Message-Id: <A9E5CA887C66A1EC.B855AFC442743701.49EAFDFB84E30DC1@library-proxy.airnews.net>
Here is the rub.....
I have 2 text files with the following field structures
<Clients> <Leads>
clicode 4 rec# 6
qty 4 first 20
first 20 last 30
last 29 street 35
phone 14 city 22
ext 5 st 2
website 50 zip 10
crrt 4
dpb 3
result 2
endorse 35
source 6
qcode 3
mthcode 4
misc 19
these 2 files need to be combined into a third file in the following way
all fields from <clients> ,except for QTY, need to be appended to a
(QTY)
of records in <leads> (ie, if <clients>QTY=500, then the next 500
records in <leads>
will be moved to the output file with the following appends to the end
of each record:
<Clients>clicode---is appened as---------<output>clicode
<Clients>qty ---is NOT appened-------
<Clients>first ---is appened as---------<output>clifirst
<Clients>last ---is appened as---------<output>clilast
<Clients>phone ---is appened as---------<output>phone
<Clients>ext ---is appened as---------<output>ext
<Clients>website---is appened as---------<output>website
all records used should be removed from <Leads>
The output file needs to be in DbaseIII format
is this enough info?
can someone find time to help please?
------------------------------
Date: 12 Feb 1999 18:21:12 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: DESPERATE Help required PLEASE!
Message-Id: <7a1reo$4t2$5@news0-alterdial.uu.net>
Bradley J. Gibby <bgibby@iinet.net.au> wrote:
[the problem]
> What I need it to do is for every keyword the user enters, loop thru each
> line in the database and using regular expressions, find if the keyword
> occurs at any time ( case sensitive ) within any line.
>
> Once it's found a match, the line is then broken up into it's components.
[sample data]
> http://www.iinet.net.au/~bgibby/index.html::Gibby Enterprises::- This is the
> Gibby Enterprises Web Site
[attempted code]
> open (DB, "database.txt");
>
> print "Content-type: text/html\n\n";
>
> while(<DB>) {
> foreach $key (@keywords) {
> if ($_ =~ /$key/) {
> ($url, $comp, $desc) = split(/::/);
> print $url . "/" . $comp . "/" . $desc . "<br>\n";
> }
> }
>
> close (DB);
Wow, you supplied *almost* everything we need to help you. The only
thing missing: what does this code do when you run it? One obvious
problem is that you don't have enough closing braces, because the
indentation in your for loop is a little odd. I assume you goofed on
pasting your code into the post, because without that extra closing
brace, it won't even compile -- and the syntax error message that I got
was quite helpful.
Anyways, once I fixed the missing brace, your code ran just fine and
produced the expected result. So what's the problem?
Some hints:
* use a more descriptive subject line; I usually skip over
the "HELP ME PLEASE" posts
* always, ALWAYS, **ALWAYS** check the result of any operation
that can fail -- eg. 'open'
* indent loop bodies (then your missing brace error would be obvious)
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: 12 Feb 1999 18:35:08 GMT
From: ashtong@mirror.bt.co.uk (Graham Ashton)
Subject: Re: DESPERATE Help required PLEASE!
Message-Id: <slrn7c8t2t.p25.ashtong@wing.mirror.bt.co.uk>
In article <7a1m3v$p9r$1@news.iinet.net.au>, Bradley J. Gibby wrote:
>
>Here's bit of the total code:
>
>open (DB, "database.txt");
>
>print "Content-type: text/html\n\n";
>
>while(<DB>) {
> foreach $key (@keywords) {
> if ($_ =~ /$key/) {
> ($url, $comp, $desc) = split(/::/);
> print $url . "/" . $comp . "/" . $desc . "<br>\n";
> }
>}
>
>close (DB);
I think you need to check the contents of @keywords. I did a little
experiment from the command line.
First, I created a file called db.txt;
--cut--
http://www.perl.com/::Perl::- This is the Perl site
http://cpan.perl.org/::CPAN::-This is the CPAN web site
--cut--
then I copied your script almost identically;
--cut--
#!/usr/bin/perl -w
@keywords = ('cpan', 'index'); # look for lines with cpan and index
# in them
open DB, 'db.txt';
while (<DB>) {
chomp; # removes \n from each line
foreach $key (@keywords) {
if ($_ =~ /$key/) {
($url, $comp, $desc) = split(/::/);
print $url . "/" . $comp . "/" . $desc . "<br>\n";
}
}
}
close DB;
--cut--
Then I ran it;
--cut--
shandy% perl my_script
http://cpan.perl.org//CPAN/-This is the CPAN web site<br>
--cut--
I didn't change a thing to your loops (other than to add the chomp()
function which isn't relevant to your problem). Try adding a
print "keywords: @keywords\n";
line before you run through the foreach loop to see what's in it.
--
Graham
------------------------------
Date: Fri, 12 Feb 1999 18:22:59 GMT
From: cpierce1@ford.com (Clinton Pierce)
Subject: Re: File Creation ?
Message-Id: <36cc702a.863755676@news.ford.com>
On Thu, 11 Feb 1999 20:38:35 -0800, "amaring" <no_amaring@jps.net>
wrote:
>For some reason this code creates a file called "$file" instead of what it
>is supposed to create. Could someone please give me a quick reason for
>this?
>
>$file = "file.tmp";
>open(TMP, ">$file")||die("Etc");
>
>
As posted, it should (attempt to) create a file in the current
directory, called "file.tmp" (no quotes).
Are you sure you typed it exactly the way it appeared in your program?
If you typed:
open(TMP, '>$file')
You would create a file called "$file" (no quotes) instead. Go back
and check your code, and read up on the differences between the kinds
of quotes in Perl. Also, be a little more helpful in your error
messages:
open(TMP, ">$file") || die ("Creating $file: $!\n");
It'll help out down the road...
--
Clinton A. Pierce "If you rush a Miracle Man, you get rotten
cpierce1@ford.com miracles" --Miracle Max, The Princess Bride
clintp@geeksalad.org http://www.geeksalad.org
------------------------------
Date: 12 Feb 1999 13:22:37 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: fun with strings...
Message-Id: <x7n22jo51u.fsf@home.sysarch.com>
>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:
BL> Using your repeated substitutions, you can encode the string (replace
BL> the bare backslashes first), but decoding it again is impossible.
i will repeat myself. i was solving the original poster's problem. that
was it. no general do everything escaping stuff. my code did it simply,
and fast which is what was needed. he didn't have to encode, decode,
handle more escapes, etc., etc., etc.. he wanted to convert some literal
\n and \t to real ones. that was it. my code was the fastest (by far in
some cases) and probably easiest for him to understand. just a pair of
simple s///. no context, no intelligence, no nothing.
as for you code above it may have its use but not for the problem
mentioned. and even then, it is an arbitrary decision about when to
encode or decode the escapes. that cannot be perfectly decided by code
if the author was not anticipating such escaping. that is all my comment
meant. if someone puts a literal \n in text code cannot determine
without english context whether it was meant to be '\n' or "\n". that is
a simple fact. if the writer and escaping code agree on a convention that
is a different story.
so my code had no brains and converted all literal \n and \t to real
ones which is what was asked for. end of story.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 12 Feb 1999 18:13:51 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: Insecure $ENV{ENV} complaint from -T
Message-Id: <7a1r0v$4t2$4@news0-alterdial.uu.net>
John Bossert <jbossert@dazel.com> wrote:
> "Insecure $ENV{ENV} while running with -T switch at
> /opt/sw/mol_test/bin/np.pl line 130, <STDIN> chunk 1." My script is
> invoked with "perl -wT"
>
> Again, some (most) users have no problem. Everyone is running ksh,
> sourcing a common .profile. I explicitly set the $PATH within the
> script.
>
> Any idea as to what I should be looking at?
Well, at the risk of sounding obvious, you could look at line 130 of
np.pl. ;-) You could also look at the "perldiag" man page, which gives
explanations of all warning and error messages Perl emits:
Insecure $ENV{%s} while running %s
(F) You can't use system(), exec(), or a piped open in a
setuid or setgid script if any of $ENV{PATH}, $ENV{IFS},
$ENV{CDPATH}, $ENV{ENV} or $ENV{BASH_ENV} are derived
from data supplied (or potentially supplied) by the
user. The script must set the path to a known value,
using trustworthy data. See the perlsec manpage.
Short answer: you need to secure more than $ENV{'PATH'}. Are you *sure*
that all users are sourcing a common .profile? Even if they are, it's
conceivable that some of them set $ENV for whatever reason, which I
suspect would cause this problem.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Fri, 12 Feb 1999 18:36:23 GMT
From: jimmy <jimmy@globalSpam.org>
Subject: Re: Perl function to reboot NT Server?
Message-Id: <36C472C6.DA2949F9@globalSpam.org>
Georg Buehler wrote:
>
> I need to programmatically reboot a Windows NT 4.0 server using Perl.
>
> I'm sure such a function exists, but I've poured over the module
> documentation in vain.
>
> I'm currently using ActiveState's 5.00502.
>
> Thanks,
>
> --Georg Buehler
> Elsinore Technologies, Inc.
> gbuehler@elsitech.com
I'm no perl specialist, but I know Win32. There's a
funciton--ShutdownWindows that can do what you need. I think there's a
Win32:: module (package <g>?), and I'd look there for this function.
------------------------------
Date: 12 Feb 1999 17:43:29 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: perl5 release
Message-Id: <7a1p81$46q$1@news0-alterdial.uu.net>
mduwjd@maersk.com <mduwjd@maersk.com> wrote:
> I know we are using perl version 5 but how do I find out what the release
> level is ?
perl -v (or perl -V if you like lots of gory detail)
Of course, you could have found this out yourself by running "perldoc
perlrun".
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: 12 Feb 1999 17:25:00 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: PFR: read_file, write_file
Message-Id: <7a1o5c$mjg$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Uri Guttman
<uri@sysarch.com>],
who wrote in article <x71zjwp3fo.fsf_-_@home.sysarch.com>:
> sub read_file {
[...]
> local( $/ ) ;
> $text = <FH> ;
> close( FH ) ;
> return( $text ) ;
> }
Due to a bug in <FH>, this returns undef on empty files. While we are
waiting for this bug to be fixed, you may want to fix your function.
Ilya
------------------------------
Date: Fri, 12 Feb 1999 17:52:29 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: PFR: UTC_to_Epoch
Message-Id: <xTZw2.2752$rs2.2589589@client.news.psi.net>
Larry Rosler (lr@hpl.hp.com) wrote on MCMXCI September MCMXCIII in
<URL:news:MPG.112d27d35a79a401989a24@nntp.hpl.hp.com>:
[]
[] sub UTC_to_Epoch {
[] my ($year, $mon, $day, $hour, $min, $sec) = @_;
[] defined $year && defined $mon && defined $day or return;
[] my @m_day = (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
[] $m_day[2] = 29 unless $year % 4; # OK from 1901 through 2099.
[]
[] 1970 <= $year && $year <= 2099
[] && 1 <= $mon && $mon <= 12
[] && 1 <= $day && $day <= $m_day[$mon]
[] && 0 <= ($hour ||= 0) && $hour <= 23
[] && 0 <= ($min ||= 0) && $min <= 59
[] && 0 <= ($sec ||= 0) && $sec <= 59 or return;
[]
[] # Adapted from Astronomical Computing, Sky & Telescope, May, 1984.
[] 24 * 60 * 60 * (367 * $year - 678972 - 40587 + int(275 * $mon / 9) +
[] $day - int((int(int($year + ($mon < 9 ? -1 : 1) *
[] int(abs($mon - 9) / 7)) / 100) + 1) * 3 / 4) -
[] int(7 * (int(($mon + 9) / 12) + $year) / 4)) +
[] 60 * 60 * $hour + 60 * $min + $sec
[] }
Perhaps you want to 'use integer;', which would avoid the calls to
int() and should speed up things as well. As for allowing up to 2099,
Perl isn't 64bit aware, not even on 64bit platforms, is it? At least,
it doesn't seem to be on mine.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: 12 Feb 1999 18:02:43 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: Problems Installing Perl 5.005 on Sloaris 2.6
Message-Id: <7a1qc3$4t2$2@news0-alterdial.uu.net>
martin strohmaier <martin.strohmaier@bt.com> wrote:
> Getting error : on install make test :
>
> make: Warning: Both `makefile' and `Makefile' exist
> `sh cflags libperl.a miniperlmain.o` miniperlmain.c
> CCCMD = gcc -DPERL_CORE -c
> In file included from perl.h:361,
> from miniperlmain.c:11:
> /usr/local/lib/gcc-lib/sparc-sun-solaris2.4/2.6.3/include/sys/param.h:185:
^^^
[rest of output deleted]
But in your subject line you said this was Solaris 2.6. You should
probably rebuild and reinstall gcc for Solaris 2.6. (You never know how
the system header files will change between releases, and I bet that's
what you're being bitten by.)
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Fri, 12 Feb 1999 18:33:37 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: Python vs. Perl vs. tcl ?
Message-Id: <7a1s61$jkh$1@nnrp1.dejanews.com>
In article <wkvhh96h6g.fsf@ifi.uio.no>,
Lars Marius Garshol <larsga@ifi.uio.no> wrote:
> | and since most of the time i intend "print" to print a line of text,
> | it declutters the code a bit, not having to explicitly mention all
> | the newlines.
>
> This is why I prefer the implicit newlines too.
Just a clarification here. I never said that I didn't like Python's print()
syntax. The whole issue came up when I was trying to point out some "awkward"
syntax in Perl and Python. Awkward does not necessarily mean ugly or useless.
Moreover, at this point, I am just a novice Python programmer that is reading
as much Python (and Perl) as my time would allow me.
By the way, (I am sure I will discover this with time but I will ask now
anyway) .. does Python allow me to change the default input record separator
value "\n" (as well as other built-in variables) into whatever I want? I sure
do hope so!!
--Ala
$monger->{montreal}->[0];
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 13:05:23 -0500
From: "Professeur Alfred" <ughridk@bbbhotmail.com>
Subject: Split string
Message-Id: <t5_w2.1399$J5.1007@weber.videotron.net>
I'm a novice in Perl programming. I would to know how to split a string on
the '?' character.
I tried to do it this statement but it doesn't work:
($address,$search) = split (/?/, $variable);
the $variable is an URL like: http://domain_name.com/home.htm?vara=x&varb=y
I think the problem is that Perl interprets the '?' as a wild card and not
as a character.
Thanks for your help!
If you want to answer me by e-mail, retrieve the "bbb" from my address.
ughridk@bbbhotmail.com
------------------------------
Date: Fri, 12 Feb 1999 12:54:56 -0600
From: "David M. Lloyd" <david@inxpress.net>
Subject: Re: Split string
Message-Id: <36C47900.6A97E781@inxpress.net>
Try putting a backslash \ before the ? so: \?
Professeur Alfred wrote:
>
> I'm a novice in Perl programming. I would to know how to split a string on
> the '?' character.
> I tried to do it this statement but it doesn't work:
> ($address,$search) = split (/?/, $variable);
>
> the $variable is an URL like: http://domain_name.com/home.htm?vara=x&varb=y
>
> I think the problem is that Perl interprets the '?' as a wild card and not
> as a character.
>
> Thanks for your help!
>
> If you want to answer me by e-mail, retrieve the "bbb" from my address.
> ughridk@bbbhotmail.com
--
===========================================================
David M. Lloyd mailto:david@inxpress.net
Administrator
Internet Express, Inc.
802 W. Broadway, Suite 0101
Madison, WI. 53713-1866
Voice: (608) 663-5555 http://www.inxpress.net
Fax: (608) 663-1818 mailto:admin@inxpress.net
Data: (608) 663-5551 mailto:support@inxpress.net
===========================================================
------------------------------
Date: 12 Feb 1999 18:10:41 GMT
From: gward@cnri.reston.va.us (Greg Ward)
Subject: Re: Trouble 'make'ing CPAN Modules!
Message-Id: <7a1qr1$4t2$3@news0-alterdial.uu.net>
David M. Lloyd <david@inxpress.net> wrote:
> I am implementing a multi-process system in Perl, and I decided to try
> the PlRPC module. I downloaded it and intalled it, at which point it
> told me that I was missing Net::Daemon and Storable. No problem; I
> then downloaded the two missing modules from the same ftp site. The
> problem arose, however, when I tried to run the makefile for either
> one. I get this error:
>
> make: don't know how to make /usr/local/perl/config.sh. Stop
Hmmm. First, did you do "the usual thing" for building Perl modules,
namely
perl Makefile.PL
make
make test
make install
(Well, I assume you didn't do the 'test' and 'install' steps since the
'make' step failed for you. But I hope that's what you were *going* to
do!)
Next, what version of Perl are you running? Run "perl -v" to find out.
If it's >= 5.004, don't worry about having to upgrade unless your
installation is screwed up. (5.003 should be OK, too, but it's pretty
old so you'd be well-advised to upgrade.)
Also, are you able to build any other modules, or just Net::Daemon and
Storable?
You might want to post an exact (but minimal!) transcript of the session
that resulted in that "/usr/local/perl/config.sh" error. That's a very
odd one, and I don't know where it could be coming from.
Greg
--
Greg Ward - software developer gward@cnri.reston.va.us
Corporation for National Research Initiatives
1895 Preston White Drive voice: +1-703-620-8990 x287
Reston, Virginia, USA 20191-5434 fax: +1-703-620-0913
------------------------------
Date: Fri, 12 Feb 1999 12:53:31 -0600
From: "David M. Lloyd" <david@inxpress.net>
Subject: Re: Trouble 'make'ing CPAN Modules!
Message-Id: <36C478AB.279FC180@inxpress.net>
Greg Ward wrote:
>
>
> Hmmm. First, did you do "the usual thing" for building Perl modules,
> namely
>
> perl Makefile.PL
> make
> make test
> make install
>
> (Well, I assume you didn't do the 'test' and 'install' steps since the
> 'make' step failed for you. But I hope that's what you were *going* to
> do!)
Yup, just like the docs said; of course I didn't make it past 'make'.
:-/
> Next, what version of Perl are you running? Run "perl -v" to find out.
It told me: "This is perl, version 5.005_02 built for i386-bsdos"
> If it's >= 5.004, don't worry about having to upgrade unless your
> installation is screwed up. (5.003 should be OK, too, but it's pretty
> old so you'd be well-advised to upgrade.)
I wouldn't know if my installation is screwd up: I inherited this
beast from a sysadmin who didn't document a darn thing. :-)
> Also, are you able to build any other modules, or just Net::Daemon and
> Storable?
Those are the only two I tried; I just figured that if those two don't
go why would any others.
> You might want to post an exact (but minimal!) transcript of the session
> that resulted in that "/usr/local/perl/config.sh" error. That's a very
> odd one, and I don't know where it could be coming from.
!!
You know, the whole server just crashed about fifteen minutes ago,
so I went and hit the button; then I did 'make', and the whole thing
worked! Well, I'll take any solution I can get, I guess. :-)
Thanks for the help!
===========================================================
David M. Lloyd mailto:david@inxpress.net
Administrator
Internet Express, Inc.
802 W. Broadway, Suite 0101
Madison, WI. 53713-1866
Voice: (608) 663-5555 http://www.inxpress.net
Fax: (608) 663-1818 mailto:admin@inxpress.net
Data: (608) 663-5551 mailto:support@inxpress.net
===========================================================
------------------------------
Date: Fri, 12 Feb 1999 18:09:25 GMT
From: klessa@NOSPAMairmail.net (Kathy Lessa)
Subject: Re: Unable to output after system call and opening another file
Message-Id: <306A1397EE8B0C56.1D3F31BD00EA9B13.EFF7ED26F409CC45@library-proxy.airnews.net>
Well darn. That's the way to fix a problem, just post a public
question!
It's working now. It had something to do with an error in the
executable. Sorry for waste of bandwidth!
On Fri, 12 Feb 1999 17:14:46 GMT, klessa@NOSPAMairmail.net (Kathy
Lessa) wrote:
>I am sure I'm missing something quite simple here, but I'm having some
>difficulties. I would appreciate any assistance I could get on it.
>Thanks!
------------------------------
Date: Fri, 12 Feb 1999 18:20:07 GMT
From: sirron@mail.mcoe.k12.ca.us
Subject: Re: Win32 perl how to do system(set var= $var)
Message-Id: <7a1rcb$ioc$1@nnrp1.dejanews.com>
In article <MPG.112bab78befd67339896ad@206.184.139.132>,
moseley@best.com (Bill Moseley) wrote:
> In article <79sn5g$329$1@nnrp1.dejanews.com>, sirron@mail.mcoe.k12.ca.us
> says...
> > $return_code = system("set myvar=$data");
> ..
> > When I do this, I find that the return code is always 0. When I do a set
> > command in a dos window after running this script, I find that the variable
> > is not being set.
>
> Isn't the environment you are setting in the system call long gone when
> you exit the perl program? Even after you exit the system call?
>
> --
> Bill Moseley mailto:moseley@best.com
>
I don't know. What I would like to be able to do is set this environment
variable so that the next perl script in a batch job can use it as input.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 12 Feb 1999 18:23:08 GMT
From: sirron@mail.mcoe.k12.ca.us
Subject: Re: Win32 perl how to do system(set var= $var)
Message-Id: <7a1rhv$j3c$1@nnrp1.dejanews.com>
Thanks for your answer. I did not think about using child processes. I was
under the delusion that I could set this environment variable with one script
in a batch file and the next script in the same batch file would be able to
pick it up and use it. Thanks.
In article <7a1dks$b3c@romeo.logica.co.uk>,
"James Richardson" <richardsonja@logica.com> wrote:
>
> sirron@mail.mcoe.k12.ca.us wrote in message
> <79sn5g$329$1@nnrp1.dejanews.com>...
> >Hello group,
> >
>
> >When I do this, I find that the return code is always 0. When I do a set
> >command in a dos window after running this script, I find that the variable
> >is not being set.
> >
> >Any thoughts would be appreciated.
>
> Ho hum.... (this answer is about *nix, but I guess that NT follows something
> similar)...so your program wont work on Linux either.
>
> A child inherits an environment from its parent.
> A child cannot alter the environment of its parent, cos the two processes
> exist in separate memory spaces. (unless 1) The parent is involved somehow
> 2) maybe with vfork(), but this is probably v. dangerous and unsupported))
>
> This is why you have things like the '.' and 'source' commands.
>
> Consider:
>
> Program A Child
> -------------- --------
>
> setenv("X=1")
> fork (Spoing - I'm a new
> process - X=1)
> exec(b)
> b: X=2
> exit
> X is still 1
>
> HTH
>
> James
>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4881
**************************************