[17307] in Perl-Users-Digest
Perl-Users Digest, Issue: 4729 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 26 06:10:28 2000
Date: Thu, 26 Oct 2000 03:10:13 -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: <972555013-v9-i4729@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 26 Oct 2000 Volume: 9 Number: 4729
Today's topics:
Re: Packaging CPAN Modules With Application <anders@wall.alweb.dk>
passing parameter <min_c_lee@yahoo.com>
Re: passing parameter <Peter.Dintelmann@dresdner-bank.com>
Re: perl not resolving dns in a cgi script (Rafael Garcia-Suarez)
Re: Question about perl -w (Andrew N. McGuire)
Re: socket hang <uri@sysarch.com>
Re: Spaces to tab <gellyfish@gellyfish.com>
Re: substituting up to the beginning of the line <anders@wall.alweb.dk>
Sys::Syslog and stdarg.ph and Redhat 6.1 <pierre@arraycomm.com>
Re: Sys::Syslog and stdarg.ph and Redhat 6.1 (Martien Verbruggen)
Re: usenet to web gateway <gellyfish@gellyfish.com>
Re: variables starting with $:: (Tad McClellan)
Re: variables starting with $:: <ianb@ot.com.au>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 26 Oct 2000 11:26:02 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Packaging CPAN Modules With Application
Message-Id: <kNSJ5.767$262.75519@news010.worldonline.dk>
asimjalis@my-deja.com wrote:
> Here is the problem. I am writing an application in Perl which uses
> several CPAN modules. I want the application to be easy to install on
> different machines. I don't want to force people to first download and
> install the modules from CPAN that my application requires. How can I
> do this?
>
> So essentially I want to ship a application.tar.gz file. The end-user
> uncompresses/untars it and then runs "make" and then "make install"
> and at that point the application should be fully usable.
>
> The build/install should work even if the machine is NOT on-line and if
> the user has no root privileges. The required CPAN module files will be
> shipped with the application.tar.gz.
>
> The make and make install steps need to somehow do the following
> things:
>
> (1) Figure out if the correct versions of the required CPAN modules
> are already installed on the machine.
> (2) If they are not then unzip and build and install the versions
> shipped in the tarball. If the user is not root then the
> installation
> of these packages should be to the directory where the application
> is going to live.
> (3) Finally to build and install the application.
>
> My question is this: Is there a module on CPAN that already does this?
>
> CPAN.pm does not appear to fit the bill. The initial configuration
> dialog it engages the user in totally violates the idea of automated
> installation.
>
> Asim
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
I recently installed a perl jabberclient, which installed several CPAN
modules + Tk.
You can find it at http://www.jabbercentral.com if oyu wan't to see how
they do it.
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Wed, 25 Oct 2000 22:15:01 -0700
From: "Michael" <min_c_lee@yahoo.com>
Subject: passing parameter
Message-Id: <8t8e79$12v4$1@nntp1.ba.best.com>
Hi:
What would be the best way to pass parameters
in between servers?
Any place I can find some reference?
Michael
FYI, my perl shopping system needs to look up the
tax rate in a database which is on another server
running Win2000Adv.Server. The database (Access2000)
can be accessed via ASP script.
I was think about creating a child process (using "system") to
grab what's needed. When the child process is done, the
parent process can continue aftter getting the tax rate from
the child process.
------------------------------
Date: Thu, 26 Oct 2000 09:07:31 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: passing parameter
Message-Id: <8t8l81$ks31@intranews.bank.dresdner.net>
Hi,
Michael schrieb in Nachricht <8t8e79$12v4$1@nntp1.ba.best.com>...
>What would be the best way to pass parameters
>in between servers?
>Any place I can find some reference?
>
>Michael
>FYI, my perl shopping system needs to look up the
>tax rate in a database which is on another server
>running Win2000Adv.Server. The database (Access2000)
>can be accessed via ASP script.
1. Use DBI to directly access the db on the
other server (using DBI::Proxy).
2. Use LWP to call your asp url and analize the
output.
>I was think about creating a child process (using "system") to
>grab what's needed.
I would try to avoid a system().
Regards,
Peter Dintelmann
------------------------------
Date: Thu, 26 Oct 2000 06:26:48 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: perl not resolving dns in a cgi script
Message-Id: <slrn8vfjoc.onb.rgarciasuarez@rafael.kazibao.net>
D.W. wrote in comp.lang.perl.misc:
>I have a section of code which used the system parameter to resolve an ip
>address to a host name; but its not working. It returns a null or blank
>field.
>
>This is running on an apache server, which has hostname lookups on.
If you want the hostname of the client of your web server, then it is
in the REMOTE_HOST environment variable.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 26 Oct 2000 01:01:48 -0500
From: anmcguire@ce.mediaone.net (Andrew N. McGuire)
Subject: Re: Question about perl -w
Message-Id: <87og08gmyb.fsf@hawk.ce.mediaone.net>
>>>>> "NM" == Nicolas MONNET <nico@monnet.to> writes:
NM> If I get too many warnings, do I get suspended?
I must be missing something... what do you mean "do I get suspended"?
What does that have to do with '-w'?
anm
--
perl -wMstrict -e '
$a=[[qw[J u s t]],[qw[A n o t h e r]],[qw[P e r l]],[qw[H a c k e r]]];$.++
;$@=$#$a;$$=[reverse sort map$#$_=>@$a]->[$|];for$](--$...$$){for$}($|..$@)
{$$[$]][$}]=$a->[$}][$]]}}$,=$";$\=$/;print map defined()?$_:$,,@$_ for @$;
'
------------------------------
Date: Thu, 26 Oct 2000 04:01:44 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: socket hang
Message-Id: <x74s20mes8.fsf@home.sysarch.com>
>>>>> "T" == T <tommylebrun@yahoo.com> writes:
T> Has anyone had problems with socket hangs? Specifically, I send data to
T> a server & wait forever for a reply. Is there a way to time it
T> out? T.
jeez, the third socket buffering problem today. turn on autoflushing on
the socket and use non-blocking reads.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 26 Oct 2000 07:58:32 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Spaces to tab
Message-Id: <8t8kmo$bk1$1@orpheus.gellyfish.com>
On Wed, 25 Oct 2000 20:41:24 GMT equilibrium1@my-deja.com wrote:
> I'm trying to come up with a regex pattern that will evaluate the space
> at the beginning of the line up to the non-whitespace characters in
> such a way that 4 spaces are converted to tab characters and any extra
> space characters left over are converted to null.
> So far I have this:
> $line=~s/( {4}/\t/g;
>
Do you mean you want to change four or more leading spaces to a single
tab ?
If so you might try something like :
$line =~ /^ {4,}/\t/;
/J\
--
Jonathan Stowe |
<http://www.gellyfish.com> | This space for rent
|
------------------------------
Date: Thu, 26 Oct 2000 11:20:33 +0200
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: substituting up to the beginning of the line
Message-Id: <hISJ5.763$262.75378@news010.worldonline.dk>
joekind@my-deja.com wrote:
> Hi, I need to substitute a string up to a given point.
> For example, if I have the following code:
> $code = "<B>text</B>,<font size=1>text,<I>text/<U>text";
>
> now I want to substitute the code with nothing before the "," and the
> other "," and the "/".
> so I want to be able to have the code broken up into this:
> <font size=1>text,<I>text/<U>text
> <I>text/<U>text
> <U>text
# eat anything before and including first comma:
$code = s/^[^,]+,//;
# eat up anything before and including first slash:
$code =~ s#^[^/]+/##;
Read the perlre and perlop manuals!
-anders
--
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]
------------------------------
Date: Wed, 25 Oct 2000 22:36:40 -0700
From: Pierre de La Motte <pierre@arraycomm.com>
Subject: Sys::Syslog and stdarg.ph and Redhat 6.1
Message-Id: <39F7C2E8.309924D4@arraycomm.com>
Hi,
using the following configuration
perl 5.005_03
Redhat 6.1
Perl script:
#!/usr/bin/perl -w
# syslog test
use strict;
use Sys::Syslog;
openlog("Test");
syslog("notice", "Syslog test\n");
closelog;
exit;
I am unable to use the module Sys::Syslog, I get the following error:
constant subroutine __need___va_list undefined at
/usr/lib/perl5/5.00503/i386-linux/stdarg.ph line 9
I tried to regenerate stdarg.ph using h2ph from
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/stdarg.h
but ended with the same file (not a single diff).
Any idea ?
Thank you
Pierre
------------------------------
Date: Thu, 26 Oct 2000 05:51:53 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Sys::Syslog and stdarg.ph and Redhat 6.1
Message-Id: <slrn8vfhjm.ksa.mgjv@verbruggen.comdyn.com.au>
On Wed, 25 Oct 2000 22:36:40 -0700,
Pierre de La Motte <pierre@arraycomm.com> wrote:
> Hi,
> using the following configuration
> perl 5.005_03
Is this the perl that came with
> Redhat 6.1
? If so, dump it, and compile your own version. That perl isn't
entirely kosher.
> Perl script:
> #!/usr/bin/perl -w
> # syslog test
>
> use strict;
> use Sys::Syslog;
>
> openlog("Test");
> syslog("notice", "Syslog test\n");
> closelog;
> exit;
>
> I am unable to use the module Sys::Syslog, I get the following error:
> constant subroutine __need___va_list undefined at
> /usr/lib/perl5/5.00503/i386-linux/stdarg.ph line 9
> I tried to regenerate stdarg.ph using h2ph from
> /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/stdarg.h
> but ended with the same file (not a single diff).
I have no problems on this box, with perl 5.6.0. It's based on a
redhat 6.1 installation as well, but the kernel has been replaced, and
so has Perl. Maybe you should install some of the patches for that
system, if you haven't done that yet, as well as installing your own
Perl.
Martien
--
Martien Verbruggen |
Interactive Media Division | The four horsemen of the apocalypse
Commercial Dynamics Pty. Ltd. | are called Abort, Retry, Ignore and
NSW, Australia | Fail.
------------------------------
Date: Thu, 26 Oct 2000 09:38:46 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: usenet to web gateway
Message-Id: <GYSJ5.757$ZA5.11549@news.dircon.co.uk>
On Thu, 26 Oct 2000 02:30:24 +0000, Joerg Kammerer Wrote:
> Has anybody seen something similar in perl?
Yes. You will probably want to use Net::NNTP.
/J\
------------------------------
Date: Thu, 26 Oct 2000 00:34:34 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: variables starting with $::
Message-Id: <slrn8vfd2q.e1v.tadmc@magna.metronet.com>
On Thu, 26 Oct 2000 10:12:33 +0800, Hugo Bouckaert
<hugo@fractalgraphics.com.au> wrote:
>
>I know how the double colon is used to access parts of larger modules,
>such as:
>
>use Text::Wrap;
>
>But I have a set of perl modules interacting with each other, and many
>of the variables are defined as follows:
>
>$::currentquery = $::db->query($str);
>
>I suspect
Why guess?
Type:
perldoc perlmod
and _know_.
It answers your question in the very first paragraph!
>that both the variable $::currentquery and the object
>$::db->query($str); are global in scope, but this leaves me with another
>problem:
>
>I have a set of form elements specified in one script
>
><FORM NAME=changeform METHOD=POST ACTION etc..>
>
><INPUT TYPE=\"text\" NAME=\"assigned_to\">
^ ^ ^ ^
^ ^ ^ ^
What are those for?
>The form element with name "assigned_to" can be accessed by other perl
>programs.
^^^^^^^^
How?
>For example, if you want to assign whatever was put in that
>form to a variable in another perl program, you use:
>
>my $somevariable = trim $::FORM{'assigned_to'});
That will not work.
Are you sure you mean another _program_, or just another file?
What is "trim"?
>Yet for other variables given global scope (with $::), you canot assign
>the value to another variable.
I don't understand your question.
Can you post (short) code that we can run that shows what
you are talking about?
>Can anyone enlighten me on why this can't be done
I don't know what "this" is, so no, I can't enlighten you there.
>and what $:: exactly
>does?
It does the same as $main::
$::FORM{'assigned_to'}
means:
$main::FORM{'assigned_to'}
means:
The scalar value keyed by 'assigned_to' in the hash named %FORM
in the "main" package.
>Any help will be much appreciated.
Use the docs Luke.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 26 Oct 2000 16:18:57 +1100
From: Ian Boreham <ianb@ot.com.au>
Subject: Re: variables starting with $::
Message-Id: <39F7BEC1.FB5D4491@ot.com.au>
Hugo Bouckaert wrote:
> I suspect that both the variable $::currentquery and the object
> $::db->query($str); are global in scope, but this leaves me with another
> problem:
Yes, they are global - "::blah" is shorthand for "main::blah".
> my $somevariable = trim $::FORM{'assigned_to'});
>
> Yet for other variables given global scope (with $::), you canot assign
> the value to another variable.
I think you are misinterpreting some error message here. Can you please
give an example of exactly what you are talking about (that we can
reproduce).
> Can anyone enlighten me on why this can't be done and what $:: exactly
> does?
"$::" doesn't do anything. The "$" is just "$" as always, and "::blah" is
shorthand for "main::blah".
Regards,
Ian
------------------------------
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 4729
**************************************