[22291] in Perl-Users-Digest
Perl-Users Digest, Issue: 4512 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 4 18:09:47 2003
Date: Tue, 4 Feb 2003 15:06:39 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 4 Feb 2003 Volume: 10 Number: 4512
Today's topics:
Converting a string to time value (seconds since Epoch) <Flynn1179@hotmail.withoutthespam.com>
Re: Converting a string to time value (seconds since Ep <goldbb2@earthlink.net>
Re: Converting a string to time value (seconds since Ep <usenet@dwall.fastmail.fm>
Re: Crossposting (was: Fetchrow Question) (Anno Siegel)
Re: Crossposting (was: Fetchrow Question) <mgarrish@rogers.com>
Re: Crossposting (was: Fetchrow Question) <mgarrish@rogers.com>
Re: Crossposting (was: Fetchrow Question) <uri@stemsystems.com>
Re: Crossposting (was: Fetchrow Question) <mgarrish@rogers.com>
Re: Crossposting (was: Fetchrow Question) <uri@stemsystems.com>
Re: Crossposting (was: Fetchrow Question) (Tad McClellan)
Re: Fast de-tabify <goldbb2@earthlink.net>
gSTLFilt/perl/g++ problem: regexp too big <fma@doe.carleton.ca>
Re: How do you: 'make install PREFIX=somepath', and the <usenet@tinita.de>
Re: How do you: 'make install PREFIX=somepath', and the <usenet@tinita.de>
Re: How do you: 'make install PREFIX=somepath', and the (Anno Siegel)
Re: How do you: 'make install PREFIX=somepath', and the <usenet@tinita.de>
How do you: 'make install PREFIX=somepath', and then pl <f_ker@yahoo.co.uk_NO_SPAM>
Re: How do you: 'make install PREFIX=somepath', and the (Anno Siegel)
Re: Is there a *better* way to deref and look for match <goldbb2@earthlink.net>
Re: Parse a logfile - 1st column DateStamp; extract lat <goldbb2@earthlink.net>
perl question <dmanjunath@yahoo.com>
Re: perl question <goldbb2@earthlink.net>
Re: Text extraction using patterns (Perl FAQ 6 not help <goldbb2@earthlink.net>
Re: Text extraction using patterns (Perl FAQ 6 not help (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 4 Feb 2003 21:40:00 -0000
From: "Flynn" <Flynn1179@hotmail.withoutthespam.com>
Subject: Converting a string to time value (seconds since Epoch)
Message-Id: <RqW%9.1098$_J.686@news-binary.blueyonder.co.uk>
Ok, I give up. How do you do it?
I've scoured every resource I have, and although it's easy enough to turn a
time value into a string with the help of the localtime() function, I can't
figure out how to do it the other way round. Basically, I need to convert a
date typed on a form, and store it as a value. How ????
Flynn
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003
------------------------------
Date: Tue, 04 Feb 2003 16:50:33 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Converting a string to time value (seconds since Epoch)
Message-Id: <3E4035A9.A7D64012@earthlink.net>
Flynn wrote:
>
> Ok, I give up. How do you do it?
Time::Local, Date::Parse, or Date::Manip.
--
"So, who beat the clueless idiot today?"
"Well, we flipped for it, but when Kuno
landed, he wasn't in any shape to fight."
"Next time, try flipping a *coin.*"
------------------------------
Date: Tue, 04 Feb 2003 21:44:33 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: Converting a string to time value (seconds since Epoch)
Message-Id: <Xns9318AA504B46Cdkwwashere@216.168.3.30>
Flynn <Flynn1179@hotmail.withoutthespam.com> wrote on 04 Feb 2003:
> Ok, I give up. How do you do it?
>
> I've scoured every resource I have, and although it's easy enough to turn a
> time value into a string with the help of the localtime() function, I can't
> figure out how to do it the other way round. Basically, I need to convert a
> date typed on a form, and store it as a value. How ????
use Date::Parse;
--
David K. Wall - usenet@dwall.fastmail.fm
"Oook."
------------------------------
Date: 4 Feb 2003 21:24:33 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <b1pb2h$ans$2@mamenchi.zrz.TU-Berlin.DE>
mgarrish <mgarrish@rogers.com> wrote in comp.lang.perl.misc:
>
> "Uri Guttman" <uri@stemsystems.com> wrote in message
> news:x7n0lcskv0.fsf@mail.sysarch.com...
> > >>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
[about alt.perl]
> > so low volume and mostly wrong is better than high volume (which is
> > easily handled with a good newsreader) which has many perl experts
> > around?
[CLPM]
> has only a few people who could be considered "experts" (of which you are
> not one, I'm afraid), but a vast number of people who think they are because
> all they can say is RTFM or parrot the answers of the one or two experts.
Uri is one of the most renowned Perl experts around. Unfortunately,
few of his class still post here.
Anno
------------------------------
Date: Tue, 04 Feb 2003 21:39:19 GMT
From: "mgarrish" <mgarrish@rogers.com>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <bqW%9.269773$pDv.243633@news04.bloor.is.net.cable.rogers.com>
"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7ptq8qal3.fsf@mail.sysarch.com...
> >>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
>
> i think my logic is fine. you are slamming clpm
Seems you don't learn quickly. As a little exercise to clear out the
cobwebs, why don't you post the exact phrase I used to slam clpm prior to my
last message? I said nothing but that there are people who read alt.perl
because the volume of clpm makes it tiresome to keep up with. Somewhere in
your convoluted mind you filled in some blanks that weren't there, only
further making my case that clpm is inhabited by a number self-important
blowhards. If your sense of self-worth is derived by what newsgroup you post
to, you really should take a good long look at your life.
Matt
------------------------------
Date: Tue, 04 Feb 2003 21:40:43 GMT
From: "mgarrish" <mgarrish@rogers.com>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <vrW%9.269780$pDv.258039@news04.bloor.is.net.cable.rogers.com>
"Ben Morrow" <mauzo@mimosa.csv.warwick.ac.uk> wrote in message
news:b1p015$nk6$1@wisteria.csv.warwick.ac.uk...
>
> *plonk*
>
And why do you think that I or anyone else cares?
Matt
------------------------------
Date: Tue, 04 Feb 2003 21:50:44 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <x74r7jr9zk.fsf@mail.sysarch.com>
>>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
m> "Uri Guttman" <uri@stemsystems.com> wrote in message
m> news:x7ptq8qal3.fsf@mail.sysarch.com...
>> >>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
>>
>> i think my logic is fine. you are slamming clpm
m> Seems you don't learn quickly. As a little exercise to clear out
m> the cobwebs, why don't you post the exact phrase I used to slam
m> clpm prior to my last message? I said nothing but that there are
m> people who read alt.perl because the volume of clpm makes it
m> tiresome to keep up with. Somewhere in your convoluted mind you
and i replied:
so low volume and mostly wrong is better than high volume (which
is easily handled with a good newsreader) which has many perl
experts
so t must be that large volume isn't the only reason there is an
alt.perl. having lurked there i see you and a few others reveling in
your playpen with very little good perl content.
m> filled in some blanks that weren't there, only further making my
m> case that clpm is inhabited by a number self-important
m> blowhards. If your sense of self-worth is derived by what newsgroup
m> you post to, you really should take a good long look at your life.
well, what are you other than a self-rightious whinger who inhabits
alt.perl? and if your worth is derived by how well you try to insult ne,
then your life is what you deserve.
now go back to alt.perl before i taunt you a further time! and i expect
you to be answering every post there with long, cogent, customized
answers within the regulation 5 minute usenet help group response time
guidelines. otherwise we will have to forfeit your interweb privileges.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class
------------------------------
Date: Tue, 04 Feb 2003 21:56:31 GMT
From: "mgarrish" <mgarrish@rogers.com>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <jGW%9.269841$pDv.104882@news04.bloor.is.net.cable.rogers.com>
"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x74r7jr9zk.fsf@mail.sysarch.com...
> and i replied:
>
> so low volume and mostly wrong is better than high volume (which
> is easily handled with a good newsreader) which has many perl
> experts
>
Okay Uri, nice and slowly for you: where did you come to this logic? What
does that response have to do with reading alt.perl because the volume is
slower? Where was there any indication in my post that it is better to read
one than the other? Hopefully one day you'll learn to stop arguing with
people who are smarter than you.
Matt
------------------------------
Date: Tue, 04 Feb 2003 22:07:51 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <x7u1fjpumi.fsf@mail.sysarch.com>
>>>>> "m" == mgarrish <mgarrish@rogers.com> writes:
m> "Uri Guttman" <uri@stemsystems.com> wrote in message
m> news:x74r7jr9zk.fsf@mail.sysarch.com...
>> and i replied:
>>
>> so low volume and mostly wrong is better than high volume (which
>> is easily handled with a good newsreader) which has many perl
>> experts
>>
m> Okay Uri, nice and slowly for you: where did you come to this logic? What
m> does that response have to do with reading alt.perl because the volume is
m> slower? Where was there any indication in my post that it is better to read
m> one than the other? Hopefully one day you'll learn to stop arguing with
m> people who are smarter than you.
matt, i am not arguing with you. i am trolling you. so maybe you could
learn from this and keep your mouth shut.
and the logic is fine, thank you. the alt.perl group was started by
those who didn't want to rtfm or who expected to be able to post FAQs
all day long. it was never meant as a place for less volume. it is less
volume because anyone who reads both groups knows which has perl
expertise and which doesn't. the fact that you frequent alt.perl and
lurk here mostly says that you are the one who is out of touch. you may
know stuff but you aren't interested in playing in the greater perl
community. so sit in your sandbox, hack some perl, try to teach the
newbies to rtfm, and stfu. you were never in an argument here, only in
your own mind. it's been fun but you are now too boring to deal with.
and i don't really plonk but you deserve another virtual one.
*PLONK*
and i know you don't care but others do. :)
any further responses from you will be met with more sarcasm until you
wise up and drop it.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class
------------------------------
Date: Tue, 4 Feb 2003 16:29:05 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <slrnb40flh.8b8.tadmc@magna.augustmail.com>
mgarrish <mgarrish@rogers.com> wrote:
> "Uri Guttman" <uri@stemsystems.com> wrote in message
> news:x7n0lcskv0.fsf@mail.sysarch.com...
> people who could be considered "experts" (of which you are
> not one, I'm afraid),
Pardon me, but your ignorance is showing.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 04 Feb 2003 16:07:12 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Fast de-tabify
Message-Id: <3E402B80.343D03F@earthlink.net>
Irving Kimura wrote:
>
> Is there a faster Perl code to "de-tabify" a long string than this?:
>
> $no_tabs =
> join "\n",
> map { s/([^\t]*)\t/$1 . (' ' x (8-(length($1)%8)))/eg; $_ }
> split /\n/, $string_with_tabs;
($no_tabs = $string_with_tabs) =~ s[(?m:\G|^)(.*?)\t(\t*)]{
$1 .
(' ' x 8-(length($1)%8)) .
(' ' x length($2));
}ge;
[untested. I've no idea if it works, or if it's faster than yours.]
--
"So, who beat the clueless idiot today?"
"Well, we flipped for it, but when Kuno
landed, he wasn't in any shape to fight."
"Next time, try flipping a *coin.*"
------------------------------
Date: 4 Feb 2003 20:57:02 GMT
From: Shing-Fat Fred Ma <fma@doe.carleton.ca>
Subject: gSTLFilt/perl/g++ problem: regexp too big
Message-Id: <3E402918.C13AB51A@doe.carleton.ca>
Hello,
I'm using Leor Zolman's Perl filter, gstlfilt, to clean up g++
error messages on my use of the STL. It is the most recent:
BD Software STL Message Decryptor
Release 2.20 for gcc 2/3 (01/18/2003)
The code is attached below.
It works fine on g++ 3.2 running on cygwin 1.3.19-1
with perl 5.6.1.
I tried on g++ 2.95.2 running on Solaris 8 with
Perl 5.004_04 (built for sun4-solaris). It complains
that the regexp is too big.
The meaning of the message is clear. The solution,
from the web, seems to be breaking up the expression.
I've spent the past few days learning perl, but I
seriously doubt I will be able to robustly change
the stlfilt script. My newness to Perl is compounded
by my newsness to STL and its error messages.
The only other solutions I can think of are to build my
own Perl or g++ (I'm not root).
I've tried building my own g++ in the past month,
around 3 or 4 times. It's a very big program, and
even building the software to test it is challenging.
I haven't been able to build a version that passes
the tests with reasonably few errors. Granted, I
can only guess what is reasonable, but let's just
say, I've had mountains of failed tests.
Before attempting to build my own Perl, I wonder if
I could get some advice on whether that is really
the best way to be spending my time. Is there a
better way to resolve the problem without blindly
spending days (and weeks) randomly rebuilding
things that are already on the system? These
builds take alot of disk space, as well as time to
get the knowledge to build them. Unfortunately,
my sys admin is quite busy (we have just one), so
it's not realistic to go bug him continuously about
rebuilding stuff, especially if I'm the only person
who benefits (it is a hardware electronics department).
If there really is no other way, how bad is it to build
Perl?
Fred
P.S. I have not posted to comp.lang.c++ because
it would not be considered on-topic, even though
there is alot of STL expertise there.
--
Fred Ma, fma@doe.carleton.ca
Carleton University, Dept. of Electronics
1125 Colonel By Drive, Ottawa, Ontario
Canada, K1S 5B6
=========================================
The program is the file testmap.cpp in the sample files
that accompanies gstlfilt. It was compiled with
gfilt testmap.cpp
and generated the error
/\b([io])stream_iterator<((?:(?:(?:(?:\b[a-zA-Z_]\w*::)*\b[a-zA-Z_]\w* )?(?:(?:\b[a-zA-Z_]\w*::)*\b[a-zA-Z_]\w* )?(?:(?:\b[a-zA-/: regexp too big at /home/fma/INSTROOT/bin/gSTLFilt.pl line 531, <STDIN> chunk 1.
BD Software STL Message Decryptor Release 2.20 for gcc 2/3 (01/18/2003)
The c++ code is:
/////////////////////////////////////////////
// testmap.cpp
/////////////////////////////////////////////
#include <iostream>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
const int values[] = { 1,2,3,4,5 };
const int NVALS = sizeof values / sizeof (int);
struct intComp: public binary_function<int, int, bool>
{
bool operator()(int a, int b) const
{
return a < b;
}
};
int main()
{
using namespace std;
typedef map<int, double> valmap;
typedef map<int *, double *> pmap;
valmap m2(1,2,3);
pmap m3(1,2,3);
map<int, double, intComp> valmap3;
valmap m;
pmap p;
for (int i = 0; i < NVALS; i++)
{
m.insert(make_pair(values[i], pow(values[i], .5)));
valmap3.insert(0);
}
valmap::iterator it = 100;
valmap::const_iterator cit = 100;
m.insert(1,2);
m.insert(make_pair(36, 10.57)); // fine, more convenient
m.insert(m.end(), make_pair(40, 2.29)); // also fine
return 0;
}
------------------------------
Date: 4 Feb 2003 21:02:58 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: How do you: 'make install PREFIX=somepath', and then platform-independantly find somepath?
Message-Id: <b1p9q2$14uthq$1@ID-24002.news.dfncis.de>
Asfand yar Qazi <f_ker@yahoo.co.uk_no_spam> wrote:
> Consider the following:
> Machine1 (Perl installed in /opt/perl: /opt/perl/lib,
> /opt/perl/site_perl, etc.)
[...]
> Machine2 (Perl installed in /usr: /usr/lib/perl5,
> /usr/lib/perl5/site_perl, etc.)
[...]
> Note the arguments to '-I': one has 'lib/perl5', the other just 'lib'.
> How do I extract from perl -MConfig what to append to $MODPATH to get
> the actual place to search for modules?
> Sorry if this has been asked before, I can't seem to find the answer.
well, i had a very similar problem recently and posted
with the subject "ExtUtils::MakeMaker / @INC".
Please see <tinh98nss$1fe$tina@news01.tinita.de> and the
following thread in comp.lang.perl.modules.
i actually didn't find a solution which would
work for all perl-versions, although i too had hoped
for a key in %Config.
hth, tina
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/ \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: 4 Feb 2003 21:21:15 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: How do you: 'make install PREFIX=somepath', and then platform-independantly find somepath?
Message-Id: <tinh9szgh$23n$tina@news01.tinita.de>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> Asfand yar Qazi <f_ker@yahoo.co.uk_NO_SPAM> wrote in comp.lang.perl.misc:
>> Subject is a bit ribbish, I know, so I'll explain here:
>>
>> I am embedding Perl into a C++ program, and want to supply modules that
>> will be installed as part of the whole package. I know about '-I' and
>> -M'use lib ...' and all that. However, this fact is not important to
>> understanding the problem.
>>
>> Consider the following:
>>
>> Machine1 (Perl installed in /opt/perl: /opt/perl/lib,
>> /opt/perl/site_perl, etc.)
>>
>> $ cd $packagedir
>> $ perl Makefile.PL PREFIX=$MODPATH && make && make install
>> $ cd ~
>> $ perl -I$MODPATH/lib/site_perl test_program.pl
> Umm... why do you want to use -I? It's the *point* of specifying PREFIX
> at build time so that perl knows where to look for modules.
10:17pm tina@lux:Bit-Vector-6.3 519> export MODPATH=/tmp/mod
10:17pm tina@lux:Bit-Vector-6.3 520> perl Makefile.PL PREFIX=$MODPATH && \
make && make install
[...]
10:17pm tina@lux:Bit-Vector-6.3 521> cd ~
10:18pm tina@lux:tina 522> perl bit.pl
Can't locate Bit/Vector.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.8.0/i686-linux
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl .) at bit.pl line 2.
BEGIN failed--compilation aborted at bit.pl line 2.
so you need to include $MODPATH.
>> Machine2 (Perl installed in /usr: /usr/lib/perl5,
>> /usr/lib/perl5/site_perl, etc.)
>>
>> $ cd $packagedir
>> $ perl Makefile.PL PREFIX=$MODPATH && make && make install
>> $ cd ~
>> $ perl -I$MODPATH/lib/perl5/site_perl test_program.pl
>>
>>
>> Note the arguments to '-I': one has 'lib/perl5', the other just 'lib'.
>> How do I extract from perl -MConfig what to append to $MODPATH to get
>> the actual place to search for modules?
> As noted, you don't usually have to know where perl expects modules,
> it looks there by default. This gives you the complete paths (not
> only the suffix to $MODPATH):
> perl -MConfig=config_vars -e 'config_vars( qw( privlib sitelib))'
this gives you the whole path, right. but i think the
question is, like in that thread i mentioned in my
other post, how to go from there to the paths
relative to $MODPATH.
regards, tina
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/ \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: 4 Feb 2003 22:01:20 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do you: 'make install PREFIX=somepath', and then platform-independantly find somepath?
Message-Id: <b1pd7g$dcn$1@mamenchi.zrz.TU-Berlin.DE>
Tina Mueller <usenet@tinita.de> wrote in comp.lang.perl.misc:
Ah, I thought you would enter the thread. I remember your related
posting not long ago.
> Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> > Asfand yar Qazi <f_ker@yahoo.co.uk_NO_SPAM> wrote in comp.lang.perl.misc:
> >> Subject is a bit ribbish, I know, so I'll explain here:
> >>
> >> I am embedding Perl into a C++ program, and want to supply modules that
> >> will be installed as part of the whole package. I know about '-I' and
> >> -M'use lib ...' and all that. However, this fact is not important to
> >> understanding the problem.
> >>
> >> Consider the following:
> >>
> >> Machine1 (Perl installed in /opt/perl: /opt/perl/lib,
> >> /opt/perl/site_perl, etc.)
> >>
> >> $ cd $packagedir
> >> $ perl Makefile.PL PREFIX=$MODPATH && make && make install
> >> $ cd ~
> >> $ perl -I$MODPATH/lib/site_perl test_program.pl
>
> > Umm... why do you want to use -I? It's the *point* of specifying PREFIX
> > at build time so that perl knows where to look for modules.
>
> 10:17pm tina@lux:Bit-Vector-6.3 519> export MODPATH=/tmp/mod
> 10:17pm tina@lux:Bit-Vector-6.3 520> perl Makefile.PL PREFIX=$MODPATH && \
> make && make install
You're building a module, the OP was building perl with PREFIX=$MODPATH.
> [...]
> 10:17pm tina@lux:Bit-Vector-6.3 521> cd ~
> 10:18pm tina@lux:tina 522> perl bit.pl
> Can't locate Bit/Vector.pm in @INC (@INC contains:
> /usr/local/lib/perl5/5.8.0/i686-linux
> /usr/local/lib/perl5/5.8.0
> /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
> /usr/local/lib/perl5/site_perl/5.8.0
> /usr/local/lib/perl5/site_perl .) at bit.pl line 2.
> BEGIN failed--compilation aborted at bit.pl line 2.
>
> so you need to include $MODPATH.
That's a somewhat different situation. If you build perl with a PREFIX
perl will find modules that are installed by this perl in the standard
way (without PREFIX). This is the OP's situation as I understand it.
The situation is different when installing a module. Apparently, some
modules don't play entirely by the rules (or part of the install process
doesn't) when it comes to installing in a private directory through
PREFIX=$MODPATH. It *should* suffice to add $MODPATH to @INC, but
sometimes it doesn't. If I read correctly the remarks in perlmodinstall
(starting with "Also note that..."), additionally specifying
"$MODPATH/lib/site_perl" should cover all cases, though no explanation
is given when to use which.
[...]
Anno
------------------------------
Date: 4 Feb 2003 22:54:37 GMT
From: Tina Mueller <usenet@tinita.de>
Subject: Re: How do you: 'make install PREFIX=somepath', and then platform-independantly find somepath?
Message-Id: <tinh9t3uy$297$tina@news01.tinita.de>
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> Tina Mueller <usenet@tinita.de> wrote in comp.lang.perl.misc:
> Ah, I thought you would enter the thread. I remember your related
> posting not long ago.
=)
>> 10:17pm tina@lux:Bit-Vector-6.3 519> export MODPATH=/tmp/mod
>> 10:17pm tina@lux:Bit-Vector-6.3 520> perl Makefile.PL PREFIX=$MODPATH && \
>> make && make install
> You're building a module, the OP was building perl with PREFIX=$MODPATH.
oh, then i apologize, i didn't see that in the original posting...
regards, tina
--
http://www.tinita.de/ \ enter__| |__the___ _ _ ___
http://Movies.tinita.de/ \ / _` / _ \/ _ \ '_(_-< of
http://PerlQuotes.tinita.de/ \ \ _,_\ __/\ __/_| /__/ perception
------------------------------
Date: Tue, 04 Feb 2003 19:38:52 +0000
From: Asfand yar Qazi <f_ker@yahoo.co.uk_NO_SPAM>
Subject: How do you: 'make install PREFIX=somepath', and then platform-independantly find somepath?
Message-Id: <b1p4rg$gic$1@newsg2.svr.pol.co.uk>
Subject is a bit ribbish, I know, so I'll explain here:
I am embedding Perl into a C++ program, and want to supply modules that
will be installed as part of the whole package. I know about '-I' and
-M'use lib ...' and all that. However, this fact is not important to
understanding the problem.
Consider the following:
Machine1 (Perl installed in /opt/perl: /opt/perl/lib,
/opt/perl/site_perl, etc.)
$ cd $packagedir
$ perl Makefile.PL PREFIX=$MODPATH && make && make install
$ cd ~
$ perl -I$MODPATH/lib/site_perl test_program.pl
Machine2 (Perl installed in /usr: /usr/lib/perl5,
/usr/lib/perl5/site_perl, etc.)
$ cd $packagedir
$ perl Makefile.PL PREFIX=$MODPATH && make && make install
$ cd ~
$ perl -I$MODPATH/lib/perl5/site_perl test_program.pl
Note the arguments to '-I': one has 'lib/perl5', the other just 'lib'.
How do I extract from perl -MConfig what to append to $MODPATH to get
the actual place to search for modules?
Sorry if this has been asked before, I can't seem to find the answer.
------------------------------
Date: 4 Feb 2003 20:58:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do you: 'make install PREFIX=somepath', and then platform-independantly find somepath?
Message-Id: <b1p9ih$ans$1@mamenchi.zrz.TU-Berlin.DE>
Asfand yar Qazi <f_ker@yahoo.co.uk_NO_SPAM> wrote in comp.lang.perl.misc:
> Subject is a bit ribbish, I know, so I'll explain here:
>
> I am embedding Perl into a C++ program, and want to supply modules that
> will be installed as part of the whole package. I know about '-I' and
> -M'use lib ...' and all that. However, this fact is not important to
> understanding the problem.
>
> Consider the following:
>
> Machine1 (Perl installed in /opt/perl: /opt/perl/lib,
> /opt/perl/site_perl, etc.)
>
> $ cd $packagedir
> $ perl Makefile.PL PREFIX=$MODPATH && make && make install
> $ cd ~
> $ perl -I$MODPATH/lib/site_perl test_program.pl
Umm... why do you want to use -I? It's the *point* of specifying PREFIX
at build time so that perl knows where to look for modules.
> Machine2 (Perl installed in /usr: /usr/lib/perl5,
> /usr/lib/perl5/site_perl, etc.)
>
> $ cd $packagedir
> $ perl Makefile.PL PREFIX=$MODPATH && make && make install
> $ cd ~
> $ perl -I$MODPATH/lib/perl5/site_perl test_program.pl
>
>
> Note the arguments to '-I': one has 'lib/perl5', the other just 'lib'.
> How do I extract from perl -MConfig what to append to $MODPATH to get
> the actual place to search for modules?
As noted, you don't usually have to know where perl expects modules,
it looks there by default. This gives you the complete paths (not
only the suffix to $MODPATH):
perl -MConfig=config_vars -e 'config_vars( qw( privlib sitelib))'
Anno
------------------------------
Date: Tue, 04 Feb 2003 15:12:37 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Is there a *better* way to deref and look for matches?
Message-Id: <3E401EB5.7087AABB@earthlink.net>
denap wrote:
>
> Benjamin Goldberg wrote:
> > denap wrote:
[snip]
> > > $func =~
> > > s/$sfunc_repl{$key}->[SEARCH]/$sfunc_repl{$key}->[REPLACE]/e;
> >
> > Repeated looping over %sfunc_repl is probably not the best thing in
> > the world to be doing, if you can avoid it. What's inside of the
> > $sfunc_repl{$key}->[SEARCH] part? Are these regexen, or literal
> > strings?
> >
> > What's in the ->[REPLACE] part? Is this thing a tied variable, or
> > perhaps a blessed ref with an overloaded stringify? If it's not
> > either of these, then why is there that /e on the replacement?
> >
> > Also, what kind of strings are in $func?
>
> that's supposed to be /ee...
>
> The SEARCH (arr position 0) is a regex, to save off function args into
> $1...$N. The REPLACE (arr position 1) is the new arg order for a new
> API.
>
> Now... ...not the best thing in the world to be doing...
> ...tied variable...
> ...blessed ref with overloaded stringify...
>
> I'm not sure what/why you made these stmts. Can you elaborate, for my
> own edification, as to what you mean?
Ok.
If all of the $sfunc_repl{$key}->[SEARCH] items were literal strings,
not regexen, and all of the $sfunc_repl{$key}->[REPLACE] items were also
simple strings, not '"foo $1 bar $2"' type strings to be evaled, then
you could do something like:
my @keys = grep $func =~ /$_/, keys %sfunc_repl;
my @vals = @sfunc_repl{@keys};
my $newregex = join("|", map $_->[SEARCH], @vals);
my %replacements = map @{$_}[SEARCH,REPLACE], @vals;
$func =~ s/($newregex)/$replacements{$1}/g;
With this, s/// is only performed *once* on $func, rather than one s///
for each key which matched... as a result, it would be significantly
faster.
But this doesn't work if any of the ->[SEARCH] things are regexen, since
it's difficult or impossible to tell *which* of the ->[SEARCH] item
matched, in order to subtitute the appropriate ->[REPLACE] item.
[Note that even with the current case, there can be *some* improvement
to that inner loop:
foreach (@sfunc_repl{grep $func =~ /$_/, keys %sfunc_repl}) {
#print "Replacing $_->[SEARCH] with $_->[REPLACE]\n";
#print "Was: '$func'\n";
$func =~ s/$_->[SEARCH]/$_->[REPLACE]/gee;
#print "Now: '$func'\n";
}
This just decreases the number of hash lookups, though it doesn't
improve the regex stuff.
]
As to my asking about tied or overloaded stuff... Well, you've got
strings of the form '"foo $1 bar $2"' in your ->[REPLACE], and you're
doing /ee on the replacement to get interpolation.
Another way of doing that would be for ->[REPLACE] to be a tied scalar,
such that the ->FETCH method of the underlying tie object does that kind
of interpolation.
Or, as yet another way of doing that, you could have ->[REPLACE] be a
blessed reference, which, through the use of overload.pm, has it's own
stringification method, and that stringification does that kind of
interpolation.
A fourth way would involve the ->[REPLACE] thing being a coderef, and
your substitution would be s/.../...->[REPLACE]->()/e, (with only /e
there, not /ee).
If you still don't quite get why I was asking you what I was asking you,
the answer is: the more I know about your data, the faster I can make
your code. If I know nothing, I can do nothing.
--
"So, who beat the clueless idiot today?"
"Well, we flipped for it, but when Kuno
landed, he wasn't in any shape to fight."
"Next time, try flipping a *coin.*"
------------------------------
Date: Tue, 04 Feb 2003 15:54:08 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Parse a logfile - 1st column DateStamp; extract latest mods toan ItemNumber
Message-Id: <3E402870.14409CEE@earthlink.net>
Tim Cargile wrote:
> Benjamin Goldberg wrote:n
[snip]
> > There's no need for the map{} there:
> >
> > perl -naF'\|' \
> > -e '$i{$F[1]} = $_ if $F[0] > $i{$F[1]};'
> > -e 'END {print @i{sort keys %i}}' \
> > infilename > outfilename
> >
> > See perldoc perldata for more info on hash slices.
>
> Hi Perl Folks;
>
> I tried the above 'non-map' approach and it my Cygwin
> system didn't like it.
The problem here has nothing to do with perl or with cygwin.
I left out a backslash on the end of the second line.
--
"So, who beat the clueless idiot today?"
"Well, we flipped for it, but when Kuno
landed, he wasn't in any shape to fight."
"Next time, try flipping a *coin.*"
------------------------------
Date: Tue, 04 Feb 2003 21:52:33 GMT
From: "manj dodda" <dmanjunath@yahoo.com>
Subject: perl question
Message-Id: <BCW%9.1883$L46.161597532@newssvr21.news.prodigy.com>
I have a perl question, I have this as
$string = ((!TM)*A)|(TM*(((!TASEL)*TAA)|((TASEL)*TAB))) ;
I want this to be seperated as TM, A, TM, TASEL, TAA, TASEL, TAB. How do i
do it ?
Thanks in advance ?
perluser99
------------------------------
Date: Tue, 04 Feb 2003 17:36:05 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: perl question
Message-Id: <3E404055.55C3B647@earthlink.net>
manj dodda wrote:
>
> I have a perl question, I have this as
>
> $string = ((!TM)*A)|(TM*(((!TASEL)*TAA)|((TASEL)*TAB))) ;
>
> I want this to be seperated as TM, A, TM, TASEL, TAA, TASEL, TAB. How
> do i do it ?
First, you need quotes around the string:
$string = "((!TM)*A)|(TM*(((!TASEL)*TAA)|((TASEL)*TAB)))";
Otherwise, you're not going to get anything sensible in $string.
Second, as far as I can see, you don't really care about the
punctuation, only about the words themselves... so, try doing:
my @words = $string =~ /\w+/g;
--
"So, who beat the clueless idiot today?"
"Well, we flipped for it, but when Kuno
landed, he wasn't in any shape to fight."
"Next time, try flipping a *coin.*"
------------------------------
Date: Tue, 04 Feb 2003 14:42:33 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Text extraction using patterns (Perl FAQ 6 not helping!!)
Message-Id: <3E4017A9.73DF537F@earthlink.net>
Stephen Adam wrote:
[snip]
> >> "< class=g>"
> ^^^^^^^^^^
> >>That is not legal HTML...
>
> >>(actually it is legal, but it is content, not markup)
>
> <P class=g> IS perfectly legal
Sure, but the strings "< class=g>" and the strings "<P class=g>" are not
the same. One has a "P", and the other doesn't.
--
"So, who beat the clueless idiot today?"
"Well, we flipped for it, but when Kuno
landed, he wasn't in any shape to fight."
"Next time, try flipping a *coin.*"
------------------------------
Date: Tue, 4 Feb 2003 13:44:39 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Text extraction using patterns (Perl FAQ 6 not helping!!)
Message-Id: <slrnb40617.7hs.tadmc@magna.augustmail.com>
[ Please do NOT send stealth Cc's.
Have you seen the Posting Guidelines that are posted here weekly?
]
Stephen Adam <00056312@brookes.ac.uk> wrote:
> Thanks for the response Tad but I think you got what I was saying
> wrong.
I got one right and one wrong, and so did you.
> I always try to make sure my posts make sense, and in this case I am
> sure it does.
^^^^
^^^^
I beg to differ...
>>> I am trying to extract some information from a dynamically created
>>> HTML page. The information I want always starts with "< class=g>"
> ^^^^^^^^^^
>>>That is not legal HTML...
>
>>>(actually it is legal, but it is content, not markup)
>
>
><P class=g> IS perfectly legal markup
Yes it is, but that isn't what you wrote. Look again at
what I underlined.
>>> our $htmlpage = "random stuff zz here is some stuff I want xx some
>>> more random stuff zz and here is some other stuff I want xx and yet
>>> more random stuff";
>
>>You should get an empty array from that data, as it does not
>>contain any of the things you said you are looking for.
>
> This is completely wrong as if you actually read the whole of my post
> you would have noticed the line
>
>>Let's say I want to extract all the text which starts with zz and
>>finishes with xx and copy each occurrence of this into an array
>>element.
Right, I missed that. Sorry.
If you had actually read the whole of your own post you might
have spotted your typo.
> I already had had one accurate response
> back when you posted.
It also propagated your typo, so "accurate" seems a
generous characterization. :-)
> but please read my post before telling me it does not make
> sense.
I will if you will.
I missed you changing from one start pattern to another.
You missed a "P".
Proof that we are both human. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
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 V10 Issue 4512
***************************************