[17316] in Perl-Users-Digest
Perl-Users Digest, Issue: 4738 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 26 21:10:23 2000
Date: Thu, 26 Oct 2000 18:10:12 -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: <972609012-v9-i4738@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 26 Oct 2000 Volume: 9 Number: 4738
Today's topics:
Problems compiling "libnet" under 5.6.0 <dean_j_pompilio@yahoo.com>
Re: Problems compiling "libnet" under 5.6.0 (Martien Verbruggen)
Reading regex for s### from file tigergutt2000@my-deja.com
Re: Starting background process from Perl jack.dunnigan@ec.gc.ca
Re: Starting background process from Perl (John J. Trammell)
Re: Starting background process from Perl (Martien Verbruggen)
Re: substituting up to the beginning of the line <lr@hpl.hp.com>
Re: Tracking memory usage in Perl <brian+usenet@smithrenaud.com>
What's wrong with this regex? <davesisk@ipass.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 26 Oct 2000 22:01:11 GMT
From: Dean J. Pompilio <dean_j_pompilio@yahoo.com>
Subject: Problems compiling "libnet" under 5.6.0
Message-Id: <8ta9j3$7mj$1@nnrp1.deja.com>
I stupidly removed Perl 5.005, which Net::FTP was working fine with.
Doh!
Now, I can't find anything older than 5.6.0 for HP-UX. After
installing 5.6.0 successfully, I tried to install "libnet-1.0703".
The make runs fine, but make test fails with the following errors. I
don't have enough experience with modules *not* compiling correctly.
Is this version of libnet compatible with Perl 5.6.0?
Any help would be greatly appreciated!!!
-----------------------------------------------------------------------
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -
I/opt/perl5/lib/5.6.0/PA-RISC1.1 -I/opt/perl5/lib/5.6.0 -e 'use
Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/ftp...............Can't locate package for @Net::Config::ISA at
t/ftp.t line 3.
Can't locate package for @Net::Config::ISA at blib/lib/Net/FTP.pm line
21.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/FTP.pm line 56.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/FTP.pm line 87.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/FTP.pm line 88.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/FTP.pm line 247.
Compilation failed in require at t/ftp.t line 4.
BEGIN failed--compilation aborted at t/ftp.t line 4.
dubious
Test returned status 255 (wstat 65280, 0xff00)
t/hostname..........Can't locate package for @Net::Config::ISA at
blib/lib/Net/Domain.pm line 14.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/Domain.pm line 121.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/Domain.pm line 122.
Compilation failed in require at t/hostname.t line 2.
BEGIN failed--compilation aborted at t/hostname.t line 2.
dubious
Test returned status 255 (wstat 65280, 0xff00)
t/nntp..............Can't locate package for @Net::Config::ISA at
t/nntp.t line 3.
Can't locate package for @Net::Config::ISA at blib/lib/Net/NNTP.pm
line 15.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/NNTP.pm line 30.
Compilation failed in require at t/nntp.t line 4.
BEGIN failed--compilation aborted at t/nntp.t line 4.
dubious
Test returned status 255 (wstat 65280, 0xff00)
t/ph................Can't locate package for @Net::Config::ISA at
t/ph.t line 3.
Can't locate package for @Net::Config::ISA at blib/lib/Net/PH.pm line
18.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/PH.pm line 28.
BEGIN not safe after errors--compilation aborted at blib/lib/Net/PH.pm
line 373.
Compilation failed in require at t/ph.t line 4.
BEGIN failed--compilation aborted at t/ph.t line 4.
dubious
Test returned status 255 (wstat 65280, 0xff00)
t/require...........Can't locate package for @Net::Config::ISA at
blib/lib/Net/Domain.pm line 14.
Can't locate package for @Net::Config::ISA at blib/lib/Net/FTP.pm line
21.
Can't locate package for @Net::Config::ISA at blib/lib/Net/SMTP.pm
line 17.
Can't locate package for @Net::Config::ISA at blib/lib/Net/NNTP.pm
line 15.
Can't locate package for @Net::Config::ISA at blib/lib/Net/SNPP.pm
line 17.
Can't locate package for @Net::Config::ISA at blib/lib/Net/PH.pm line
18.
Can't locate package for @Net::Config::ISA at blib/lib/Net/POP3.pm
line 14.
Can't locate package for @Net::Config::ISA at blib/lib/Net/Time.pm
line 14.
FAILED tests 2, 5-11
Failed 8/11 tests, 27.27% okay
t/smtp..............Can't locate package for @Net::Config::ISA at
t/smtp.t line 3.
Can't locate package for @Net::Config::ISA at blib/lib/Net/SMTP.pm
line 17.
Global symbol "%NetConfig" requires explicit package name at
blib/lib/Net/SMTP.pm line 29.
Compilation failed in require at t/smtp.t line 4.
BEGIN failed--compilation aborted at t/smtp.t line 4.
dubious
Test returned status 255 (wstat 65280, 0xff00)
Failed Test Status Wstat Total Fail Failed List of failed
------------------------------------------------------------------------
-------
t/ftp.t 255 65280 ?? ?? % ??
t/hostname.t 255 65280 ?? ?? % ??
t/nntp.t 255 65280 ?? ?? % ??
t/ph.t 255 65280 ?? ?? % ??
t/require.t 11 8 72.73% 2, 5-11
t/smtp.t 255 65280 ?? ?? % ??
Failed 6/6 test scripts, 0.00% okay. 8/11 subtests failed, 27.27% okay.
*** Error exit code 2
Stop.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 26 Oct 2000 22:38:44 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Problems compiling "libnet" under 5.6.0
Message-Id: <slrn8vhcjh.ksa.mgjv@verbruggen.comdyn.com.au>
On Thu, 26 Oct 2000 22:01:11 GMT,
Dean J. Pompilio <dean_j_pompilio@yahoo.com> wrote:
> I stupidly removed Perl 5.005, which Net::FTP was working fine with.
> Doh!
Never remove an installation until you are happy that the new version
works :). This is one of the reasons I always install perl in
/opt/perl-$VERSION, and maintain a symlink /opt/perl to there (as well
as symlinking /usr/bin/perl and /usr/local/bin/perl to
/opt/perl/bin/perl). It makes it much easier to roll back and forward
between versions.
There are _some_ problem with this that you can run into when you are
trying to install modules that have binary parts for an older version
of perl than the current one, but they're not insurmountable.
> Now, I can't find anything older than 5.6.0 for HP-UX. After
> installing 5.6.0 successfully, I tried to install "libnet-1.0703".
Older versions of Perl are kept on CPAN. Not all of them (there are
other places for that), but reasonably recent ones are available from
CPAN/src/5.0 (substitute your local CPAN mirror, or
http://www.cpan.org for CPAN). But, it shouldn't be necessary to go
back to 5.005_03 for this reason.
> The make runs fine, but make test fails with the following errors. I
> don't have enough experience with modules *not* compiling correctly.
> Is this version of libnet compatible with Perl 5.6.0?
>
> Any help would be greatly appreciated!!!
> -----------------------------------------------------------------------
> PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -
> I/opt/perl5/lib/5.6.0/PA-RISC1.1 -I/opt/perl5/lib/5.6.0 -e 'use
> Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
> t/ftp...............Can't locate package for @Net::Config::ISA at
> t/ftp.t line 3.
Did you install all the prerequisites for libnet? I can't remember
whether there are any non-standard ones, but there may be. Check the
README file, and heed any warnings that you get during
# perl Makefile.PL
When you removed the old perl, did you really, really remove it? Every
last binary and link? /usr/bin/perl, /usr/local/bin/perl, and anything
else all point to your new perl? Maybe you should search your system
for all perl binaries that may be around.
# perl -v
gives you the output you expect?
Martien
--
Martien Verbruggen |
Interactive Media Division | +++ Out of Cheese Error +++ Reinstall
Commercial Dynamics Pty. Ltd. | Universe and Reboot +++
NSW, Australia |
------------------------------
Date: Thu, 26 Oct 2000 23:00:00 GMT
From: tigergutt2000@my-deja.com
Subject: Reading regex for s### from file
Message-Id: <8tad1c$afr$1@nnrp1.deja.com>
Hi!
I've tried to study my Perl books (Programming Perl and Perl Cookbook)
to find a solution to my problem. Does any of you Perl athletes see
what I'm doing wrong?
1) I have some regexes stored in a text file. I read these and store
them in a hash. From file:
MATCHEXP=^http://www.site.com/art.asp?id=(\d+)&cat=(\d)
REPLACEEXP=http://www.site.com/index.asp?artid=$1&category=$2
2) I then wish to use these regexes to substitue a part of a URL to
something else, like this:
$matchexp = $hash{"MATCHEXP"};
$replaceexp = $hash{"REPLACEEXP"};
$newurl = $oldurl;
$newurl =~ s#$matchexp#$replaceexp#;
The urls I wish to render have this format:
http://www.site.com/art.asp?id=2352&cat=4
This construct does not insert the numbers in $1 and $2 in the newurl
http://www.site.com/index.asp?artid=$1&category=$2
But when inserting a line just after the substitute line
print "$1 and $2\n";
shows that $1 and $2 contains the right values.
The funny (?) thing is that when changing the MATCHEXP to
MATCHEXP=^http://www.site.com/art.asp?id=(d+)&cat=(d+)
or
MATCHEXP=^http://www.site.com/art.asp?id=(\[0-9]+)&cat=(\[0-9]+)
it seems to work.
Why is this? I'm I just a rookie when it comes to regexes?
Should I use qr// in some way?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 26 Oct 2000 22:33:20 GMT
From: jack.dunnigan@ec.gc.ca
Subject: Re: Starting background process from Perl
Message-Id: <8tabfh$954$1@nnrp1.deja.com>
If you are on UNIX then
system("/my/bin/myscript");
will return immediately. This is in opposition to the backticks, which
wait and return the process STDOUT.
Jack
PS..I'm not sure if this works on Win32.
##############################
In article <8t96ag$9d4$1@nnrp1.deja.com>,
djoerg@my-deja.com wrote:
> Hi,
>
> I want to start a new process from a perl script, but the script
always
> waits until the process is complete (the new process takes very long
to
> complete and the webserver should get back a message from the script).
> Is there any way to launch the process so that perl doesn't wait for
the
> child to complete?
>
> Cheers
> David
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 26 Oct 2000 22:48:27 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: Starting background process from Perl
Message-Id: <slrn8vgip6.46n.trammell@nitz.hep.umn.edu>
On Thu, 26 Oct 2000 22:33:20 GMT, jack.dunnigan@ec.gc.ca
<jack.dunnigan@ec.gc.ca> jeopardy-posted:
>If you are on UNIX then
>
>system("/my/bin/myscript");
>
>will return immediately. This is in opposition to the backticks, which
>wait and return the process STDOUT.
From `perldoc -f system`:
system LIST
system PROGRAM LIST
Does exactly the same thing as `exec LIST', except
that a fork is done first, and the parent process
waits for the child process to complete.
In the future, please post answers to questions after the
questions. Posts make more sense that way.
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Thu, 26 Oct 2000 23:20:55 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Starting background process from Perl
Message-Id: <slrn8vhf2k.ksa.mgjv@verbruggen.comdyn.com.au>
[Please, in the future, post your reply _after_ the suitably trimmed
text you reply to. This makes the posts easier to read, and is in
accordance with the generally accepted posting guidelines on this
group, and Usenet in general]
On Thu, 26 Oct 2000 22:33:20 GMT,
jack.dunnigan@ec.gc.ca <jack.dunnigan@ec.gc.ca> wrote:
[reordered post]
> In article <8t96ag$9d4$1@nnrp1.deja.com>,
> djoerg@my-deja.com wrote:
> > Hi,
> >
> > I want to start a new process from a perl script, but the script always
> > waits until the process is complete (the new process takes very long to
> > complete and the webserver should get back a message from the script).
> > Is there any way to launch the process so that perl doesn't wait for the
> > child to complete?
>
> If you are on UNIX then
>
> system("/my/bin/myscript");
>
> will return immediately. This is in opposition to the backticks, which
> wait and return the process STDOUT.
This is wrong. system will not return until the program it invoked
returns[1], completes, or there is an error.
# perldoc -f system
[snip]
Does exactly the same thing as `exec LIST', except
that a fork is done first, and the parent process
waits for the child process to complete. Note
^^^^^
The question makes no sense. It states that the calling program
(actually, it says webserver, I interpreted that) _has_
to wait for it, because it should 'get back a message'. his means that
you cannot not wait.
To the OP: You'll have to be more clear, or at least not
self-contradictory, for us to be able to answer.
In the meantime, you might want to read
# perldoc perlopentut
# perldoc perlipc
Martien
[1] And for people who are going to talk about &, the shell that
processed the string you gave it returns, even when the program _it_
put in the background hasn't completed yet.
--
Martien Verbruggen |
Interactive Media Division | In the fight between you and the
Commercial Dynamics Pty. Ltd. | world, back the world - Franz Kafka
NSW, Australia |
------------------------------
Date: Thu, 26 Oct 2000 16:23:54 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: substituting up to the beginning of the line
Message-Id: <MPG.14625ce2bd4967d898ae73@nntp.hpl.hp.com>
In article <8t9oiv$pep$1@nnrp1.deja.com> on Thu, 26 Oct 2000 17:11:02
GMT, joekind@my-deja.com <joekind@my-deja.com> says...
...
> That didn't work because I want this to be universal. Instead of
> having the code just to substitute up to a comma or a slash, I want it
> to be able to substitute up to anything.
> so if I had the variable $subto which could be anything (ex. text, #, ;
> etc)
> I want to be able to substitute all the code before $subto with nothing.
One way (regex, protecting against regex metacharacters):
s/.*?(?=\Q$subto\E)//;
If there may be newlines, add the /s modifier. If $subto never changes,
add the /o modifier.
perldoc perlre
Another way (faster and better, IMO, but only if you are *sure* the
terminating substring is really there):
substr($_, 0, index $_, $subto) = "";
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 26 Oct 2000 20:06:12 -0400
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: Tracking memory usage in Perl
Message-Id: <brian+usenet-A569A0.20061226102000@news.panix.com>
In article <39F88485.1ECFF3EA@us.ibm.com>, "Douglas C. Heaberlin"
<dheaberl@us.ibm.com> wrote:
> For example, I would like to be able at any point in
> a script to determine 1) how much total dynamic memory is available to
> my process,
see the perldebug (for versions before 5.6) or the perldebguts (5.6)
man page which has a section on "Debugging Perl memory usage".
http://www.perldoc.com/perl5.6/pod/perldebguts.html#Debugging%20Perl%20memory%20usage
--
brian d foy
Perl Mongers <URL:http://www.perl.org>
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 27 Oct 2000 00:43:24 GMT
From: "David Sisk" <davesisk@ipass.net>
Subject: What's wrong with this regex?
Message-Id: <Mc4K5.1049$G95.302893@typhoon.southeast.rr.com>
$some_variable = $1 + $2/$3 if ($other_variable =~ /\d{2} \D[A-Z][a-z]{3}
(\d*) (\d*)\/(\d*)/);
The string in $other_variable looks like one of these:
00 Nov 5 (IFQ KA-E)
00 Nov 7 1/2 (IFQ KB-E)
00 Nov 10 (IFQ KC-E)
00 Nov 12 1/2 (IFQ KD-E)
I'm trying to get the number in the middle (the 5, 7.5, 10, 12.5
respectively) into $some_variable. What's wrong with my regex? Please post
or email?
Regards,
Dave
------------------------------
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 4738
**************************************