[22940] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5160 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 1 06:05:50 2003

Date: Tue, 1 Jul 2003 03:05:10 -0700 (PDT)
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, 1 Jul 2003     Volume: 10 Number: 5160

Today's topics:
         Returning tables from PL/SQL function to DBI-perl scri <bigjojoi@hottot.com>
        Alle Leerzeichen duch nichts ersetzen im Array? (Math55)
    Re: Alle Leerzeichen duch nichts ersetzen im Array? <mailmueller@gmx.net>
    Re: Completely confused  - system and $? == -1 <persicom@acedsl.com>
    Re: doing 'ref' on blessed reference <mgjv@tradingpost.com.au>
    Re: doing 'ref' on blessed reference <mgjv@tradingpost.com.au>
    Re: doing 'ref' on blessed reference <woland99@earthlink.net>
    Re: doing 'ref' on blessed reference <mgjv@tradingpost.com.au>
    Re: doing 'ref' on blessed reference <no@spam.net>
    Re: doing 'ref' on blessed reference <mgjv@tradingpost.com.au>
    Re: doing 'ref' on blessed reference <mgjv@tradingpost.com.au>
    Re: doing 'ref' on blessed reference (Bryan Castillo)
    Re: doing 'ref' on blessed reference <ubl@schaffhausen.de>
    Re: Fast CGI Vs Java Application Servers (Paul Boddie)
    Re: Finding cycles and Graph::Base ctcgag@hotmail.com
    Re: How do you sort a 2D array with column headers? ctcgag@hotmail.com
    Re: How would you mail yourself from XP <wsegrave@mindspring.com>
    Re: How would you mail yourself from XP (Helgi Briem)
    Re: How would you mail yourself from XP (Helgi Briem)
    Re: Is there a good free/not so expensive Perl IDE for  <bernard.el-hagin@DODGE_THISlido-tech.net>
        looking for Win32::OLE examples (automating Lotus 123 a <woland99@earthlink.net>
    Re: looking for Win32::OLE examples (automating Lotus 1 (Bryan Castillo)
    Re: multiline thingy in hash makes it single line item  (Tad McClellan)
    Re: need a cheap JOIN on 3 large tables under Win32 (Bryan Castillo)
    Re: need a cheap JOIN on 3 large tables under Win32 <bigj@kamelfreund.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 1 Jul 2003 09:27:38 +0200
From: "bigjojoi" <bigjojoi@hottot.com>
Subject:  Returning tables from PL/SQL function to DBI-perl script 
Message-Id: <3f0137ea$0$22086$5402220f@news.sunrise.ch>


Hello,
My problem is that I've a PL/SQL procedure, returning a table of float. I'd
like to map the Oracle "TABLE OF FLOAT" to a perl array.

Any help in this matter would be highly appreciated.
Regards
George






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

Date: 1 Jul 2003 01:08:20 -0700
From: magelord@t-online.de (Math55)
Subject: Alle Leerzeichen duch nichts ersetzen im Array?
Message-Id: <a2b8188a.0307010008.2236494f@posting.google.com>

hallo, ist es mögöich, alle Leerzeichen in einem Arra durch nichts zu ersetzen?

DANKE:-)


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

Date: 1 Jul 2003 08:15:31 GMT
From: british <mailmueller@gmx.net>
Subject: Re: Alle Leerzeichen duch nichts ersetzen im Array?
Message-Id: <slrnbg2gp3.13v.mailmueller@nix.onb.ac.at>

In article <a2b8188a.0307010008.2236494f@posting.google.com>, Math55 wrote:
> hallo, ist es mögöich, alle Leerzeichen in einem Arra durch nichts zu ersetzen?

foreach (@array) {s/\s//g;}

lgg


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

Date: Tue, 01 Jul 2003 04:54:13 -0400
From: "Matthew O. Persico" <persicom@acedsl.com>
To: Steve Grazzini <s_grazzini@hotmail.com>
Subject: Re: Completely confused  - system and $? == -1
Message-Id: <3F014C35.6040403@acedsl.com>

Steve Grazzini wrote:
> Matthew O. Persico <persicom@acedsl.com> writes:
> 
>>Sometimes, I get -1 back from system or $? is -1 with 
>>the backticks. I am using perl 5.6.1 on Solaris 2.7. 
>>Does this imply that somehow, a shell is being called 
>>on my behalf even though the backticks have no shell 
>>characters and the system command uses the list form?
> 
> 
> Nope.
> 
> It means that, during the failed call, either fork(), exec()
> or waitpid() failed and you need to check $! instead.
> 
>     $ perldoc -f system
> 
> To be fair, it sounds like you've read at least the first
> paragraph already... just keep reading :-)
> 

Heh. I've read that a dozen times in the past three years in addition to 
  dog-earing the relevent sections of the Camel and the Cookbook. I've 
even written a module that wraps system() with output marshalling and 
alarm timeouting. You'd THINK that I'd have spotted that bit about $!. 
Sheesh!

Well, that's why we post. Sometimes all you need is someone outside your 
fishbowl...

Thanks
--
Matt



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

Date: 01 Jul 2003 04:05:31 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <slrnbg224d.3er.mgjv@verbruggen.comdyn.com.au>

On Tue, 01 Jul 2003 02:01:48 GMT,
	JT <woland99@earthlink.net> wrote:
> If we do 'ref' on blessed reference it return string that is the name of 
> the class
> but how can I know if this was a hash, array or sth else? Is there a way to
> return ARRAY, HASH or SCALAR for blessed reference?

First of all: Why do you think you need to know? One of the main
advantages of OO programming is the encapsulation of the
implementationof the object, internally. Outside the class, or one of
its subclasses, you should not care what the implementation is.
Whenever you find yourself wondering whether you should know something
about the internal implementation of a class, you should think really
hard about whether you should be asking a different question.


To answer your question: A blessed reference "inherits" the ARRAY or
HASH or SCALAR "class"[1]. In other words, UNIVERSAL::isa will return
true.

The reference in a string context becomes something like:

Class=ARRAY(0x80f562c)

Where the middle bit gives you the answer you're looking for.

#!/usr/local/bin/perl
use strict;
use warnings;

package Grub;

sub new { bless [], $_[0] }

package main;

my $grub = Grub->new;

print "1 is array\n" if $grub->isa("ARRAY");
print "2 is array\n" if UNIVERSAL::isa($grub, "ARRAY");
print "3 is array\n" if $grub =~ /=ARRAY\(/;


The first two will give false positives (if you really are interested
in the underlying implementation) for a class like this:

package ARRAY;
sub new { bless {}, $_[0] }

The third one will always be correct, until perl decides to stringify
blessed references in a different manner (unlikely).

Martien

[1] The quotation marks are there, because that is not what goes on in
reality at all, but it looks like it from UNIVERSAL::isa point of
view. There is no such thing as a HASH class, until you create one.
-- 
                        | 
Martien Verbruggen      | Useful Statistic: 75% of the people make up
Trading Post Australia  | 3/4 of the population.
                        | 


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

Date: 01 Jul 2003 04:10:42 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <slrnbg22e4.3er.mgjv@verbruggen.comdyn.com.au>

On Tue, 01 Jul 2003 03:21:22 GMT,
	Bob Walton <bwalton@rochester.rr.com> wrote:
> JT wrote:
> 
>> If we do 'ref' on blessed reference it return string that is the name of 
>> the class
>> but how can I know if this was a hash, array or sth else? Is there a way to
>> return ARRAY, HASH or SCALAR for blessed reference?
> ...
>> JT
>> 
> 
> You should use UNIVERSAL::isa on your reference.

package ARRAY;
sub new { bless {}, $_[0] }

package main;
my $array = ARRAY->new;
print "Implemented as array?\n" if $array->isa("ARRAY");
print "Implemented as hash?\n"  if $array->isa("HASH");


One could argue about the sanity of a programmer calling a class
ARRAY, but Perl allows it.

>                                                   See:
> 
>     perldoc -f ref

Hmmm.. Looks like perlfunc makes assumptions about programmer sanity
as well.

Martien
-- 
                        | 
Martien Verbruggen      | If it isn't broken, it doesn't have enough
Trading Post Australia  | features yet.
                        | 


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

Date: Tue, 01 Jul 2003 04:13:17 GMT
From: JT <woland99@earthlink.net>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <3F01B301.2010607@earthlink.net>



Martien Verbruggen wrote:

>On Tue, 01 Jul 2003 02:01:48 GMT,
>	JT <woland99@earthlink.net> wrote:
>  
>
>>If we do 'ref' on blessed reference it return string that is the name of 
>>the class
>>but how can I know if this was a hash, array or sth else? Is there a way to
>>return ARRAY, HASH or SCALAR for blessed reference?
>>    
>>
>
>First of all: Why do you think you need to know?
>
Pure laziness - I wanted to debug the output of some method in LWP 
package and was
too lazy to check the complete definition of the method or use some 
data-dumper module.

I see your point though - objectwise we should not care about what is 
inside.

>To answer your question: A blessed reference "inherits" the ARRAY or
>HASH or SCALAR "class"[1]. In other words, UNIVERSAL::isa will return
>true.
>  
>
Thanks for the answer - and all other answer to this question - I 
obviously forgot about the UNIVERSAL class.

Cheers,

JT



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

Date: 01 Jul 2003 04:12:40 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <slrnbg22hq.3er.mgjv@verbruggen.comdyn.com.au>

On Tue, 01 Jul 2003 03:48:14 GMT,
	Jay Tilton <tiltonj@erols.com> wrote:
> JT <woland99@earthlink.net> wrote:
> 
>: If we do 'ref' on blessed reference it return string that is the name of 
>: the class
> 
> You may find Scalar::Util::blessed() more useful for that.

Why?

>: but how can I know if this was a hash, array or sth else? Is there a way to
>: return ARRAY, HASH or SCALAR for blessed reference?
> 
> Scalar::Util::reftype() is just the thing.

Didn't know about that one. Useful when you think you need to know.

Martien
-- 
                        | 
Martien Verbruggen      | 
Trading Post Australia  | The gene pool could use a little chlorine.
                        | 


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

Date: Mon, 30 Jun 2003 23:36:08 -0700
From: "Michael" <no@spam.net>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <AX9Ma.844$bj7.75544@news.uswest.net>

Is this a joke? Obviously, it doesn't answer the question and seems a bit
sarcastic...

-- 
- JMM
"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
news:slrnbg22e4.3er.mgjv@verbruggen.comdyn.com.au...
> On Tue, 01 Jul 2003 03:21:22 GMT,
> Bob Walton <bwalton@rochester.rr.com> wrote:
> > JT wrote:
> >
> >> If we do 'ref' on blessed reference it return string that is the name
of
> >> the class
> >> but how can I know if this was a hash, array or sth else? Is there a
way to
> >> return ARRAY, HASH or SCALAR for blessed reference?
> > ...
> >> JT
> >>
> >
> > You should use UNIVERSAL::isa on your reference.
>
> package ARRAY;
> sub new { bless {}, $_[0] }
>
> package main;
> my $array = ARRAY->new;
> print "Implemented as array?\n" if $array->isa("ARRAY");
> print "Implemented as hash?\n"  if $array->isa("HASH");
>
>
> One could argue about the sanity of a programmer calling a class
> ARRAY, but Perl allows it.
>
> >                                                   See:
> >
> >     perldoc -f ref
>
> Hmmm.. Looks like perlfunc makes assumptions about programmer sanity
> as well.
>
> Martien
> -- 
>                         |
> Martien Verbruggen      | If it isn't broken, it doesn't have enough
> Trading Post Australia  | features yet.
>                         |




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

Date: 01 Jul 2003 07:02:43 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <slrnbg2cgm.3er.mgjv@verbruggen.comdyn.com.au>

Please, in the future, put your reply _after_ the suitably trimmed
text. Also, don't quote text after your signature. Decent newsreading
software will automatically remove signatures, which means that the
old text is no longer included in the thread.

On Mon, 30 Jun 2003 23:36:08 -0700,
	Michael <no@spam.net> wrote:
> Is this a joke? Obviously, it doesn't answer the question and seems a bit
> sarcastic...

No. it is not a joke. As far as I know, it answers the question. I
interpreted the OP's question how they could find out what the
underlying data structure was for a blessed object. My post answered
that question.

In which way do you think my post missed the point?

Martien
-- 
                        | 
Martien Verbruggen      | My friend has a baby. I'm writing down all
Trading Post Australia  | the noises the baby makes so later I can ask
                        | him what he meant - Steven Wright


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

Date: 01 Jul 2003 07:05:03 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <slrnbg2cl2.3er.mgjv@verbruggen.comdyn.com.au>

On Mon, 30 Jun 2003 23:36:08 -0700,
	Michael <no@spam.net> wrote:
> Is this a joke? Obviously, it doesn't answer the question and seems a bit
> sarcastic...

Ah. You were actually responding to my other post in the same thread.
See what happens if you don't quote articles correctly?

Read my post again. Then read the answer it followed up to. Did you
try to run the code? Did you see the result? Do you now understand why
I posted?

Martien
-- 
                        | 
Martien Verbruggen      | 
Trading Post Australia  | 42.6% of statistics is made up on the spot.
                        | 


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

Date: 1 Jul 2003 01:48:51 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: doing 'ref' on blessed reference
Message-Id: <1bff1830.0307010048.28a2bef2@posting.google.com>

JT <woland99@earthlink.net> wrote in message news:<3F019435.50308@earthlink.net>...
> If we do 'ref' on blessed reference it return string that is the name of 
> the class
> but how can I know if this was a hash, array or sth else? Is there a way to

my $t = [];
bless $t, 'foo';
print "It's an array referenct\n" if (UNIVERSAL::isa($t, "ARRAY"));

> return ARRAY, HASH or SCALAR for blessed reference?
> 
> Thanks,
> 
> JT


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

Date: Tue, 01 Jul 2003 11:18:06 +0200
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: doing 'ref' on blessed reference
Message-Id: <bdrmom$foi$1@news.dtag.de>

JT wrote:

> If we do 'ref' on blessed reference it return string that is the name of 
> the class
> but how can I know if this was a hash, array or sth else? Is there a way to
> return ARRAY, HASH or SCALAR for blessed reference?

Scalar::Util is your friend.

If you for some reason can't access the module, than you could still use 
the evil trick:

eval {
	%{$ref}
};
if($@) {
	warn '$ref doesnt seem to be a hash reference'
} else {
	warn '$ref is either a hash reference or an object that overloaded the 
hash dereferencing operation'
}

bye
malte




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

Date: 1 Jul 2003 02:11:27 -0700
From: paul@boddie.net (Paul Boddie)
Subject: Re: Fast CGI Vs Java Application Servers
Message-Id: <23891c90.0307010111.43fd3c43@posting.google.com>

ctcgag@hotmail.com wrote in message news:<20030630120924.209$qh@newsreader.com>...
> Charles Handy <chppxf1@NOSPAM_yahoo.com.au> wrote:
> > How does FastCGI compare against java Apps running in java app servers
> > like TomCat, Sun One, WebLogic and WebSphere?  Is there a business case
> > for switching from CGI to Java?
> 
> Do you want there to be one?

I think that other contributors to this thread have given interesting
"recruitment cases" for introducing Java (the usual stuff about Java
being a standard and there being lots of "Java people" in the job
market), but then FastCGI/CGI is a very vague term. Is the application
in question written in C or C++ (insane as that may seem to developers
using more modern languages)? Is the person who posted the question
still reading this thread? ;-)

One might well argue that a switch from C/C++ to Java might be a
worthwhile investment, given the benefits of Java over those
languages, but a switch from Tcl, Perl or Python to Java needs to be
more rigourously justified in my opinion.

> > Performance?
> 
> I've seen dozens of features that were implemented in CGI (not mod_perl
> or FastCGI) rewritten to run on a java app server on a beefier machine.
> None of them were noticably faster, and many were slower.

In various respects, I also believe this to be true. However, there
was an interesting case a few months ago where the scalability of Zope
was compared with WebSphere on some serious hardware. The outcome
(which highlighted certain issues with Zope's threaded execution
model, at least in the way it was employed in that particular case)
doesn't reduce the relevance of other solutions available for Tcl,
Perl and Python. Indeed, in Python solutions there are various
different execution models on offer:

  http://www.python.org/cgi-bin/moinmoin/WebProgramming

Contrast Twisted, mod_python, Webware and SkunkWeb.

> > Productivity?
> 
> I'm about 5x less productive in Java.

Indeed. But in the development of a Web application, one also has to
consider how productive different members of the extended team are,
too. That can have a lot more to do with the chosen technologies
deployed on top of the programming language and application server in
question.

[...]

> > Code Reuse?
> 
> Switching a working application to a new language is about the
> greatest possible crime there is against code reuse.

"We believe in code reuse. Apart from the system we just threw away,
of course."

Paul


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

Date: 01 Jul 2003 05:24:48 GMT
From: ctcgag@hotmail.com
Subject: Re: Finding cycles and Graph::Base
Message-Id: <20030701012448.840$f1@newsreader.com>

ctcgag@hotmail.com wrote:
> William Goedicke <goedicke@goedsole.com> wrote:
> > Dear Y'all -
> >
> > Has anybody come up with a way of finding cycles in graphs created
> > with Graph::Base?
>
> I don't know Graph::Base specifically, but an easy way to find
> cycles, if performance isn't a huge concern, is:

Maybe I should clarify, the below-used subs are just names I made
up to describe the necessary funtionality, not actually existing subs
in any package I know of (and is_path() would have been better called
are_connected()).  Although I suspect all of the functionality
would be available in some way or another through Graph::Base.

>
> foreach $e (edge()) {
>   my ($v1,$v2)=get_vertices($e);
>   delete($e);
>   if (is_path($v1,$v2))  {
>      restore($e);
>      edge_is_in_cycle($e);
>   }
>   else {
>     restore($e);
>   };
> };

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

Date: 01 Jul 2003 05:46:40 GMT
From: ctcgag@hotmail.com
Subject: Re: How do you sort a 2D array with column headers?
Message-Id: <20030701014640.594$9R@newsreader.com>

Greg Bacon <gbacon@hiwaay.net> wrote:
>
> : > 2. The upper bound of a C-style 'for' loop, as
> : >
> : >         for ($i=0; $i <= $#array; $i++) {
> : >           do something with $array[$i];
> : >         }
> :
> : I use this very frequently when I have parallel arrays.  Of course,
> : that might not exactly fit in your criteria for inclusion in this
> : category.  I also use this when I want to change the length of @array
> : during the loop.
>
> When I find myself constructing parallel arrays, I almost always merge
> them into arrays of either hashes or arrays.

I do that sometimes, but I tend to not do it as much as I could for three
reasons.  $age[$id] and $sex[$id] take up much, much less room than
$person[$id]{age} and $person[$id]{sex} if there are a lot of entries.  The
first way gives me compile time errors if I fat-finger "age" or "sex".
With the first I can easily pass one compartment to general functions
without using map: median(\@age) rather than
median([map $_->{age}, @person]).   Of course, the converse is that the
parallel structure makes it harder to pass the whole structure around, but
if I have to do much of that I tend to encompass it into a class anyway.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service              New Rate! $9.95/Month 50GB


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

Date: Mon, 30 Jun 2003 23:07:03 -0500
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: How would you mail yourself from XP
Message-Id: <bdr1ou$mla$1@slb0.atl.mindspring.net>

"William Alexander Segraves" <wsegrave@mindspring.com> wrote in message
news:bdr0bo$ii7$1@slb3.atl.mindspring.net...
<snip>
> If your curiosity overwhelms you, look inside of Mime::Lite to see how it
> sends mail for non-UNIX systems. Hint: Perl module Net::SMTP.

See also Mail::Mailer and Mail::Send.

Cheers.

Bill Segraves





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

Date: Tue, 01 Jul 2003 09:54:55 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: How would you mail yourself from XP
Message-Id: <3f015a55.693654218@news.cis.dfn.de>

On Mon, 30 Jun 2003 14:45:40 -0700, "zoo" <mee@home.com> wrote:

>I use this piece of code to mail myself but my operating system 
>can't find the mail command.
>How would I make this command work with windows XP ?
>
>open MAIL, "|mail zoo@/hotmail.com";
> print MAIL "bad news: $somename guessed $someguess\n";
> close MAIL;
>
>
>'mail' is not recognized as an internal or external command,
>operable program or batch file.

Install a mailing program.  


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

Date: Tue, 01 Jul 2003 10:04:01 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: How would you mail yourself from XP
Message-Id: <3f015a97.693720203@news.cis.dfn.de>

On Mon, 30 Jun 2003 14:45:40 -0700, "zoo" <mee@home.com> wrote:

>I use this piece of code to mail myself but my operating system can't find
>the mail command.
>How would I make this command work with windows XP ?
>
>open MAIL, "|mail zoo@/hotmail.com";
> print MAIL "bad news: $somename guessed $someguess\n";
> close MAIL;
>
>
>'mail' is not recognized as an internal or external command,
>operable program or batch file.

I wouldn't use an external 'mail' program.

I would use an appropriate Perl module,
thus moving this on-topic for a Perl newsgroup.

I have had good results with MIME::Lite. Here's how 
you use it:

#!perl
use warnings;
use strict;
use MIME::Lite;

my ($sender,$recipent,$subject,$message,$mailserver) = 
qw/me you whatever hello mail.mydomain.com/;

    $msg = MIME::Lite->new(
                 From     => $sender,
                 To       => $recipient,
                 Subject  => $subject,
                 Type     =>'plain/text',
				 Data     => $message,
                 );
				 
$msg->send("smtp", $mailserver, Timeout=>10) or die $!;
__END__


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

Date: Tue, 1 Jul 2003 05:36:11 +0000 (UTC)
From: "Bernard El-Hagin" <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: Is there a good free/not so expensive Perl IDE for Linux
Message-Id: <Xns93AB4CED0CB4Eelhber1lidotechnet@62.89.127.66>

Abigail wrote:

> Tassilo v. Parseval (tassilo.parseval@rwth-aachen.de) wrote on MMMDXC
> September MCMXCIII in <URL:news:bdq502$7e8$1@nets3.rz.RWTH-Aachen.DE>:
> ^^  Also sprach Abigail:
> ^^  
> ^^ > Greg Bacon (gbacon@hiwaay.net) wrote on MMMDXC September MCMXCIII in
> ^^ ><URL:news:vg0j3194i0of36@corp.supernews.com>:
> ^^  
> ^^ >||  One.  Reading docs and other files can be done from within the
> ^^ >||  editor. :-)
> ^^ >||  
> ^^ >||      <esc>:!man perl
> ^^ > 
> ^^ > 
> ^^ > Oh, it can, but I want to see the documentation while typing.
> ^^  
> ^^ :split
> 
> 
> Then I don't see enough of the documentation. ;-)


:vsplit


;-)


-- 
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'



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

Date: Tue, 01 Jul 2003 05:47:10 GMT
From: JT <woland99@earthlink.net>
Subject: looking for Win32::OLE examples (automating Lotus 123 and Approach)
Message-Id: <3F01C903.5050109@earthlink.net>

Can sbdy point me to a good source of such examples - I need to export
a few spreadsheets from Lotus 1-2-3 as CSV files , connect to Approach,
import those files as tables, run few SQL queries and export results as
text files.
I read Win32::OLE examples pertaining to Access and Excel but it does not
seem that one can simply modify them to work with 1-2-3 and Approach.
I do not know anything about OLE in general - is there a good online source
that would be relevant to Lotus products and Win32::OLE.

Thanks,

JT



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

Date: 1 Jul 2003 02:35:19 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: looking for Win32::OLE examples (automating Lotus 123 and Approach)
Message-Id: <1bff1830.0307010135.710d97d@posting.google.com>

JT <woland99@earthlink.net> wrote in message news:<3F01C903.5050109@earthlink.net>...
> Can sbdy point me to a good source of such examples - I need to export
> a few spreadsheets from Lotus 1-2-3 as CSV files , connect to Approach,
> import those files as tables, run few SQL queries and export results as
> text files.
> I read Win32::OLE examples pertaining to Access and Excel but it does not
> seem that one can simply modify them to work with 1-2-3 and Approach.

If you have ActiveState installed in C:\perl look at

C:\Perl\html\OLE-Browser\Browser.html

It will allow you to browse through OLE objects available to your system.
It will show methods, attributes etc.....

Once you get the hang of using OLE objects with perl, you should
be able to read the documentation from Lotus (examples probably in LotusScript)
and translate it to perl easily.

> I do not know anything about OLE in general - is there a good online source
> that would be relevant to Lotus products and Win32::OLE.
> 
> Thanks,
> 
> JT


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

Date: Tue, 1 Jul 2003 00:01:08 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: multiline thingy in hash makes it single line item ?
Message-Id: <slrnbg25ck.1la.tadmc@magna.augustmail.com>

Asim Suter <asimsuter@hotmail.com> wrote:

> Does storing a multiline thing in a hash make it one line ?


No.


> Can anyone syggest a workaround ?


A workaround to what?

Show us a complete program that we can run. Describe how its
output is not what you want. Describe what output you do want.
We will help you fix the code.


> Kindly Cc asimsuter@hotmail.com in your replies.


Kindly pick up the answers to your questions in the same
place that you asked the questions.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 1 Jul 2003 02:13:10 -0700
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: need a cheap JOIN on 3 large tables under Win32
Message-Id: <1bff1830.0307010113.1e2db15c@posting.google.com>

JT <woland99@earthlink.net> wrote in message news:<3F019370.3020204@earthlink.net>...
> Howdy - I have three tab-delimited files that represent tables of
> records with 3 to 20 fields in them. Files have between 3K and 30K lines.
> I need to do JOIN operation on them with with all three tables.
> The easiest solution would be not to import the data into any database.
> I tried DBD::CSV driver but it is not able to handle the size of the data.
> Is SQLite capable of doing such task?

Im sure it is, according to what I read.  However it sounds like you are
on Win32 and I read some people had trouble compiling it.  I couldn't 
find any binaries for ActiveState (some people mentioned there were though).

I can't really reccomend any embedded SQL engines for perl, since I 
haven't really used any.



> If I have to involve database then the database of choice would be Lotus 
> Approach. Can anybody point me to some examples how to connect to Approach,
> (using Win32::OLE or sth else) create and manipulate data?

Win32::OLE isn't specifically related to databases.  It is for automating
com objects, ActiveX controlls, etc.... (C# assemblies now?)

There are 2 common objects that could be used to access databases through
Win32::OLE, ADO and DAO.  This usually isn't nescessary. (Although handy
for reparing access databases)

Perhaps you really meant Win32::ODBC.  This would be used to access a
database through ODBC.  I would suggest using DBI and DBD::ODBC instead:
  - for portability
  - error handling w/ exceptions (RaiseError)
  - ability to prepare statements
  - methods for quoting and escaping sql
  
I would imagine that Lotus Approach provides an ODBC driver.  If so,
install DBI (which you've already done) and DBD::ODBC and the ODBC driver.
The documents for DBI and DBD::ODBC have examples (Im sure you have looked
at DBI already though).



> 
> Thanks,
> 
> Tom
> 
> PS. 
> now I know that it is easy to just create 4 hashes etc but for maintenence
> purposeses my boss wants this thing to be capable to respond to SQL.


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

Date: Tue, 01 Jul 2003 08:27:43 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: need a cheap JOIN on 3 large tables under Win32
Message-Id: <pan.2003.07.01.06.25.24.362058@kamelfreund.de>

JT wrote at Tue, 01 Jul 2003 01:58:19 +0000:

> records with 3 to 20 fields in them. Files have between 3K and 30K lines.
> I need to do JOIN operation on them with with all three tables.
> The easiest solution would be not to import the data into any database.
> I tried DBD::CSV driver but it is not able to handle the size of the data.
> Is SQLite capable of doing such task?

30K size of lines is too big for DBD::CSV?
I never tried it, but I can't really believe it.
(I would if you would have written of at least 30M).

It might be that it is a bug, have you contacted the author? As long as I
know, he is currently working on DBD::CSV.

> If I have to involve database then the database of choice would be Lotus 
> Approach. Can anybody point me to some examples how to connect to Approach,
> (using Win32::OLE or sth else) create and manipulate data?

Perhaps another easy solution would be:
Read the CSV files into a real DBMS,
join the tables there,
and dump it back as CSV.
With DBI, that should also be simple to do automatically.


Greetings,
Janek


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

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


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