[18780] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 948 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 21 14:06:03 2001

Date: Mon, 21 May 2001 11:05:24 -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: <990468324-v10-i948@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 21 May 2001     Volume: 10 Number: 948

Today's topics:
        -M question (Randy T.)
    Re: -M question (Mark Jason Dominus)
        [ANNOUNCE] Config::Properties 0.03 <ryarger@mediaone.net>
    Re: [Mac] Perceps on Macintosh? (Helgi Briem)
    Re: ActiveState PPM Modules (Helgi Briem)
    Re: Are compiled regexes global? <sherlock@genome.stanford.edu>
    Re: Are compiled regexes global? (Eric Bohlman)
    Re: Are compiled regexes global? <bart.lateur@skynet.be>
    Re: Are compiled regexes global? (Anno Siegel)
    Re: Are compiled regexes global? <tinamue@zedat.fu-berlin.de>
    Re: Array slice: how about the remainder? (Steven)
    Re: Array slice: how about the remainder? (Steven)
    Re: Array slice: how about the remainder? (Anno Siegel)
    Re: Array slice: how about the remainder? (Steven)
    Re: Array slice: how about the remainder? (Sweth Chandramouli)
    Re: Array slice: how about the remainder? (Steven Smolinski)
    Re: Array slice: how about the remainder? <godzilla@stomp.stomp.tokyo>
    Re: Array slice: how about the remainder? (Mark Jason Dominus)
        confusion about installation of modules <@netvigator.com>
    Re: confusion about installation of modules nobull@mail.com
    Re: Connecting to MS Access with an Apache Server??? <rebelvideo@hotmail.com>
    Re: Connecting to MS Access with an Apache Server??? <rebelvideo@hotmail.com>
        environment <nll@hotmail.com>
        Environment <nll@hotmail.com>
    Re: Environment <christoph.neubauer@siemens.at>
    Re: environment nobull@mail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 21 May 2001 09:46:46 -0700
From: tarrantr@strsoh.org (Randy T.)
Subject: -M question
Message-Id: <93189719.0105210846.61077f37@posting.google.com>

I have a script that checks the file modification time using the -M
switch ie:
  
   if(-M $filename > $age){
       .
       .
   }

Running on Solaris, this reports modified days of 0 unless the script
is in the directory I'm processing.  Using ActiveState on NT, the
script doesn't care where the target directory is located.

Do I *have* to have the script located in each directory that I want
to process?

Thanks!


------------------------------

Date: Mon, 21 May 2001 16:52:47 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: -M question
Message-Id: <3b0947d1.794$2e3@news.op.net>

In article <93189719.0105210846.61077f37@posting.google.com>,
Randy T. <tarrantr@strsoh.org> wrote:
>I have a script that checks the file modification time using the -M
>switch ie:
>  
>   if(-M $filename > $age){
>       .
>       .
>   }
>
>Running on Solaris, this reports modified days of 0 unless the script
>is in the directory I'm processing.  

It returns  an undefined value when the file you asked for doesn't
exist.  When you use an undefined value as a number, it behaves like zero.

>Do I *have* to have the script located in each directory that I want
>to process?

No, but you have to include the correct path to the file you want.  If
$filename is 'foo.txt', there is no way for the system to magically
know that you actually meant
"/usr/home/tarrantr/app/data/2001/May/files/foo.txt".  There might be
10,000 "foo.txt" files scttered around, and there is no way for the
system to guess which one you might mean.

If the filename does not contain a path, the system will assume that
it is in the current directory.


-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


------------------------------

Date: Sun, 20 May 2001 02:31:47 GMT
From: "Randy Jay Yarger" <ryarger@mediaone.net>
Subject: [ANNOUNCE] Config::Properties 0.03
Message-Id: <tgic18q0p9fdec@corp.supernews.com>

Config::Properties 
==============
A Perl version of the API presented by the standard java.util.Properties class.

Changes summary:
0.03  - Corrected Object Oriented behavior (was using class variables for
	everying, now using instance variables)
	- Skip blank lines
	- Fixed borked packaging (#$@% Windows!)
	- Fixed incorrect version number
	- Allow the escape characters proscribed by the Java API spec

README:
Config::Properties
=============

Description
-----------

Config::Properties is an near implementation of the java.util.Properties API.
It is designed to allow easy reading, writing and manipulation of Java-style
property files.

The format of a Java-style property file is that of a key-value pair seperated
by either whitespace, the colon (:) character, or the equals (=) character.
Whitespace before the key and on either side of the seperator is ignored.
	
Lines that begin with either a hash (#) or a bang (!) are considered comment
lines and ignored.

A backslash (\) at the end of a line signifies a continuation and the next
line is counted as part of the current line (minus the backslash, any whitespace
after the backslash, the line break, and any whitespace at the beginning of
the next line).

When a property file is saved it is in the format "key=value" for each line.

Copyright
---------

Copyright (c) 2001 Randy Jay Yarger. All Rights Reserved.

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

Installation
------------

> perl Makefile.PL
> make

 .... and if you like

> make test

 .... and then

> make install
> perldoc Config::Properties

Author
------

Randy Jay Yarger <ryarger@mediaone.net>




------------------------------

Date: Mon, 21 May 2001 14:06:41 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: [Mac] Perceps on Macintosh?
Message-Id: <3b092098.3536720425@news.isholf.is>

On Mon, 21 May 2001 10:46:59 +0100, p.agapow@ic.ac.uk
(Paul-Michael Agapow) wrote:

>The subjectline says it all: I'm trying to get Perceps running on a Mac,

What's a Perceps?

>and due in part to my very rusty Perl skills and in part to the lack of
>a convenient CLI on the Mac, it's turning into a bit of an untidy task.

What's a CLI?

>As notes inside the Perceps source indicate people used it on the Mac,
>does anyone have any tips? Especially a flexible way of passing the
>commandline to the Perceps script.

What does any of this have to do with Perl?

Regards,
Helgi Briem


------------------------------

Date: Mon, 21 May 2001 13:36:28 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: ActiveState PPM Modules
Message-Id: <3b091976.3534894549@news.isholf.is>

On Sat, 19 May 2001 15:05:55 GMT, jason@jamesjl.demon.co.uk
(Jason James) wrote:

>The module I need at the moment is the
>
>Date::Calc module that can be installed
>onto my copy of PERL running on a
>Window NT 4 server and IIS4.
>
[c:\]cd perl\bin
[c:\perl\bin]perl ppm.pl
PPM> install Date-Calc
PPM> quit

You may have to set your HTTP_proxy environment
variable if you are behind a proxy/firewall.

Regards,
Helgi Briem



------------------------------

Date: Mon, 21 May 2001 06:27:55 -0700
From: Gavin Sherlock <sherlock@genome.stanford.edu>
Subject: Re: Are compiled regexes global?
Message-Id: <210520010627556684%sherlock@genome.stanford.edu>

Hi,
   Thanks for the answer.  I know what the manual says, it's just not
clear from the manual that a lexically scoped variable, when compiled
into a regex, is not allowed to change even if that variable is
destroyed, then reinstatiated with a new call to the subroutine.  The
global nature, applied to a lexical variable, simply seemed
unintuitive.  I suppose the manual does say over the life of the
script, so I should have expected it, but I figured a new call to a
subroutine would count as a whole new regex.  Wishful thinking :-).  It
would be nice if there were some global special perl variable that
could be undef'd to clear out compiled regexes.  I'll certainly brush
up on qr,

Cheers,
Gavin

In article <m3d793jlj7.fsf@alquds.qumsieh.homeip.net>, Ala Qumsieh
<aqumsieh@hyperchip.com> wrote:

> Gavin wrote:
> 
> >    I have a search routine, that reads through a file looking for
> > matches.  I construct a regex, based on whether they had wild-cards or
> > not in their search criteria, and then use the /o modifier to compile
> > it.  If no hits are found, I add wild-cards to the search string, if
> > they weren't there, and repeat the search.  Trouble is, it still
> > doesn't get any hits.  I know that if I have wild-cards from the
> > beginning, I have plenty of hits.  My suspicion is that the regex that
> > was compiled is reused, even though it's a new call to the subroutine,
> > and the $regex variable (which is lexically scoped) is different now. 
> > So my question is:  are compiled regexes like a look-up in a global
> > hash, as opposed to local to their subroutine?
> 
> As usual, RTFM :-)
> 
> Have a look at perlop. In the section 'Regexp Quote-Like Operators'
> you'll find the following:
> 
>                                                      If you want
>                such a pattern to be compiled only once, add a
>                `/o' after the trailing delimiter.  This avoids
>                expensive run-time recompilations, and is useful
>                when the value you are interpolating won't change
>                over the life of the script.  However, mentioning
>                `/o' constitutes a promise that you won't change
>                the variables in the pattern.  If you change them,
>                Perl won't even notice.  See also the section on
>                "qr//".
> 
> You should take that advice and have a look at qr//.
> 
> --Ala


------------------------------

Date: 21 May 2001 13:53:48 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Are compiled regexes global?
Message-Id: <9eb6lc$enu$3@bob.news.rcn.net>

Gavin Sherlock <sherlock@genome.stanford.edu> wrote:
>    Thanks for the answer.  I know what the manual says, it's just not
> clear from the manual that a lexically scoped variable, when compiled
> into a regex, is not allowed to change even if that variable is
> destroyed, then reinstatiated with a new call to the subroutine.  The
> global nature, applied to a lexical variable, simply seemed
> unintuitive.  I suppose the manual does say over the life of the

But nothing is "applied to a lexical variable" here.  When perl compiles a 
regex that has a /o modifier, it simply expands the variable's contents 
and then forgets that any variable was involved.  It's just as if you 
interpolated a variable's contents into a quoted string; unless you 
re-execute the assignment, the results won't reflect any subsequent 
changes to the variable's value.  Not even if the variable goes out of 
scope.



------------------------------

Date: Mon, 21 May 2001 13:54:39 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Are compiled regexes global?
Message-Id: <787igtsa37lrtm46na26obken3rfa9q8fi@4ax.com>

Gavin Sherlock wrote:

> I construct a regex, based on whether they had wild-cards or
>not in their search criteria, and then use the /o modifier to compile
>it.

>My suspicion is that the regex that
>was compiled is reused, even though it's a new call to the subroutine,
>and the $regex variable (which is lexically scoped) is different now. 

Yup.

Er... in theory.

>So my question is:  are compiled regexes like a look-up in a global
>hash, as opposed to local to their subroutine?  I'm using Perl 5.004 on
>Solaris. 

That's one version where it will work as it used to.

I have the distinct impression that /o is a NOOP on Perl5.6?

	$_ = 'foo baz';
	foreach my $re (qw/foo bar baz/) {
	      /($re)/o and print "'$_' contains $re: $1\n";
	}
-->
	'foo baz' contains foo: foo
	'foo baz' contains baz: baz

That doesn't make sense. It should have use 'foo' for the regex every
single time. Well... the new behaviour is useful, for code as that of
the OP.

-- 
	Bart.


------------------------------

Date: 21 May 2001 13:57:23 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Are compiled regexes global?
Message-Id: <9eb6s3$1eh$1@mamenchi.zrz.TU-Berlin.DE>

According to Gavin Sherlock  <sherlock@genome.stanford.edu>:

Please trim the quoted material and place your reply below the
part of the post you are replying to.

> Hi,
>    Thanks for the answer.  I know what the manual says, it's just not
> clear from the manual that a lexically scoped variable, when compiled
> into a regex, is not allowed to change even if that variable is
> destroyed, then reinstatiated with a new call to the subroutine.

[rest snipped]

It is unmistakably clear.  From perlop:

       "/o" constitutes a promise that you won't change
       the variables in the pattern.  If you change them,
       Perl won't even notice. ...

Anno


------------------------------

Date: 21 May 2001 17:39:24 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Are compiled regexes global?
Message-Id: <9ebjsc$1trlv$3@fu-berlin.de>

Bart Lateur <bart.lateur@skynet.be> wrote:

>>So my question is:  are compiled regexes like a look-up in a global
>>hash, as opposed to local to their subroutine?  I'm using Perl 5.004 on
>>Solaris. 

> That's one version where it will work as it used to.

> I have the distinct impression that /o is a NOOP on Perl5.6?

> 	$_ = 'foo baz';
> 	foreach my $re (qw/foo bar baz/) {
> 	      /($re)/o and print "'$_' contains $re: $1\n";
> 	}
> -->
> 	'foo baz' contains foo: foo
> 	'foo baz' contains baz: baz

> That doesn't make sense. It should have use 'foo' for the regex every
> single time. Well... the new behaviour is useful, for code as that of
> the OP.

i have 5.6.0 and it works as expected:
07:36pm tina.mueller@lolland tina.mueller > /usr/bin/perl5.6.0 -e'
$_="foo baz";
foreach my $re (qw/foo bar baz/) {
              /($re)/o and print "$_ contains $re: $1\n";
}'
foo baz contains foo: foo
foo baz contains bar: foo
foo baz contains baz: foo

(sun 5.7 and linux 2.4)
-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \ _,_\ __/\ __/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


------------------------------

Date: 21 May 2001 06:28:33 -0700
From: steve.busiello@gs.com (Steven)
Subject: Re: Array slice: how about the remainder?
Message-Id: <fa45b871.0105210528.6c6489b3@posting.google.com>

> I've been asked a quite interesting question.
> 
> my @array = <NAMELIST>;
> my @chosen = (0,3,5,7,21,35,63,66,68);
> my @go_picnic = @array[@chosen];  # those who are chosen go picnic
> my @stay_home = @array[???????];  # those who are not chosen stay home
> 
> The solution I can think of is:
> 
> my @not_chosen = grep {!grep($_,@chosen)} 0..$#array;
> my @stay_home = @array[@not_chosen];
> 
> There must be a better way...  Could you help?

This is what i came up with:
@not_chosen = grep { /[^@chosen]/ }  @array;
-Steven


------------------------------

Date: 21 May 2001 06:30:10 -0700
From: steve.busiello@gs.com (Steven)
Subject: Re: Array slice: how about the remainder?
Message-Id: <fa45b871.0105210530.4392a035@posting.google.com>

> my @array = <NAMELIST>;
> my @chosen = (0,3,5,7,21,35,63,66,68);
> my @go_picnic = @array[@chosen];  # those who are chosen go picnic
> my @stay_home = @array[???????];  # those who are not chosen stay home
> 
> The solution I can think of is:
> 
> my @not_chosen = grep {!grep($_,@chosen)} 0..$#array;
> my @stay_home = @array[@not_chosen];


this is what i came up with:
@not_chosen = grep { /[^@chosen]/ }  @array;
-Steven


------------------------------

Date: 21 May 2001 14:03:17 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Array slice: how about the remainder?
Message-Id: <9eb775$1eh$2@mamenchi.zrz.TU-Berlin.DE>

According to Steven <steve.busiello@gs.com>:
> > I've been asked a quite interesting question.
> > 
> > my @array = <NAMELIST>;
> > my @chosen = (0,3,5,7,21,35,63,66,68);
> > my @go_picnic = @array[@chosen];  # those who are chosen go picnic
> > my @stay_home = @array[???????];  # those who are not chosen stay home
> > 
> > The solution I can think of is:
> > 
> > my @not_chosen = grep {!grep($_,@chosen)} 0..$#array;
> > my @stay_home = @array[@not_chosen];
> > 
> > There must be a better way...  Could you help?
> 
> This is what i came up with:
> @not_chosen = grep { /[^@chosen]/ }  @array;

What do you expect @not_chosen to contain?  Did you try it?  What did
it contain?

Anno


------------------------------

Date: 21 May 2001 09:00:10 -0700
From: steve.busiello@gs.com (Steven)
Subject: Re: Array slice: how about the remainder?
Message-Id: <fa45b871.0105210800.2046045a@posting.google.com>

i tested it like this:

@array ( 1..10 );
@chosen = (1,3,5,7,9);
@not_chosen = grep { /[^@chosen]/ }  @array;
foreach (@not_chosen) { print "$_\n"; }

my results were 2,4,6,8,10
-Steven

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<9eb775$1eh$2@mamenchi.zrz.TU-Berlin.DE>...
> According to Steven <steve.busiello@gs.com>:
> > > I've been asked a quite interesting question.
> > > 
> > > my @array = <NAMELIST>;
> > > my @chosen = (0,3,5,7,21,35,63,66,68);
> > > my @go_picnic = @array[@chosen];  # those who are chosen go picnic
> > > my @stay_home = @array[???????];  # those who are not chosen stay home
> > > 
> > > The solution I can think of is:
> > > 
> > > my @not_chosen = grep {!grep($_,@chosen)} 0..$#array;
> > > my @stay_home = @array[@not_chosen];
> > > 
> > > There must be a better way...  Could you help?
> > 
> > This is what i came up with:
> > @not_chosen = grep { /[^@chosen]/ }  @array;
> 
> What do you expect @not_chosen to contain?  Did you try it?  What did
> it contain?
> 
> Anno


------------------------------

Date: Mon, 21 May 2001 16:12:18 GMT
From: sweth+perl@gwu.edu (Sweth Chandramouli)
Subject: Re: Array slice: how about the remainder?
Message-Id: <C7bO6.14277$G5.2997054@news1.rdc1.md.home.com>

In article <fa45b871.0105210800.2046045a@posting.google.com>,
Steven <steve.busiello@gs.com> wrote:
>i tested it like this:
>
>@array ( 1..10 );
>@chosen = (1,3,5,7,9);
>@not_chosen = grep { /[^@chosen]/ }  @array;
>foreach (@not_chosen) { print "$_\n"; }
>
>my results were 2,4,6,8,10
	Heh.  That's very entertaining; it just goes to show that
a single anecdotal piece of evidence doesn't necessarily prove anything.
Try setting array to (1..12) and see what the results are; your 
particular data set happened to hide a small problem in your logic.

  -- Sweth.

-- 
Sweth Chandramouli ; <sweth+perl@gwu.edu>


------------------------------

Date: Mon, 21 May 2001 16:22:31 GMT
From: steven.smolinski@sympatico.ca (Steven Smolinski)
Subject: Re: Array slice: how about the remainder?
Message-Id: <slrn9gilkl.18u.steven.smolinski@ragnar.stevens.gulch>

[Jeopardectomy performed to allow the normal flow of time.]

Steven <steve.busiello@gs.com> wrote:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> > According to Steven <steve.busiello@gs.com>:

> > > This is what i came up with:
> > > @not_chosen = grep { /[^@chosen]/ }  @array;
> > 
> > What do you expect @not_chosen to contain?  Did you try it?  What
> > did it contain?
>
> i tested it like this:
> 
> @array ( 1..10 );
> @chosen = (1,3,5,7,9);
> @not_chosen = grep { /[^@chosen]/ }  @array;
> foreach (@not_chosen) { print "$_\n"; }
> 
> my results were 2,4,6,8,10

What happens when your @array contains 111 and your @chosen contains 11?
Or when @array contains 22 and @chosen contains 2?

Your program only works properly on a very, very small set of data.

Steve
-- 
Steven Smolinski => http://www.steven.cx/


------------------------------

Date: Mon, 21 May 2001 09:59:18 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Array slice: how about the remainder?
Message-Id: <3B094966.110476B4@stomp.stomp.tokyo>

John Lin wrote:

(snippage)

> my @array = <NAMELIST>;
> my @chosen = (0,3,5,7,21,35,63,66,68);
> my @go_picnic = @array[@chosen];  # those who are chosen go picnic
> my @stay_home = @array[???????];  # those who are not chosen stay home
 
> It's convinent to have array slice syntax to get partial of an array.
> But what about the remainder (also partial of the array)?
 
> The solution I can think of is:
 
> my @not_chosen = grep {!grep($_,@chosen)} 0..$#array;
> my @stay_home = @array[@not_chosen];

Have you tested this method?


In lieu of clear and concise parameters, a presumption
is made your @chosen represents element reference numbers
based upon your code.

Consider posting precise and exact parameters in the future.
Not doing so is quite illogical.

You will find my test script below my signature to
be relatively quick and efficient. A non-destuctive
method would be to make a copy of @array or to
localize @array in a sub-routine in conjunction
with an our declaration.


Godzilla!
--

#!perl

my (@stay_home);
my (@array) = (1 .. 20);
my (@chosen) = (0, 2, 4, 6, 8, 10, 12, 14, 16, 18);
foreach $chosen (@chosen)
 {undef ($array[$chosen]); }
foreach $stay_home (@array)
 { 
  if (defined ($stay_home))
   { push (@stay_home, $stay_home); }
 }

print "@stay_home";

PRINTED RESULTS:
________________

2 4 6 8 10 12 14 16 18 20


------------------------------

Date: Mon, 21 May 2001 17:09:51 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Array slice: how about the remainder?
Message-Id: <3b094bde.7fb$39a@news.op.net>

In article <9eaq4b$pej@netnews.hinet.net>,
John Lin <johnlin@chttl.com.tw> wrote:
>Dear all,
>
>I've been asked a quite interesting question.
>
>my @array = <NAMELIST>;
>my @chosen = (0,3,5,7,21,35,63,66,68);
>my @go_picnic = @array[@chosen];  # those who are chosen go picnic
>my @stay_home = @array[???????];  # those who are not chosen stay home

I don't know if this is worth doing:

        my @stay_home = @array;
        for (reverse @chosen) {
          splice @stay_home, $_, 1 
        }
        
It's quadratic time in principle, but it's quite different from the
other proposed solutions, and might nevertheless be faster than they
are for practical cases.

However, I did not benchmark.

-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


------------------------------

Date: Tue, 22 May 2001 02:51:46 +0800
From: "allan" <@netvigator.com>
Subject: confusion about installation of modules
Message-Id: <9ebfl4$pq25@imsp212.netvigator.com>

Hi,

I am a newbie to Perl.  I have a Linux 6.2 with Perl 5.005 and I have been
trying to install the LWP module because I need this for the Spidering
program of my Swish-e Indexing program.

I am slightly confused about how to install LWP.  I have downloaded the
zipped file, libwww-perl-5.53_94.tar.gz and I have uncompressed it.  After
uncompressing, I find a README file which says that following:

>PREREQUISITES
>
>In order to install and use this package you will need Perl version
>5.004 or better.  Some modules within this package depend on other
>packages that are distributed separately from Perl.  We recommend that
>you have the following packages installed before you install
>libwww-perl:
>
 > URI
 > MIME-Base64
  >HTML-Parser
  >libnet
  >Digest-MD5
>
>These packages should be available on CPAN.
>
>If you want to access sites using the https protocol, then you need to
>install the Crypt::SSLeay or the IO::Socket::SSL module.  The
>README.SSL file will tell you more about how libwww-perl supports SSL.
>
>
>INSTALLATION
>
>You install libwww-perl, as you would install any perl module library,
>by running these commands:
>
 >  perl Makefile.PL
  > make
   >make test
   >make install

However, I have seen people who post in this group say that I can use the
following:

>perl -MCPAN -e shell
>install Bundle::LWP

How should I really install it?  It seems to ask me quite a lot of things
when I try to type "perl -MCPAN -e shell".

Basically, now I just have the uncompressed libwww-perl-5.53_94.tar.gz  and
I am not sure what to do.

Grateful if someone could shed the light on this.

Thanks.

Peter






------------------------------

Date: 21 May 2001 18:09:01 +0100
From: nobull@mail.com
Subject: Re: confusion about installation of modules
Message-Id: <u91ypibpea.fsf@wcl-l.bham.ac.uk>

"allan" <@netvigator.com> writes:

> I am slightly confused about how to install LWP.  I have downloaded the
> zipped file, libwww-perl-5.53_94.tar.gz and I have uncompressed it.  After
> uncompressing, I find a README file which says that following:
> 
> >PREREQUISITES
> >
> >In order to install and use this package you will need Perl version
> >5.004 or better.  Some modules within this package depend on other
> >packages that are distributed separately from Perl.  We recommend that
> >you have the following packages installed before you install
> >libwww-perl:
> >
>  > URI
>  > MIME-Base64
>   >HTML-Parser
>   >libnet
>   >Digest-MD5
> >
> >These packages should be available on CPAN.

So what part, if any, of that did you not understand?

> >If you want to access sites using the https protocol, then you need to
> >install the Crypt::SSLeay or the IO::Socket::SSL module.  The
> >README.SSL file will tell you more about how libwww-perl supports SSL.

So what part, if any, of that did you not understand?

> >INSTALLATION
> >
> >You install libwww-perl, as you would install any perl module library,
> >by running these commands:
> >
>  >  perl Makefile.PL
>   > make
>    >make test
>    >make install

So what part, if any, of that did you not understand?

> However, I have seen people who post in this group say that I can use the
> following:
> 
> >perl -MCPAN -e shell
> >install Bundle::LWP

You can.  Once you have the CPAN tool setup it will do all the above
stuff automatically (except it won't install Crypt::SSLeay).

> How should I really install it?

In one of the above two ways.

> It seems to ask me quite a lot of things when I try to type "perl
> -MCPAN -e shell".

It will do, the first time.

> Basically, now I just have the uncompressed libwww-perl-5.53_94.tar.gz  and
> I am not sure what to do.

Either follow the instructions for installing by hand (including
installing any prerequisites by hand) or configure the CPAN tool and
use that.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Sat, 19 May 2001 12:33:48 +0930
From: Chris <rebelvideo@hotmail.com>
Subject: Re: Connecting to MS Access with an Apache Server???
Message-Id: <3B05E294.F162FC98@hotmail.com>

Hi Ryan

No one else seems to have given you the answer you want so I will give
it a try

First you NEED some database software on the remote machine
I use mySQL, most ISP's will supply that but you will probably be
charged for it.

You can use linux's built in database free of charge, BUT it is only
safe if you are going to read from it or ga

Then you need to export the data from your Access database into a format
that mysql will read
A csv file will do just great

then you upload that file to the server

then you instruct mySQL to populate the database with that data file

then you can connect to your mysql database with ease

and do whatever you want with the data

I have just spent the last three months putting together something
similar from scratch so I know where you are coming from

let me know where youre at and I'll see if I can help

-- 
Regards

Chris
rebelvideo@hotmail.com



Ryan wrote:
> 
> Our web site is running on an remote apache server and we have a MS access
> database that we would like copy up to a directory and to be able to simply
> exctract information from and show it in an HTML format.  Here is the start
> of my code.
> 
> #!/usr/bin/perl
> use DBI;
> $dbh = DBI->connect("dbi:ODBC:'driver=Microsoft Access Driver (*.mdb);
> dbq=major.mdb'",'','');
> #do stuff...
> $dbh->disconnect;
> 
> Im having trouble connecting to our database I keep getting this error:
> 
> Can't locate loadable object for module DBD::ODBC in @INC (@INC contains:
> /usr/local/lib/perl5/5.00503/sun4-solaris
> /usr/local/lib/perl5/5.00503
> /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
> /usr/local/lib/perl5/site_perl/5.005 .) at
> /home/users/f/fmg/public_html/cgi-bin/test/test2.pl line 3 BEGIN
> failed--compilation aborted at
> /home/users/f/fmg/public_html/cgi-bin/test/test2.pl line 3.
> 
> Any help on what I am doing wrong or the correct way to connect to the
> database online would be great.
> Thanks,
> Ryan


------------------------------

Date: Sat, 19 May 2001 12:12:07 +0930
From: Chris <rebelvideo@hotmail.com>
Subject: Re: Connecting to MS Access with an Apache Server???
Message-Id: <3B05DD7F.B3651325@hotmail.com>

Hi Chris

I'm with Bart

> Ryan said
>
> Our web site is running on an remote apache server and we have a MS access
> database that we would like copy up to a directory and to be able to simply
> exctract information from and show it in an HTML format.  Here is the start
> of my code.

If you read the above, Bart is correct.

"copy up to a directory"  does not mean "connect to a remote server"

it means ftp the file to the remote server, plain and simple.

He is obviously not very computer literate as the mentioning of apache
is meaningless

-- 
Regards

Chris
rebelvideo@hotmail.com

Chris wrote:
> 
> in article v0n7gt8ro4h5b0pua3t7771ultge8vb7q9@4ax.com, Bart Lateur at
> bart.lateur@skynet.be wrote on 05/17/2001 9:10 AM:
> 
> > The guy justed wanted to OPEN an Access file on a Solaris box. He
> > doesn't have Access running on a connected Windows machine.
> >
> > --
> > Bart.
> 
> Uh.. No. If you read the post carefully [1], he wanted to connect to an MS
> Access database running on a Windows machine. Using, we assume, a Unix/Linux
> flavor. He then gave an example of a connection script in Perl, which
> produced and error.
> 
> After you told him that connecting to an MS Access database wasn't possible
> from a Unix/Linux machine, I gently corrected, saying that it was possible
> to make the connection, and gave a reason why he might be getting the error
> message.
> 
> I meant nothing personal, your original advice was simply incorrect, and it
> did not answer the question, which was - paraphrased - "why does this code
> fragment produce an error."
> 
> cp
> 
> [1] in article 9duv5t$ajf$1@news.xmission.com, Ryan at ryan@tuitions.com
> wrote on 05/16/2001 5:36 PM:
> 
> > Our web site is running on an remote apache server and we have a MS access
> > database that we would like copy up to a directory and to be able to simply
> > exctract information from and show it in an HTML format.  Here is the start
> > of my code.
> >
> > #!/usr/bin/perl
> > use DBI;
> > $dbh = DBI->connect("dbi:ODBC:'driver=Microsoft Access Driver (*.mdb);
> > dbq=major.mdb'",'','');
> > #do stuff...
> > $dbh->disconnect;
> >
> > Im having trouble connecting to our database I keep getting this error:


------------------------------

Date: Mon, 21 May 2001 16:01:20 +0100
From: "Nuno" <nll@hotmail.com>
Subject: environment
Message-Id: <h4aO6.4756$Hn6.11517040@newsserver.ip.pt>

Hello all,

How can i set an environment variable from perl like:

# export HOSTX=192.168.112.1

# run_my_perl_prog (HOSTX change to 172.xxxxx)

# set | grep HOSTX
HOSTX=172.xxxxx


Tanks in advance,

Nuno




------------------------------

Date: Mon, 21 May 2001 16:11:48 +0100
From: "Nuno" <nll@hotmail.com>
Subject: Environment
Message-Id: <5eaO6.4758$Ju.11744347@newsserver.ip.pt>

Hello all,

How can i set an environment variable from perl like:

# export HOSTX=192.168.112.1

# run_my_perl_prog (HOSTX change to 172.xxxxx)

# set | grep HOSTX
HOSTX=172.xxxxx


Tanks in advance,

Nuno




------------------------------

Date: Mon, 21 May 2001 17:27:15 +0200
From: Christoph Neubauer <christoph.neubauer@siemens.at>
Subject: Re: Environment
Message-Id: <3B0933D3.FD62F09C@siemens.at>



Nuno wrote:

> Hello all,
>
> How can i set an environment variable from perl like:
>
> # export HOSTX=192.168.112.1
>
> # run_my_perl_prog (HOSTX change to 172.xxxxx)
>
> # set | grep HOSTX
> HOSTX=172.xxxxx
>
> Tanks in advance,
>
> Nuno

See:
http://www.perl.com/pub/doc/manual/html/pod/perlfaq8.html#I_changed_directory_modified_m

Sorry,
Chris




------------------------------

Date: 21 May 2001 17:45:07 +0100
From: nobull@mail.com
Subject: Re: environment
Message-Id: <u98zjqbqi4.fsf@wcl-l.bham.ac.uk>

"Nuno" <nll@hotmail.com> writes:

[ snip FAQ ]

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?"

> Tanks in advance,

If you are going to do anything in advance, it should be read the FAQ.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

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 948
**************************************


home help back first fref pref prev next nref lref last post