[13540] in Perl-Users-Digest
Perl-Users Digest, Issue: 950 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 30 11:07:11 1999
Date: Thu, 30 Sep 1999 08:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <938703915-v9-i950@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 30 Sep 1999 Volume: 9 Number: 950
Today's topics:
Re: acos function jmn.ac.delete@abanet.it
ANNOUNCEMENT: NEW VERSION: HTML::Template 0.91 <sam@tregar.com>
Re: Bye Tom? (WAS: Re: injecting "my" varibales into ca (Jenda Krynicky)
Re: Can't quite figure out DBI and references... dominicj@my-deja.com
Re: CGI call CGI? (Bill Moseley)
CGI_Lite.pm question gmac63@perigee.net
Re: DB_File (Dan Wilga)
Re: extracting values fromsplit-derived array (M.J.T. Guy)
Re: extracting values fromsplit-derived array (M.J.T. Guy)
Re: gcos/gecos ...thanks <picaza@chsi.com>
Re: Help on finding duplicate lines in two files <sariq@texas.net>
Re: HELP! Clueless know-nothing asks a question (Abigail)
Re: HELP! Clueless know-nothing asks a question (Jenda Krynicky)
Re: HELP! Clueless know-nothing asks a question <koharik@primenet.com>
How to print to a printer? <eldridgem@ihorizons.net>
Re: How to print to a printer? (Mark A. Hershberger)
Killing LWP::UserAgent (Bill Moseley)
Re: Killing LWP::UserAgent <gisle@aas.no>
Re: Killing LWP::UserAgent (Bill Moseley)
Re: LWP::UserAgent and timeout problem (Bill Moseley)
Re: needs to export a variable in my environnement c_j_marshall@my-deja.com
Re: needs to export a variable in my environnement (Bill Moseley)
Re: Perl - SQL examples <mpeppler@peppler.org>
Re: Piping (M.J.T. Guy)
Please Help: install module on Red Hat <pete@onm1.demon.co.uk>
Re: Proble with chopped filenames from script <picaza@chsi.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Sep 99 11:26:00 GMT
From: jmn.ac.delete@abanet.it
Subject: Re: acos function
Message-Id: <37f348c8.0@etsv0008>
Alex Rhomberg <rhomberg@ife.ee.ethz.ch> wrote:
> sub acos { atan2( sqrt(1 - $_[0] * $_[0]), $_[0] ) }
Thanks, this was what I was looking for. All that I can say in my defense is that this isn't mentioned in my 5.002 distribution or in the Camel Book.
Thanks again,
John.
------------------------------
Date: 29 Sep 1999 15:57:41 GMT
From: Sam Tregar <sam@tregar.com>
Subject: ANNOUNCEMENT: NEW VERSION: HTML::Template 0.91
Message-Id: <7stctl$nmg$1@play.inetarena.com>
ANNOUNCEMENT: NEW VERSION: HTML::Template 0.91
NAME
HTML::Template - a Perl module to use HTML Templates
CHANGES
0.91
- bug fix: possible loss of text after a </TMPL_IF>
(Spotted by Tom Huskins)
DESCRIPTION
This module attempts make using HTML templates simple and natural. It
extends standard HTML with a few new HTML-esque tags - <TMPL_VAR>,
<TMPL_LOOP>, <TMPL_INCLUDE>, <TMPL_IF> and <TMPL_ELSE>. The file
written with HTML and these new tags is called a template. It is
usually saved separate from your script - possibly even created by
someone else! Using this module you fill in the values for the
variables, loops and branches declared in the template. This allows
you to seperate design - the HTML - from the data, which you generate
in the Perl script.
This module is licenced under the GPL. See the LICENCE section of the
README.
AVAILABILITY
The module is available on CPAN. You can get it using CPAN.pm or go
to:
http://www.cpan.org/authors/id/S/SA/SAMTREGAR/
MOTIVATION
It is true that there are a number of packages out there to do HTML
templates. On the one hand you have things like HTML::Embperl which
allows you to freely mix Perl with HTML. On the other hand lie
home-grown variable substitution solutions. Hopefully the module can
find a place between the two.
One advantage of this module over a full HTML::Embperl-esque solution
is that it enforces an important divide - design and programming. By
limiting the programmer to just using simple variables and loops in
the HTML, the template remains accessible to designers and other
non-perl people. The use of HTML-esque syntax goes further to make
the format understandable to others. In the future this similarity
could be used to extend existing HTML editors/analyzers to support
this syntax.
An advantage of this module over home-grown tag-replacement schemes is
the support for loops. In my work I am often called on to produce
tables of data in html. Producing them using simplistic HTML
templates results in CGIs containing lots of HTML since the HTML
itself could not represent loops. The introduction of loop statements
in the HTML simplifies this situation considerably. The designer can
layout a single row and the programmer can fill it in as many times as
necessary - all they must agree on is the parameter names.
For all that, I think the best thing about this module is that it does
just one thing and it does it quickly and carefully. It doesn't try
to replace Perl and HTML, it just augments them to interact a little
better. And it's pretty fast.
DOCUMENTATION
The documentation is in Template.pm in the form of POD format
perldocs. Even the above text might be out of date, so be sure to
check the perldocs for the straight truth.
CONTACT INFO
This module was written by Sam Tregar (sam@tregar.com) for Vanguard
Media (http://www.vm.com).
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 30 Sep 1999 14:28:48 GMT
From: Jenda@Krynicky.cz (Jenda Krynicky)
Subject: Re: Bye Tom? (WAS: Re: injecting "my" varibales into callers scope)
Message-Id: <1103_938701728@prague_main>
On 29 Sep 1999 22:27:59 GMT, "Paul J. Lucas" <pjl@be-NOSPAM-st.com> wrote:
> In <slrn7uuk78.k8j.*@dragons.duesouth.net> *@dragons.duesouth.net (Matthew Bafford) writes:
>
> >Tom Christiansen:
> >: I don't really think this forum deserves any more help at all, from me,
> >: or from anyone. You can suffer by yourselves.
>
> >Thank you Tom for all you've done for clpm over the years. It's a
> >shame to see another of the original Perlers drop out; we'll miss you.
>
> I won't. How can anybody think he's NOT a major asshole?
> He seems like an angry, bitter little man.
>
> - Paul
Well even though I agree that sometimes he's sometimes a bit harsh,
I think we should all be sad if he realy leaves.
I understand pretty well WHY is he rude sometimes, I feel the urge myself pretty often.
If you see that your work is ignored, that people keep asking the same stupid
questions over and over again you realy cannot feel too well.
Tom, if you still are around. Get some rest, let us take the load for some time and then
came back please. You may ignore the stupid questions and answer only those more
challenging. We'll flame the loosers ourselves ;-)
Jenda
http://Jenda.Krynicky.cz
------------------------------
Date: Thu, 30 Sep 1999 14:05:23 GMT
From: dominicj@my-deja.com
Subject: Re: Can't quite figure out DBI and references...
Message-Id: <7svqmo$po$1@nnrp1.deja.com>
You need to pass a reference to the variables not a string
This works:
@col_name =\( $surname, $forename );
$sth->bind_columns(undef, @col_name);
Or use bind_col:
@col_name = qw( surname forename );
$i = 1;
foreach $col (@col_name) {
$sth->bind_col($i, \$DB{$col});
$i=$i+1;
}
Good Luck
Statedigital
In article <7s5mmv$mec$1@nnrp1.deja.com>,
learningapache@my-deja.com wrote:
> As a farily new Perl user, I'm trying to learn a number of new things,
> including the DBI module and hard references.
>
> Up till now, I've been using an array which contains a list of words
> which can be used in two contexts: either as regular words OR as
> the names of existing variables. The "regular words" context is used
> for a SQL CREATE statement, and the variable context is used for a SQL
> INSERT statement:
>
> @dbvars = qw(firstname lastname phonenum);
>
> $myquery = "CREATE TABLE foo (";
> for (@dbvars) {
> # "regular words" context
> $query .= "$_ CHAR(50),";
> }
> chop($query);
> ...
> $query = "INSERT INTO foo VALUES (";
> for (@dbvars) {
> # variable context
> $query .= $dbh->quote(${$_}) . ",";
> }
> chop($query);
>
> However, I now want to use the "bind_columns" function of DBI, which
> expectins an array of references. From its man page:
>
> $rc = $sth->bind_columns(@list_of_refs_to_vars_to_bind);
>
> Now I suppose I could convert my current @dbvars array to be an array
of
> references:
>
> @dbvars = "\$firstname,\$lastname,\$phonenum";
>
> then later use them in "variable context":
>
> for (@dbvars) {
> # variable context
> $query .= $dbh->quote($$_) . ",";
> }
>
> but then it seems I've lost the ability to use the contents of dbvars
as
> "regular words". IS there a way to use a single array so that it can
be
> in all three contexts (regular words for CREATE, variable names for
> INSERT, references to variable for bind_columns) ?
>
> Thanks.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 30 Sep 1999 05:29:51 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: CGI call CGI?
Message-Id: <MPG.125cf79c92c26452989798@206.184.139.132>
Bangert Goldsmith (bg25@mailexcite.com) seems to say...
> How can I call an CGI script from another CGI script, both in Perl?
perldoc LWP
or if on the same machine why not system(), backticks, or pipe open?
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Thu, 30 Sep 1999 13:58:37 GMT
From: gmac63@perigee.net
Subject: CGI_Lite.pm question
Message-Id: <7svqa5$ch$1@nnrp1.deja.com>
Hi Perl-Mates!
Heres a question on CGI.pm OR CGI_Lite.pm (preferably CGI_Lite.pm).
I'm running Apache 1.2.6 on a RedHat 5.1 i386, 96MB RAM (I know its
low), and am using CGI_Lite.pm. It is used to allow us to use CGI
scripts and upload files.
Raul Almquist was kind enough to let me in on CGI_Lite.pm, but I have a
few more questions:
1) I had CGI.pm in cgi-bin (adjacent to the cgi scripts). Same true for
CGI_Lite.pm? If not, where?
2) I chmod 755, chown root, and chgrp <web server's group>. correct?
3) Any known problems with buffers I need to know? I heard of problems
with Macintosh and/or Windows files uploading in re. buffers. Anyone
know what the issues are?
To get an idea of what I am doing, go to:
http://linuxserver.belkprinting.com
and follow the instructions in the first section on Web uploads.
Reply in email to wyates@belkprinting.com OR gmac63@perogee.net.
Thanks!!!
-Wes Yates
Belk Printing technologies.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 30 Sep 1999 09:38:48 -0400
From: dwilgaREMOVE@mtholyoke.edu (Dan Wilga)
Subject: Re: DB_File
Message-Id: <dwilgaREMOVE-3009990938490001@wilga.mtholyoke.edu>
In article <37EF7664.25C8D185@motorola.com>, Joe Buhr
<joe.buhr@motorola.com> wrote:
> I think this should be a simple problem... hopefully someon can point
> out my err right away, so here goes.
>
> I would like to use the perl DB_File module to store some data. I'll
> show what I'm trying to do in to seperate scripts. Here's the syntax:
>
> ************************************
> #!/usr/misc/bin/perl
>
> use DB_File;
>
> tie %h, "DB_File", "test", O_RDWR|O_CREAT, 0644;
I'd suggest you check the error code here. It will probably explain why
this is failing.
tie %h, "DB_File", "test", O_RDWR|O_CREAT, 0644 or die "Can't open db: $!\n";
Dan Wilga dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply **
------------------------------
Date: 30 Sep 1999 13:01:28 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: extracting values fromsplit-derived array
Message-Id: <7svmv8$g57$1@pegasus.csx.cam.ac.uk>
In article <7sqhf4$fa5$1@rguxd.viasystems.com>,
lt lindley <lee.lindley@bigfoot.com> wrote:
>Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote:
>:>Use of uninitialized value at oo.pl line 12, <> chunk 1.
>
>:>I've put my code below. Does anyone have any advice? Should I further
>:>split each element by newline?
>
>
>:>while(<>)
>:>{
>:> @chunks = split(/Tom/, $_);
>:> foreach $chunk(@chunks)
>:> {
>:> $ff = $1 if (/^F\s(\d+)$/);
>:> $gg = $1 if (/^G\s(\d+)$/);
>:> print "$ff, $gg\n";
>:> }
>:>}
>
>The answer can most likely be found from the first paragraph of the
>documentation on split:
>Splits a string into an array of strings, and returns it. By default,
>empty leading fields are preserved, and empty trailing ones are deleted
>
>Assuming that the line starts with the word "Tom", $chunks[0] would
>be the undef value.
Nope. It would be the empty string. Very different, especially if
you use -w.
Mike Guy
------------------------------
Date: 30 Sep 1999 13:11:42 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: extracting values fromsplit-derived array
Message-Id: <7svnie$glj$1@pegasus.csx.cam.ac.uk>
Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote:
>I have split a file into 'chunks' with the following code:
>
>undef $/;
>
>while(<>)
>{
> @chunks = split(/SEGM/, $_);
>}
That's a funny use of a loop. Since you have undefined $/, it will
read exactly one line. And it's good practice to only undefine $/
locally, to avoid affecting other parts of your program:
{ local $/;
@chunks = split(/SEGM/, <>);
}
>Foreach element of @chunks, I would like to extract values, but whe I
>try I get:
>
>Use of uninitialized value at oo.pl line 12, <> chunk 1.
It would have been helpful if you had indicated which was line 12 ...
>while(<>)
>{
> @chunks = split(/Tom/, $_);
> foreach $chunk(@chunks)
> {
> $ff = $1 if (/^F\s(\d+)$/);
> $gg = $1 if (/^G\s(\d+)$/);
> print "$ff, $gg\n";
> }
>}
I'll guess the failing line is the "print". Further, I'll guess that
one or other of $ff or $gg isn't set. Which would be because the
corresponding regular expression hadn't matched. Which is highly
likely, since no string can match *both* of those regular expressions.
Mike Guy
------------------------------
Date: Thu, 30 Sep 1999 08:03:59 -0400
From: "Peter Icaza" <picaza@chsi.com>
Subject: Re: gcos/gecos ...thanks
Message-Id: <7svjik$43ig$1@pike.uhc.com>
> Flattery will get you nowhere.
it work on my girlfriend->wife :)
> Arcana. We also handle requests for Latin and Greek too,
and geek? oh yea see The Hacker's Jargon File".
peter
------------------------------
Date: Thu, 30 Sep 1999 09:33:05 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Help on finding duplicate lines in two files
Message-Id: <37F374A1.F15FDEE3@texas.net>
tvn007@my-deja.com wrote:
>
> Hello,
>
> Would someone help me with the following problem ?
>
> Compare each line on each file, if the line is the same on
> each file then put ; in front of that line.
See perlfaq4.
- Tom
------------------------------
Date: 30 Sep 1999 06:51:49 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: HELP! Clueless know-nothing asks a question
Message-Id: <slrn7v6k6g.6o.abigail@alexandra.delanet.com>
James E. (jre@idirect.com) wrote on MMCCXXI September MCMXCIII in
<URL:news:i9BI3.16108$fp1.182268@quark.idirect.com>:
;; Dear CGI gods and/or goddessess -
They are not here. They might be in a group that deals with CGI.
;; I'm trying to get info from a file (wwwboard.out) to an HTML file
;; (index.html). In the index.html, I have <!--#exec cgi="getforum.pl"-->, and
;; the file I'm executing is below:
;;
;; #!/usr/local/bin/perl
;;
;; open(FORUM,"wwwboard.out");
^
|
Duh!
;; print "Content-type: text/html\n\n";
;; while(<FORUM>) {
;; print "$_";
;; }
;;
;; close FORUM;
;;
;;
;; =====
;; When I open the index.html file, there's nothing!
Now, that's weird. I would say you would see '<!--#exec cgi="getforum.pl"-->'
there. Who took it?
;; wwwboard.out has
;; something in it, so it should load.
Well, that's what you *think*. But you don't *test*.
;; The server supports SSI, and everything
;; is CHMOD'd properly. So my question - what's wrong!?
That could be anything. But if you keep Perl silent, why should we guess?
;; Please email me, as this isn't one of my usual usenet haunts. :)
Well, I guess then the answer isn't important to you.
Abigail
--
perl -wlpe '}{$_=$.' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 30 Sep 1999 14:33:46 GMT
From: Jenda@Krynicky.cz (Jenda Krynicky)
Subject: Re: HELP! Clueless know-nothing asks a question
Message-Id: <1104_938702026@prague_main>
On Thu, 30 Sep 1999 03:53:50 GMT, "James E." <jre@idirect.com> wrote:
> Dear CGI gods and/or goddessess -
>
> I'm trying to get info from a file (wwwboard.out) to an HTML file
> (index.html). In the index.html, I have <!--#exec cgi="getforum.pl"-->, and
> the file I'm executing is below:
>
> #!/usr/local/bin/perl
>
> open(FORUM,"wwwboard.out");
You should always check the result of open() !!!
unless (open(FORUM,"wwwboard.out")) {
print "[ERROR: Could not open wwwboard.out : $!]\n";
exit;
}
Maybe the current directory is not what you think it is. Maybe you do not have
enough rights to open file. Maybe ...
HTh, Jenda
http://Jenda.Krynicky.cz
P.S.: You do not have to be that hard on yourself. :-) But you should try to use a meaningfull subject line.
------------------------------
Date: Thu, 30 Sep 1999 08:01:04 -0700
From: Chris Koharik <koharik@primenet.com>
Subject: Re: HELP! Clueless know-nothing asks a question
Message-Id: <Pine.BSI.3.96.990930075930.14138F-100000@usr06.primenet.com>
> Date: Thu, 30 Sep 1999 14:33:46 GMT
> From: Jenda Krynicky <Jenda@Krynicky.cz>
>
> On Thu, 30 Sep 1999 03:53:50 GMT, "James E." <jre@idirect.com> wrote:
> > Dear CGI gods and/or goddessess -
> >
> > I'm trying to get info from a file (wwwboard.out) to an HTML file
> > (index.html). In the index.html, I have <!--#exec cgi="getforum.pl"-->, and
> > the file I'm executing is below:
> >
> > #!/usr/local/bin/perl
> >
> > open(FORUM,"wwwboard.out");
>
> You should always check the result of open() !!!
>
> unless (open(FORUM,"wwwboard.out")) {
> print "[ERROR: Could not open wwwboard.out : $!]\n";
> exit;
> }
Isn't this a bit of a kludge when you have the "or die" option available
to you?
open(FORUM,"wwwboard.out") or die "Could not open file: $!";
> Maybe the current directory is not what you think it is. Maybe you do not have
> enough rights to open file. Maybe ...
...he hasn't tested his script thoroughly.
-Chris
------------------------------
Date: Thu, 30 Sep 1999 10:04:36 -0400
From: "M.E." <eldridgem@ihorizons.net>
Subject: How to print to a printer?
Message-Id: <37F36DF4.FF59CCA3@ihorizons.net>
I'm somewhat knowledgeable in Perl but not an expert by any means.
I need to be able to print a file from a linux box to a printer.
Is this possible?
I'd appreciate any help or links to help that anyone can give me.
I know NOTHING about using modules, so if the answer involves a module,
please be detailed in the steps I'd have to do.
Thank you in advance.
------------------------------
Date: 30 Sep 1999 09:56:58 -0500
From: mah@everybody.org (Mark A. Hershberger)
Subject: Re: How to print to a printer?
Message-Id: <49k8p8phvp.fsf@playpen.baileylink.net>
[mailed and posted]
"M.E." <eldridgem@ihorizons.net> writes:
> I'm somewhat knowledgeable in Perl but not an expert by any means.
> I need to be able to print a file from a linux box to a printer.
> Is this possible?
open(PRINTER, "|lpr -P$printer");
print PRINTER "stuff to print";
close(PRINTER);
Hope that helps,
Mark.
------------------------------
Date: Thu, 30 Sep 1999 05:41:07 -0700
From: moseley@best.com (Bill Moseley)
Subject: Killing LWP::UserAgent
Message-Id: <MPG.125cfa3e7589114498979a@206.184.139.132>
I'm using LWP to get headers from a server. I'm using the HEAD request,
but as many servers refuse the HEAD request, I then use a GET request.
My question: If I use the GET request are there any tricks to tell
LWP::UserAgent to just read the headers and close the connection. I
don't want to wait while it reads the entire page from the server.
Thanks,
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: 30 Sep 1999 15:33:14 +0200
From: Gisle Aas <gisle@aas.no>
Subject: Re: Killing LWP::UserAgent
Message-Id: <m3ogeked7p.fsf@eik.g.aas.no>
moseley@best.com (Bill Moseley) writes:
> I'm using LWP to get headers from a server. I'm using the HEAD request,
> but as many servers refuse the HEAD request, I then use a GET request.
>
> My question: If I use the GET request are there any tricks to tell
> LWP::UserAgent to just read the headers and close the connection. I
> don't want to wait while it reads the entire page from the server.
$ua->max_size(1);
I should probably have made $ua->max_size(0) work too, but currently
it is treated aas $ua->max_size(undef).
--
Gisle Aas
------------------------------
Date: Thu, 30 Sep 1999 06:47:04 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Killing LWP::UserAgent
Message-Id: <MPG.125d09b0433681879897a3@206.184.139.132>
Gisle Aas (gisle@aas.no) seems to say...
> moseley@best.com (Bill Moseley) writes:
> > My question: If I use the GET request are there any tricks to tell
> > LWP::UserAgent to just read the headers and close the connection. I
> > don't want to wait while it reads the entire page from the server.
>
> $ua->max_size(1);
Which of course is right there in the documentation!
Thanks,
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Thu, 30 Sep 1999 06:05:00 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: LWP::UserAgent and timeout problem
Message-Id: <MPG.125cffda52c287898979d@206.184.139.132>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
John Callender (jbc@shell2.la.best.com) seems to say...
> Steve Linberg <slinberg@crocker.com> wrote:
> > I'm having trouble getting the timeout method for LWP::UserAgent to act
> > like it seems to me that it should.
>
> I had the same experience over the weekend in trying to write a
> link-checking script that would complete its run in a reasonable amount
> of time when doing HEAD requests on a large collection of links. After
> experiencing the same thing you did, I tried sticking the part of the
> code that did the requesting inside an eval, and using the alarm()
> function to bomb out after a set time, but the same thing happened:
> certain requests would sit there for an unacceptably long time.
What are you running on? I'm doing this on solaris and the timeouts
work fine. I give 30 seconds for a HEAD reqest, then on failed HEAD
requests I do a GET request with a 30 second timeout. I time the entire
process for each URL I check, and the ones that fail (almost 1000)
always have a total time of just a minute.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Thu, 30 Sep 1999 11:27:56 GMT
From: c_j_marshall@my-deja.com
Subject: Re: needs to export a variable in my environnement
Message-Id: <7svhfk$pvd$1@nnrp1.deja.com>
well you could always cheat.
Assuming your standard shell is bourne shell:
#!/usr/local/bin/perl5.00404
$foo = "HELLO";
`echo "var=$foo" > fred`;
`echo "export var" >> fred`;
then you run your perl script with:
$ ./myperl.pl; . ./fred; rm ./fred; echo $var
HELLO
i.e. source the file fred immediately after running your perl script.
p.s. yes I know it is a really nasty solution.
In article <7sv8nh$kca$1@nnrp1.deja.com>,
thomas <tavril@my-deja.com> wrote:
> Hello,
>
> first of all, excuse my poor english...
>
> Within a Perl script, I need to export a Variable. After the execution
> of my script, the variable have to be visible from the shell which
> called my Perl script.
>
> How to do it ???
>
> I did a
> @args = ("ksh", "export FOO=bar");
> system(@args);
>
> it seems to work, yet I lost the FOO because it has been defined in a
> sub-shell....
>
> please help me !! ;-)
>
> Thanks,
> thom.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 30 Sep 1999 05:37:54 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: needs to export a variable in my environnement
Message-Id: <MPG.125cf97b88638fed989799@206.184.139.132>
thomas (tavril@my-deja.com) seems to say...
> Hello,
>
> first of all, excuse my poor english...
>
> Within a Perl script, I need to export a Variable. After the execution
> of my script, the variable have to be visible from the shell which
> called my Perl script.
In the FAQ:
I {changed directory, modified my environment} in a perl script. How
come the change disappeared when I exited the script? How do I get my
changes to be visible?
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Thu, 30 Sep 1999 07:10:42 -0700
From: Michael Peppler <mpeppler@peppler.org>
Subject: Re: Perl - SQL examples
Message-Id: <37F36F62.BE033730@peppler.org>
David Cassell wrote:
>
> Michael Peppler wrote:
> [snip of my junk]
> > True. But there are things that you can do with sybperl that you can't do
> > with DBD::Sybase, so in certain circumstances that may be the better choice.
> > sybperl is still actively maintained and supported (by yours truly)...
>
> Sorry Michael, no slam intended.
No slam taken :-)
> But the original responder did
> say "To access various databases you get various Modules..."
> and I thought it behooved someone to discuss this.
Correct. DBI/DBD is definitely the way to go if you need portability to
other database engines.
If not - well I just wanted to correct any misconception that sybperl was
old/antique code.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
------------------------------
Date: 30 Sep 1999 14:36:18 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Piping
Message-Id: <7svsh2$l1b$1@pegasus.csx.cam.ac.uk>
In addition to the points Tom has made:
In article <rv1uuqsi3i524@corp.supernews.com>, <nihad@yahoo.com> wrote:
>
>open (PIPE, "$execgi|") || print "$?";
That isn't very sensible. $? giving the return status of the command
is only set when the pipe is closed. So
a) Make that something like die "Pipe open failed:$!\n";
b) Do an explicit close, and if that fails print out both $! and $?.
>BTW, I do not want to use open2,open3, or pipe().
Why do people say this sort of thing?
"I want to put in a screw, but I don't want to use a screwdriver."
Those tools are precisely designed for this job. Any attempt to
do this job is going to involve constructing probably inferior
versions of the same thing.
Perhaps you mean to say "I am unable to use these tools because ... ".
If we knew your reasons, we could suggest how to get round the problem.
Or perhaps explain that the reasons don't really prevent you from using
them.
Mike Guy
------------------------------
Date: Thu, 30 Sep 1999 14:51:51 +0000
From: Pete <pete@onm1.demon.co.uk>
Subject: Please Help: install module on Red Hat
Message-Id: <37F37907.F7470873@onm1.demon.co.uk>
Hi there,
I'm new to perl and I have a slight problem:
I'm running Red Hat 5.0 in Intel, and I want to install a perl
module. I tried to install it but it is dependent on the
Data::Dumper module.
So I downloaded Data-Dumper-2.101 and tried to install it.
It worked fine (& tests were good etc.) until I tried
'make install'
It installed the stuff in:
'/var/tmp/perl-root/usr/lib/perl5/.......'
When I did a 'perl Makefile.PL' on the second module (ie. the
one that I wanted to install in the first place), it told me that
Data::Dumper was not installed, and referred me to CPAN.
From what I can see, the problem is that it installed it in
/var/tmp, not in /usr/lib/perl5 as I would expected (?).
I tried to reinstall it with 'perl Makefile.PL PREFIX=//usr'
(two forward slashes because of the way the Makefile is)
but now it just skips all the important bits and just appends to
perllocal.pod. Anyway, this doesn't seem the right way
to be doing it.
So my questions are:
1. Why does it install in /var/tmp/usr/lib/perl5 ?
2. Shouldn't it be installing it in /usr/lib/perl5 ?
3. How do I UNinstall data dumper (or any other module?)
so that I can reinstall it properly ?
(ie. to get it to stop skipping the important reinstall
bits)
4. Is there a clean way to uninstall modules so that I
can correct any half-installed modules ?
5. Is there a good book on this stuff, for future reference ?
Thanks for your time,
Pete.
------------------------------
Date: Thu, 30 Sep 1999 08:33:09 -0400
From: "Peter Icaza" <picaza@chsi.com>
Subject: Re: Proble with chopped filenames from script
Message-Id: <7svl9a$3tk8$1@pike.uhc.com>
> which works fine until the line it reads has a + or - or _ in it.
> if ( m/(\w+)/ ) {
\w+ will match 1 or more word characters, [+-_] are not word characters
[a-zA-Z0-9], depending on locale.
so you match a then you match b, ignoring +.
you may want to split what follows "new" by newlines into an array and go
from there.
look at p 79 in lllama and 28 in camel and all of owls.
peter
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 950
*************************************