[16722] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4134 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 25 18:05:36 2000

Date: Fri, 25 Aug 2000 15:05:17 -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: <967241117-v9-i4134@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 25 Aug 2000     Volume: 9 Number: 4134

Today's topics:
    Re: A Proposal for BaseLib module <mthurn@tasc.com>
    Re: A Proposal for BaseLib module (Malcolm Dew-Jones)
    Re: A Proposal for BaseLib module (Hasanuddin Tamir)
        alt in img tags <samay1NOsaSPAM@hotmail.com.invalid>
    Re: Beginner/intermediate programmer looking to volunte <jboes@eomonitor.com>
        CGI script for formatting Email ssipult@my-deja.com
    Re: Flipflop matching philhibbs@my-deja.com
    Re: Flipflop matching <elephant@squirrelgroup.com>
    Re: Generalized "User Database"? <mkruse@netexpress.net>
        Help Calling Functions houseofpain@my-deja.com
    Re: Help Calling Functions (Greg Bacon)
    Re: Help Calling Functions houseofpain@my-deja.com
    Re: help with simple regexp - does my head in <ren.maddox@tivoli.com>
        HELP! environment variables and rexec worc99@my-deja.com
    Re: Just another silly post. <madings@baladi.bmrb.wisc.edu>
        Memory leak with embeding perl shane_adams@my-deja.com
        Newbie - Errors causing download of file! scottfreez@my-deja.com
    Re: Newbie - Escaping special chars in forms scottfreez@my-deja.com
    Re: OT: Programming Ethics (Tim Hammerquist)
        Parsing a Excell table - or - a "Tab New_Line" text fil <info@digitaltango.com>
    Re: Parsing a Excell table - or - a "Tab New_Line" text <jeff@vpservices.com>
    Re: PLEASE HELP !!! What is wrong with Windows... <tim@ipac.caltech.edu>
    Re: Preserving HTML entities when HTML:: parsed <ianm@nofusswebsites.com>
        Problem migrating NT Perl Svc to NT2K jgrinwal@my-deja.com
    Re: RegEx (Jakob Schmidt)
        regexp and accentuated letters <stephane.bausson@free.fr>
        Remote Search Engine <wiburton@yahoo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 25 Aug 2000 14:20:58 -0400
From: Kingpin <mthurn@tasc.com>
Subject: Re: A Proposal for BaseLib module
Message-Id: <euu2c9w6b9.fsf@copper.dulles.tasc.com>


I think the problem with this thread is that the OP never explained
his problem clearly.  (Not even in the pod of the module he ended up
writing!)  Is this what you're talking about?:

No matter where the program code is run from, it needs to SEARCH
UPWARDS IN THE DIRECTORY TREE for a particular dirname (mail2sms or
whatever) and `use lib` that dir, and `use lib` a particular subdir
(libdir) of that dir.

And since this is such a weird/nonstandard way of doing things, none
of the followuppers could comprehend what he was trying to do!?!
(Except me, the genious ;-)

-- 
 - - Martin "Kingpin" Thurn                    mthurn@tasc.com
     Research Software Engineer           (703) 793-3700 x2651
     The Information Refinery              http://tir.tasc.com
     TASC, Inc.                            http://www.tasc.com

The Force is strong with this one! -- Vader, Star Wars


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

Date: 25 Aug 2000 12:18:18 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: A Proposal for BaseLib module
Message-Id: <39a6c67a@news.victoria.tc.ca>

Kingpin (mthurn@tasc.com) wrote:

: I think the problem with this thread is that the OP never explained
: his problem clearly.  (Not even in the pod of the module he ended up
: writing!)  Is this what you're talking about?:

: No matter where the program code is run from, it needs to SEARCH
: UPWARDS IN THE DIRECTORY TREE for a particular dirname (mail2sms or
: whatever) and `use lib` that dir, and `use lib` a particular subdir
: (libdir) of that dir.

: And since this is such a weird/nonstandard way of doing things, none
: of the followuppers could comprehend what he was trying to do!?!
: (Except me, the genious ;-)

Well I like to think I did understand, I simply questioned why he did not
use any other techniques, some of which would require him to layout his
application differently. 

Certainly, my two key criteria are to be able to promote code through
development phases without altering it, and be able to use the same module
with different configurations based on some factor in the "environment". 

Any simple to use and easy to comprehend system that handles one or the
other (or both) of the above is welcome, no matter how "weird" or
"nonstandard" it may be.



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

Date: Sat, 26 Aug 2000 11:21:12 GMT
From: hasant@trabas.co.id (Hasanuddin Tamir)
Subject: Re: A Proposal for BaseLib module
Message-Id: <slrn8qdmj0.oao.hasant@borg.intern.trabas.co.id>

On 25 Aug 2000 14:20:58 -0400, mthurn@tasc.com wrote:
## 
## I think the problem with this thread is that the OP never explained
## his problem clearly.  (Not even in the pod of the module he ended up
## writing!)

Well, you may be right. A friend has pointed the same problem.

##            Is this what you're talking about?:
## No matter where the program code is run from, it needs to SEARCH
## UPWARDS IN THE DIRECTORY TREE for a particular dirname (mail2sms or
## whatever) and `use lib` that dir, and `use lib` a particular subdir
## (libdir) of that dir.

Very close :-) I think you just pointed out one of the important
keys I've missed all this time: searching upwards in the directory
tree up to the base directory (e.g.  mail2sms). From this point,
it will be easy to find a particular directory contains private
modules since the name is known already, in this case: libdir.

But I can't use `use lib LIST;' in BaseLib since it will defeat
the previous steps. Instead, I simply unshift the full path to
libdir to @INC manually. So, in your words, I do,

    use lib '/full/path/to/mail2sms/libdir';

but not,

    use lib '/full/path/to/mail2sms';

The script provides the base and lib directories, BaseLib
takes care the rest.

Let's take a look at the implementation a bit. Please consider
the following picture (if we may call it so.)

      -.-    [/ROOTDIR] <--+ C         -.-
       |     `--+          |     B      | D
       |        `-[/BASEDIR] <---+      |
       |          `-+            |      |
       |            `-[/LIBDIR]  |     -.-
     A |            |            |
      -.-           `-[/SCRIPTDIR]
                      |
                      `--[/SCRIPT.pl]

SCRIPT.pl passes in what to look for (BASEDIR and LIBDIR)
to BaseLib. If any or both of arguments missing, BaseLib
will assume `appl_root' and `lib' respectively. So,

    use BaseLib qw(BASEDIR LIBDIR);

will instruct BaseLib to do its job, which is,

1. Borrowing the full path to SCRIPTDIR (line A) from the
   standard FindBin module.
2. Searching upward up to BASEDIR (B), preserving full
   path to it starting from ROOTDIR (C), and forgetting
   the rest.
3. Now that the path is found, the next is down-searching
   to find LIBDIR (D), constructing the path lib, and put
   it in @INC.

It's that simple, IMHO.


## And since this is such a weird/nonstandard way of doing things, none
## of the followuppers could comprehend what he was trying to do!?!
## (Except me, the genious ;-)
## 

So what do you think about the implementation above?
Do you have another solution? Would you like to share
it to the rest of us? :-)

Thank you very much.

Best regards,
san
-- 
trabasLabs * hasant@trabas.com * http://www.trabas.com
Zero Point * hasant@zp.f2s.com * http://www.zp.f2s.com


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

Date: Fri, 25 Aug 2000 11:43:38 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: alt in img tags
Message-Id: <0b3ce54b.954ef741@usw-ex0108-061.remarq.com>

I am looking for utility to check alt value in img tag of
an html page. please point me to correct module if you can.
 Thank you
Samay



* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


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

Date: Fri, 25 Aug 2000 16:43:30 -0400
From: Jeff Boes <jboes@eomonitor.com>
Subject: Re: Beginner/intermediate programmer looking to volunteer...
Message-Id: <39a6dbf9$0$62626$44ae8f91@news.net-link.net>

Drew Simonis wrote:
> 
> It is, but if you had spent any time posting to any usenet group
> in the past, you'd have already known that.  Please post in a
> group with *jobs* in the title.  This is a technical discussion
> group, not a want ads section.

Not that I'm trying to start a fight here... lord knows I had my share
of off-topic posters, back when I was actively trying to turn
alt.comp.perlcgi.freelance into something other than 'just another Perl
language support group'.

However: what's off-topic here? Clearly,

  "I need a Perl programmer"

is off-topic.

  "Where do I find Perl programmers"

is nearly as far off. But what the OP was asking was akin to

  "How do I further my career as a Perl programmer"

Where *would* someone go to ask that? The .jobs newsgroups are full of
posters who are employers/recruiters, and lurkers who are looking for
work. This question is not likely to get much attention there, as
neither group is the audience the OP wants to talk with.

I don't find the OP off-topic for .misc, but I'm probably in the
minority. I've seen posts here that are non-technical (being more in the
nature of Perl advocacy, which certainly has as little to do with the
language as 'how to build your Perl skills').


-- 
Jeff Boes                                 EoExchange, Inc.
Sr. Software Engineer                  (616) 381-9889 x.18
Search. Monitor. Notify.              jboes@eoexchange.com
Aeneid is now EoExchange.        http://www.eoexchange.com


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

Date: Fri, 25 Aug 2000 21:22:43 GMT
From: ssipult@my-deja.com
Subject: CGI script for formatting Email
Message-Id: <8o6o2f$k9o$1@nnrp1.deja.com>

I am looking for a good simple script for
formatting an email into HTML, that is easily
customizable for form mail. Any suggestions?


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 18:04:07 GMT
From: philhibbs@my-deja.com
Subject: Re: Flipflop matching
Message-Id: <8o6ce6$60r$1@nnrp1.deja.com>

In article <MPG.140f97c5481009d99896e2@localhost>,
  jason <elephant@squirrelgroup.com> wrote:
> just one small question (although this thread is certainly exhausted
> by now) .. what about perldoc isn't much use on Win95 ?
>   perldoc perlop
> works perfectly well

The "more" isn't much use, not as nice as unix, and nowhere near as nice
as "less", that man uses on some systems.

Phil.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 18:55:33 GMT
From: jason <elephant@squirrelgroup.com>
Subject: Re: Flipflop matching
Message-Id: <MPG.14115e9d4f21b3569896f4@localhost>

philhibbs@my-deja.com <philhibbs@my-deja.com> wrote ..
>In article <MPG.140f97c5481009d99896e2@localhost>,
>  jason <elephant@squirrelgroup.com> wrote:
>> just one small question (although this thread is certainly exhausted
>> by now) .. what about perldoc isn't much use on Win95 ?
>>   perldoc perlop
>> works perfectly well
>
>The "more" isn't much use, not as nice as unix, and nowhere near as nice
>as "less", that man uses on some systems.

right .. that's what I thought .. nothing to do with perldoc itself .. 
you're complaining about the pager that you've got installed on your 
system

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Fri, 25 Aug 2000 13:32:38 -0500
From: "Matt Kruse" <mkruse@netexpress.net>
Subject: Re: Generalized "User Database"?
Message-Id: <39a6bb6a$0$1413@wodc7nh0.news.uu.net>

Nobody <nobody@contract.East.Sun.COM> wrote
> Isn't this something that LDAP can handle?

Yes, but then it's not stored in a flat-file and requires additional
dependencies.

The benefit of a flat-file "database" with no external required modules is
that you can use it in any script, anywhere, and it will work. You don't
have to depend on any certain environment.

--
Matt Kruse
http://www.mattkruse.com/






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

Date: Fri, 25 Aug 2000 19:47:43 GMT
From: houseofpain@my-deja.com
Subject: Help Calling Functions
Message-Id: <8o6ign$dem$1@nnrp1.deja.com>

I want to call a function of a parent class via the $this-> pointer.
The problem lies in the fact that the function is stored in a variable.
For example:

 my $function = foo;

I would like to say  $this->$function;

I know you can say &{function} to call that function but how do I call
a function in a parent class unsing the $this-> pointer.

Thanks for your help,
Josh


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 20:33:25 GMT
From: gbacon@HiWAAY.net (Greg Bacon)
Subject: Re: Help Calling Functions
Message-Id: <sqdm0lft9184@corp.supernews.com>

In article <8o6ign$dem$1@nnrp1.deja.com>,
     <houseofpain@my-deja.com> wrote:

: I want to call a function of a parent class via the $this-> pointer.
: The problem lies in the fact that the function is stored in a variable.

    my $function = 'foo';
    my $method   = "SUPER::$function";

    $this->$method();

Greg
-- 
guru, n.:
        A person in T-shirt and sandals who took an elevator ride with
        a senior vice-president and is ultimately responsible for the
        phone call you are about to receive from your boss.


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

Date: Fri, 25 Aug 2000 21:40:52 GMT
From: houseofpain@my-deja.com
Subject: Re: Help Calling Functions
Message-Id: <8o6p51$lea$1@nnrp1.deja.com>

GREG:

I don't think that exactly works because i wan't perl to work its way
up the inheritence tree looking for the function.  I think that trys
the parent right away.  Is that correct?


Josh


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 25 Aug 2000 10:03:29 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: help with simple regexp - does my head in
Message-Id: <m3lmxl5qny.fsf@dhcp11-177.support.tivoli.com>

mgjv@verbruggen.comdyn.com.au (Martien Verbruggen) writes:

> I think it's related to the old adagio[1] 'premature optimisation is
> the root of all evil'. Unless you know for certain that a particular
> bit of code significantly contributes in the running time of your
> application, you shouldn't even be looking at it. If you have code
> that takes about 1% of the total runtime of your application, you
> shouldn't consider optimising it[2].

Certainly.  But that really only applies to examining a specific
application.  I was more interested in the general technique and what
the associated cost was.  And the final answer was that the cost was
minimal or even non-existent depending on context, so use whichever
floats your boat.

> Martien
> 
> [1] Knuth, if I'm not mistaken
> 
> [2] Of course, if that particular piece of code is the only one that
> is interactive, and people have to wait for it, that's another story.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Fri, 25 Aug 2000 18:53:27 GMT
From: worc99@my-deja.com
Subject: HELP! environment variables and rexec
Message-Id: <8o6fas$9f9$1@nnrp1.deja.com>

We are trying to "rexec" a perl script on a remote unix system. This
script calls a binary using the system() function.  However, we get
back errors from the binary saying that the necessary environment
variables are not set.  We have tried defining the variables within the
script as follows:

$ENV{"WHATEVER"} = "/xxxxx/whatever";
$ENV{"PATH"} = $ENV{"PATH"} . ":/pathineed";

and then calling system ("binarywhatever arg arg arg");

We have also tried doing a
system ("WHATEVER=/xxxxx/whatever EXPORT WHATEVER .... binarywhatever
arg arg arg");

Defining the variables in the .profile is not an option as they are not
passed by rexec.

What am I doing wrong?

Any help on this would be greatly appreciated.

Thanks,

Jon


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 25 Aug 2000 20:28:56 GMT
From: Steve Mading <madings@baladi.bmrb.wisc.edu>
Subject: Re: Just another silly post.
Message-Id: <8o6ku8$nfi$1@news.doit.wisc.edu>

Policy Man <reljr_2@yahoo.com> wrote:

: You of course would fail the single requirement of 'Don't try to be cute'.

The requirement "don't be cute" is incompatable with the other
requirements given, like "only one semicolon".  This contest is
designed to have to make the code use cute tricks.

: So far all I've seen is a juvenile attempt to avoid solving the actual problem.

There is no actual problem.  The "actual" solution is to use find.
This is obviously a "play with the tricks of the language" kind of
contest.  Not that there's anything wrong with that - it can be fun.
Just don't get all haughty about others being "juvenile" in their
solutions.  The contest itself is rather juvenile.  It reminds me
of a similar problem I did back in college.  It was a contest to
code a particular type of 'sort' (I forget which one) in Ansi C,
using nothing more than <stdio.h>, and make it work with the least
number of semicolons.  (That was how they were measuring the
number of statements.)  I did it in zero semicolons, by noticing
that for any chunk of code like so:

      stmt1;
      stmt2;
      stmt3;

I could just replace that with this construct and have no semicolons:

     if( stmt1 ) {}
     if( stmt2 ) {}
     if( stmt3 ) {}

Then I was free to code it with a textbook solution.  They threw it
out as being "not in the spirit of the contest", but I thought it
was perfectly in the spirit of the contest.  It was a contest that
was *asking* you to use tricks like that.  It's what they wanted.  The
fact that I had a solution that was trivial pissed them off.



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

Date: Fri, 25 Aug 2000 19:55:55 GMT
From: shane_adams@my-deja.com
Subject: Memory leak with embeding perl
Message-Id: <8o6ivv$e4t$1@nnrp1.deja.com>

Hello - I'm trying to understand the following problem.  I've created a
perl interpreter in a simple C program.  The C program calls and
executes a very simply perl script.  The problem is the thing leaks
memory.  Attached are the files and method of compilation:

/* C program */
#include <stdlib.h>
#include <EXTERN.h>
#include <perl.h>

static PerlInterpreter *my_perl = NULL;

void init_perl() {
  char *foo[2] = { NULL, "./test.pl" };
  my_perl = perl_alloc();
  perl_construct(my_perl);
  perl_parse(my_perl, NULL, 2, foo, (char **)NULL);
}

static void call_perl_script( )  {
  dSP;
  ENTER;
  SAVETMPS;
  PUSHMARK(SP);
  PUTBACK;
  perl_call_pv("handler", G_EVAL| G_SCALAR );
  SPAGAIN;
  PUTBACK;
  FREETMPS;
  LEAVE;
}

int main(int argc, char **argv, char **env)  {
  int l=0;
  int c=0;

  init_perl();
  for(l=0;l<10000000; l++ )  {
    call_perl_script();
  }
}

# test.pl
sub handler  {
  # See - it's simple
}

Compile it

gcc -g -o perltest perltest.c `perl -MExtUtils::Embed -e ccopts -e
ldopts`

 ./perltest  (watch process size grow via top)

Now I've read through the perlembed man page, so I hope I'm doing the
actual call to 'handler' correctly in call_perl_script.  What is really
strange is that I dropped in some code the the loop in main() that
free'd the interpreter and reallocated it every 100 times.  The program
actually leaks MORE when I do this.

Oh ya I'm using perl 5.6.0 i686-linux (Redhat 6.1)

Regards,
  Shane Adams



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 19:58:55 GMT
From: scottfreez@my-deja.com
Subject: Newbie - Errors causing download of file!
Message-Id: <8o6j5i$e6v$1@nnrp1.deja.com>

I'm working on a perl app which acts as a middelman between a bunch of
tables and asp pages.

The problem is this - sometimes when there is an error in the page,
instead of dieing or displaying a message, the .pl file "conveniently"
offers to download itself directly to my computer!! This is NOT good, as
any user would then be able to view the perl source code...

Does anyone know 1) WHY it is doing this, and 2) more importantly, how
to avoid it?

thanks
scottfreez


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 18:23:31 GMT
From: scottfreez@my-deja.com
Subject: Re: Newbie - Escaping special chars in forms
Message-Id: <8o6dia$7gk$1@nnrp1.deja.com>

Thanks!!

In article <8o1ukt$9r2k3$2@ID-24002.news.cis.dfn.de>,
  news@tinita.de wrote:
> hi,
> scottfreez@my-deja.com wrote:
>
> > In ASP I use server.urlEncode to encode special characters.
>
> > Does anyone know a similar function in Perl? I'm creating a form on
the
> > fly and submitting it to another page. Problems are arising when
there
> > are "&" characters in the form.
>
> use
> $value = CGI::escape($value);
>
> (not documented)
>
> tina
>
> --
> http://tinita.de    \  enter__| |__the___ _ _ ___
> tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
> search & add comments \    \__,_\___/\___/_| /__/ perception
> please don't email unless offtopic or followup is set. thanx
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 18:53:01 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: OT: Programming Ethics
Message-Id: <slrn8qdgpp.qg.tim@degree.ath.cx>

Martien Verbruggen <mgjv@verbruggen.comdyn.com.au> wrote:
> On Wed, 23 Aug 2000 19:39:33 GMT,
> 	Tim Hammerquist <tim@degree.ath.cx> wrote:
> > Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> > 
> > > Most products originating in Redmond are
> > > wrong.
> > 
> > What's with this "Most" business?  =)
> 
> Redmond must have more than one company, right? And even the largest
> company there has acquired products recently enough not to have been
> able to screw them up yet. :)

Granted. However, I had assumed that Redmond was a not-so-vague
reference to Microsoft, and thereafter considered it a synonym, at least
within this thread.

And I have been known to take my anit-M$ cause too far.  I (very)
briefly had second thoughts about Perl as my favorite language upon
reading an article on M$'s site where they gave Perl merit.  It's just
that, especially in the last few years, I've felt so consistently
opposite that of Uncle Bill that it's sometimes hard for me to admit we
might agree, him and I.

Contempt prior to (complete) investigation?  Oh well.  =)

-- 
-Tim Hammerquist <timmy@cpan.org>
To steal ideas from one person is plagiarism;
to steal from many is research.
	-- Unknown


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

Date: Fri, 25 Aug 2000 19:02:26 GMT
From: "Etienne Laverdiere" <info@digitaltango.com>
Subject: Parsing a Excell table - or - a "Tab New_Line" text file?
Message-Id: <6pzp5.18460$Si1.326577@news20.bellglobal.com>

Hi all,

I need to parse in a 2 dimentional array from an Excell document through a
Perl script that will isolate all the colonnes and the rows of this Excell
table.

I don't think I can extract it by parsing it in the ASCII format, it seems
very complicated.

But with a simple manipulation I can generate a plain TAB separated file
(with New_Line for each record and a TAB for each field).

Is there a Perl formula (with some RegEx maybe?) that could scan all this
Tab separated file and put all the value in a 2 dimentional array :
@array[x][y]?
I doubt that this can be very tricky to do.

In Mastering Regex (p. 290) I've found a formula that seems to work with a
Comma Separated File (CVS).

@fields = ();
push(@fields, $+) while $text =~ m{
        "([^"\\]*(?:\\.[^"\\]*)*)",?
    |    ([^,]+),?
    |    ,
}gx;
#add a final empty field if there's a trailing comma
push (@field, undef) if substr(text, -1, 1) eq ',';

One thing I know is that a TAB can be represente by a '\t' and a new_line by
a '\n'. Is this true in a Tab separated file?

I would like, finaly to access my ODBC database with each value, and build a
database table (I have already done that with DBI).

Where could I start to finish my work?

Best Regards



Etienne Laverdiere
Montreal




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

Date: Fri, 25 Aug 2000 12:47:07 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Parsing a Excell table - or - a "Tab New_Line" text file?
Message-Id: <39A6CD3B.39EEC799@vpservices.com>

Etienne Laverdiere wrote:
> 
> I need to parse in a 2 dimentional array from an Excell document through a
> Perl script that will isolate all the colonnes and the rows of this Excell
> table.
> ...
> I would like, finaly to access my ODBC database with each value, and build a
> database table (I have already done that with DBI).

Excel *is* an ODBC accessible database.  You don't need to take the
information out of Excel into something else and then put it back into
some other ODBC source, you just access the Excel spreadsheet just like
any other DBI database:

use DBI;
my $drv   = 'ODBC:driver=Microsoft Excel Driver (*.xls)';
my $dir   = $directory_where_spreadsheet_is_stored;
my $table = $name_of_spreadsheet; # e.g. 'test.xls'
my $dbh   = DBI->connect( "dbi:$drv;Dbq=$dir",,,{RaiseError=>1} )
            or die $DBI::errstr;
my $sth   = $dbh->prepare("SELECT * FROM $table");
# ... etc.

If you really want to go the route of exporting the Excel spreadsheet to
a tab delimited file and then putting that into an array, then use
DBD::RAM or DBD::CSV and the fetchall_arrayref method.

-- 
Jeff


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

Date: Fri, 25 Aug 2000 11:38:07 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: PLEASE HELP !!! What is wrong with Windows...
Message-Id: <39A6BD0F.FF117EB6@ipac.caltech.edu>

> Subject: Re: PLEASE HELP !!! What is wrong with Windows...

How many times have I asked myself that question?

--

-- Tim Conrow         tim@ipac.caltech.edu


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

Date: Fri, 25 Aug 2000 21:11:32 +0100
From: "Ian McDonald at No Fuss Websites.com" <ianm@nofusswebsites.com>
Subject: Re: Preserving HTML entities when HTML:: parsed
Message-Id: <39a6d2de@news.server.worldonline.co.uk>

It's just a front end for TreeBuilder. Will using HTML::Parser actually
solve the problem?

Or is it simply a prerequesite for asking for help?

(Comparable to 'first get the latest version, then we'll offer tech
support',
which is actually pretty standard.)

--
Dr. Ian McDonald
Web Site Developer
No Fuss Websites.com
T: +44 (0) 20 761 32110  F: +44 (0) 20 769 25461
E: ianm@nofusswebsites.com W: www.nofusswebsites.com
jason <elephant@squirrelgroup.com> wrote in message
news:MPG.14112d4020771ed39896f3@localhost...
> Ian McDonald at No Fuss Websites.com <ianm@nofusswebsites.com> wrote ..
> >This deletes the HTML entities;
> >
> >$tree = HTML::Parse::parse_html( $text );
> >$text = $tree->as_HTML;
> >
> >What can I do to preserve them?
>
> for a start - don't use a deprecated module (even if the doco calls it
> depreciated ;)
>
> --
>   jason -- elephant@squirrelgroup.com --




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

Date: Fri, 25 Aug 2000 21:01:57 GMT
From: jgrinwal@my-deja.com
Subject: Problem migrating NT Perl Svc to NT2K
Message-Id: <8o6mrp$iqt$1@nnrp1.deja.com>

I have a couple Perl scripts that run as services under ActiveState
Perl build 522 (I believe thats 5.005?) on NT 4.0 Servers w Service
Pack 6a.  I set these same services up on Windows 2000, and they no
longer work.  However, when I run them from a command prompt on the
Windows 2000 console, they DO work.  Here are the symptoms

1.  The services are set to run under a local Adminstrative account.

2.  The service starts.

3.  If the script is functioning correctly, I produce output to a log
    file.  This does not happen.

4.  I log into the console as the account used to run the service, and
execute the script from a command prompt.  The script functions
perfectly, and the log file is generated.

Any ideas on the problem and solution would be greatly appreciated.  I
have tried upgrading to the latest version of ActivePerl, without
success.

Rgds,

Jim Grinwald


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 25 Aug 2000 20:46:26 +0200
From: sumus@aut.dk (Jakob Schmidt)
Subject: Re: RegEx
Message-Id: <1efxtjp.s1v65fzb6f7aN@[192.168.88.117]>

<zejames@yahoo.fr> wrote:

> Ok. But then I don't really understand what greedy means: I thought the
> engine would take the last pattern that matches, and so take the fourth
> case.

No. In this case it means that .* vil eat as much as it can. That is
choose the longest possible match. With the two competing .*s, it's the
first one that gets its way.

Try the docs (perlre and perlop). Maybe even before you buy a book (not
that I'd discourage buying some books, but I would encourage reading the
docs even more :-)

-- 
Jakob


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

Date: Fri, 25 Aug 2000 19:10:52 GMT
From: =?iso-8859-1?Q?St=E9phane?= BAUSSON <stephane.bausson@free.fr>
Subject: regexp and accentuated letters
Message-Id: <39A6C4EF.B740AA71@free.fr>

Hello

I would like to know if it is possible in perl to grep a file with word
with accentuated letter but without giving accentuated word in the
regexp

Exemple: with pattern e, the result should be e, e acute accent, e grave
accent, et  ...

If you have any hint you can send me it by email, thank you.

--
 stephane.bausson@free.fr  -  Toulouse (France)





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

Date: Fri, 25 Aug 2000 18:04:32 -0400
From: "BB" <wiburton@yahoo.com>
Subject: Remote Search Engine
Message-Id: <H_Bp5.31436$Ok.23685@ralph.vnet.net>

I'm looking for a customizable search engine that will slurp all of the
search results from other search engines, pages 1 through N.

Tips, please?




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

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


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