[22076] in Perl-Users-Digest
Perl-Users Digest, Issue: 4298 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 20 18:05:42 2002
Date: Fri, 20 Dec 2002 15:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 20 Dec 2002 Volume: 10 Number: 4298
Today's topics:
Re: FormMail.pl <krahnj@acm.org>
Re: help: perl script to make all DNA sequence Nmers? (Anno Siegel)
Re: How to get the HTTP_AUTHORIZE in Perl <usenet@atrixnet.com>
how to make my perl cgi program run in IE (philip)
Re: how to make my perl cgi program run in IE <lou.moran@gellerandwind.com>
Re: how to make my perl cgi program run in IE <wsegrave@mindspring.com>
Re: how to make my perl cgi program run in IE <wsegrave@mindspring.com>
Re: how to make my perl cgi program run in IE <jurgenex@hotmail.com>
Re: how to use system to send data to a command that as <nospam@nospam.org>
Re: how to use system to send data to a command that as <flavell@mail.cern.ch>
Re: incorporating off-site content <bashbrothers@cox.net>
Re: incorporating off-site content <wsegrave@mindspring.com>
Re: incorporating off-site content (Tad McClellan)
Re: Installing an event handler with use / require? (Anno Siegel)
Re: Tied Filehandles (Anno Siegel)
Re: Tied Filehandles <goldbb2@earthlink.net>
Re: Why does Perl handle "return undef;" differently th (Mark Jason Dominus)
Win32::OLE MSGraph <lance@augustmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 20 Dec 2002 22:06:56 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: FormMail.pl
Message-Id: <3E039432.1E16153E@acm.org>
Chris wrote:
>
> I haveing truble setting this formail.pl file. i wass wondering how can i
> fix so it work.
Use this instead:
http://nms-cgi.sourceforge.net/formmail.tar.gz
John
--
use Perl;
program
fulfillment
------------------------------
Date: 20 Dec 2002 21:10:38 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: help: perl script to make all DNA sequence Nmers?
Message-Id: <au010e$itc$3@mamenchi.zrz.TU-Berlin.DE>
According to Dave Tweed <dtweed@acm.org>:
> isen wrote:
> > does anyone have a perl script to make all possible DNA sequence Nmers
> > (and put in an array preferably) when given N as an input? Please
> > reply by email (sindriATmacDOTcom) if possible.
>
> What's the point? Isn't this isomorphic to the infinite monkeys problem?
> Sure, an infinite number of monkeys will type out the works of Shakespeare,
> but you're still left with the problem of sorting through all of the paper
> to find them, rejecting all of the near misses:
>
> "To be, or not to be, that is the blickzorp ..."
Easy. You just wait till a monkey types out the directory where to find
all the good stuff.
...unless another monkey first types out something that looks like such
a directory, but isn't.
Anno
------------------------------
Date: Fri, 20 Dec 2002 16:30:31 -0600
From: Tommy Butler <usenet@atrixnet.com>
To: tbutler@uninetsolutions.com
Subject: Re: How to get the HTTP_AUTHORIZE in Perl
Message-Id: <3E039A07.903@atrixnet.com>
Timothy Butler wrote:
> Hi,
> I have a problem. :-) I want to see what password someone has sent in=
a=20
> HTTP Authorize password box, and I can't figure out how to do it in Per=
l. I=20
> know Apache seems to pass that bit as an encoded string ("HTTP_AUTHORIZ=
E"=20
> or just "Authorize").=20
>=20
> At first I figured it must be impossible to get this data, but then I=
=20
> remembered that phpMyAdmin is able to pass the password you type in suc=
h a=20
> box to MySQL - so it *must* be possible. Indeed, PHP lists Authorize as=
one=20
> of the headers that is availabe to it.=20
>=20
> Surely its possible to get this info in Perl too, I assume, isn't it?=
I=20
> prefer Perl to PHP by several magnitudes, so I'm dreading the thought o=
f=20
> having to switch to PHP just to get this info...
>=20
> Thanks,
> Tim
Look at CGI.pm If you have perl installed on your system, type this from=
the
prompt: "perldoc CGI"
Look specifically at the portion of the docs that discusses the "header" =
method,
or CGI::header(). The answer you are looking for is there. :O)
--=20
-Tommy Butler
see if I'm online =BBhttp://ooopps.sourceforge.net/online
Tommy Butler <tommy@atrixnet.com>
phone: (817)-468-7716
6711 Forest Park Dr
Arlington, TX
76001-8403
Download my r=E9sum=E9 in PDF, MS Word, HTML, text
http://www.atrixnet.com/
the ooOPps Code Library
http://ooopps.sourceforge.net/pub/
------------------------------
Date: 20 Dec 2002 13:08:58 -0800
From: philip_ord@yahoo.com (philip)
Subject: how to make my perl cgi program run in IE
Message-Id: <f711da37.0212201308.2cc23db@posting.google.com>
I wrote a simple perl program to print some HTML tags.
but it can only run in command mode.
when I tried to run it in IE, it launched the command window.
what is the program?
------------------------------
Date: Fri, 20 Dec 2002 16:22:31 -0500
From: Lou Moran <lou.moran@gellerandwind.com>
Subject: Re: how to make my perl cgi program run in IE
Message-Id: <5f270vsfm3v5ktva3q50rg0neu8vj2j29f@4ax.com>
On 20 Dec 2002 13:08:58 -0800, philip_ord@yahoo.com (philip) wrote:
>I wrote a simple perl program to print some HTML tags.
>but it can only run in command mode.
>when I tried to run it in IE, it launched the command window.
>what is the program?
You have a way to go. You need a web server running either somewhere
else where you have the ability to run a script or one running
locally. Google is a good a place as any to start looking for your
answer.
--
There's more than one way to do it, but only some of them work
------------------------------
Date: Fri, 20 Dec 2002 15:34:20 -0600
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: how to make my perl cgi program run in IE
Message-Id: <au0352$f6h$2@slb6.atl.mindspring.net>
"philip" <philip_ord@yahoo.com> wrote in message
news:f711da37.0212201308.2cc23db@posting.google.com...
> I wrote a simple perl program to print some HTML tags.
> but it can only run in command mode.
> when I tried to run it in IE, it launched the command window.
> what is the program?
IE has no capability to execute your cgi script directly. You need a server,
e.g., Apache, to provide that capability.
IndigoPerl, available free from www.indigostar.com, is a nice pre-configured
Perl and Apache installation for your Windows system. Just download and
install it, start up Apache, and point your browser to http://localhost. If
you get the success page, you're ready to go.
Now drop a copy of your Perl script into the folder c:\indigoperl\cgi-bin
and point your browser to http://localhost/cgi-bin/your_script_name.pl.
Please ensure your Perl script looks something like:
#!perl -w
# usage - e.g., in c:\indigoperl\cgi-bin, type ..\bin\perl -c
your_script_name.pl
# I've put the path to the script above so I don't have to type it
# when I'm testing in the "MS-DOS Prompt" window
# remove these comments, if you like, replacing them with what you prefer
use strict;
use CGI qw(-no_xhtml :standard);
print header, start_html;
# more code here
print end_html;
Good luck and Happy Holidays!
Bill Segraves
------------------------------
Date: Fri, 20 Dec 2002 15:53:56 -0600
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: how to make my perl cgi program run in IE
Message-Id: <au03lc$nre$1@slb0.atl.mindspring.net>
"William Alexander Segraves" <wsegrave@mindspring.com> wrote in message
news:au0352$f6h$2@slb6.atl.mindspring.net...
<snip>
> #!perl -w
> # usage - e.g., in c:\indigoperl\cgi-bin,
# type ..\bin\perl -c your_script_name.pl
Naturally, you won't be able to copy and paste into your editor with
impunity because of errant line wraps. Just fix any you see, as I did above,
and let the Perl interpreter find the rest of your errors when you test your
script at the command line.
Cheers.
Bill Segraves
------------------------------
Date: Fri, 20 Dec 2002 22:41:43 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how to make my perl cgi program run in IE
Message-Id: <H0NM9.68077$4W1.31426@nwrddc02.gnilink.net>
philip wrote:
> I wrote a simple perl program to print some HTML tags.
> but it can only run in command mode.
> when I tried to run it in IE, it launched the command window.
> what is the program?
No web browser I know of has the ability to run a Perl script. Web browsers
render HTML pages and the more advanced browser execute DHTML, too.
Therefore IE did the best it could offer: it launched a command shell and
asked the command shell to handle the Perl script.
jue
------------------------------
Date: Fri, 20 Dec 2002 14:12:33 -0500
From: "Christian Caron" <nospam@nospam.org>
Subject: Re: how to use system to send data to a command that ask for input
Message-Id: <atvq30$jbu6@nrn2.NRCan.gc.ca>
"Christian Winter" <thepoet@nexgo.de> wrote in message
news:3e036856$0$13023$9b4e6d93@newsread2.arcor-online.net...
> "Christian Caron" <nospam@nospam.org> wrote:
> > Hi all,
> >
> > I want my program to execute htpasswd to generate a password file in a
> > directory.
> [snipped]
>
> If you are going to use the standard, unix-style crypt
> password files, you can also install Apache::Htpasswd from
> CPAN, which lets you directly alter the password files instead
> of calling the external utility.
>
> I don't know whether there is something similar for
> md5 password files yet.
>
> HTH
> Christian
>
>
Very interesting. Thanks!
------------------------------
Date: Fri, 20 Dec 2002 20:51:22 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: how to use system to send data to a command that ask for input
Message-Id: <Pine.LNX.4.40.0212202042390.1168-100000@lxplus071.cern.ch>
On Dec 20, Christian Winter inscribed on the eternal scroll:
[good stuff snipped]
> If you are going to use the standard, unix-style crypt
> password files, you can also install Apache::Htpasswd from
> CPAN, which lets you directly alter the password files instead
> of calling the external utility.
If you're going to be handling password tokens at this level, then you
really need a careful security walk-through to examine the issues and
potential loopholes of your procedure. That's not in itself a matter
for comp.lang.perl.misc (where you'd be welcome to discuss the
mechanics of the procedure, as long as they're specific to the Perl
language) but perhaps rather for the comp.security.* groups (as
relates to security) or comp.infosystems.www.* groups (as it relates
to web procedures and server configuration).
Just a brief comment: maybe you should be ensuring that the client is
using https: (secure HTTP) before prompting them for a password. My
colleague who handles a more secure server situation will
automatically disable any user account on his system if his server has
seen its password passed over a non-encrypted channel. He can't, by
technical means, stop them from presenting a password unencrypted -
but he can at least block further access if they attempt it.
------------------------------
Date: Fri, 20 Dec 2002 20:12:19 GMT
From: "bashbrothers" <bashbrothers@cox.net>
Subject: Re: incorporating off-site content
Message-Id: <DQKM9.63756$Y86.2262@news2.central.cox.net>
I don't know what top posting is, i am just trying to help people
"
------------------------------
Date: Fri, 20 Dec 2002 14:50:15 -0600
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: incorporating off-site content
Message-Id: <au0040$ra$1@slb0.atl.mindspring.net>
O.K. Fair enough. This is top posting. See the preferred posting style below
your quoted text.
"bashbrothers" <bashbrothers@cox.net> wrote in message
news:DQKM9.63756$Y86.2262@news2.central.cox.net...
> I don't know what top posting is,
This is a form of bottom posting, as it is beneath the quoted text.
>i am just trying to help people
That is commendable. This is also bottom posting.
I think you can see that top posting, perhaps caused, in your case, by MSOE
placing the insertion point at the top of the message, destroys the
chronological context of the thread of conversation.
Cheers.
Bill Segraves, also trying to help people
------------------------------
Date: Fri, 20 Dec 2002 15:02:10 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: incorporating off-site content
Message-Id: <slrnb071ai.2fb.tadmc@magna.augustmail.com>
bashbrothers <bashbrothers@cox.net> wrote:
> I don't know what top posting is
It is a style of quoting followups that folks here do not like.
http://www.tuxedo.org/~esr/jargon/html/entry/top-post.html
http://www.dickalba.demon.co.uk/usenet/guide/faq_topp.html
http://mail.augustmail.com/~tadmc/clpmisc.shtml
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 20 Dec 2002 20:46:46 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Installing an event handler with use / require?
Message-Id: <atvvjm$itc$2@mamenchi.zrz.TU-Berlin.DE>
According to Brian McCauley <nobull@mail.com>:
> Benjamin Goldberg <goldbb2@earthlink.net> writes:
>
> > Overload CORE::GLOBAL::require, perhaps?
>
> Well, Anno already said in this thread that require() wasn't
> overloadable.
>
> I must admit that I'd accepted Anno's word without checking.
>
> I've just tried it and it seems to me that Anno spoke the truth.
I had it from the horse's mouth.
perl -le 'print prototype( "CORE::use")'
doesn't show a prototype, and similar for "CORE::require". I understand
this is the final judgment about overridability.
Anno
------------------------------
Date: 20 Dec 2002 20:29:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Tied Filehandles
Message-Id: <atvuj2$itc$1@mamenchi.zrz.TU-Berlin.DE>
According to Rick Delaney <rick.delaney@rogers.com>:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
>
> > According to Andrew Hamm <ahamm@mail.com>:
> > > Tassilo v. Parseval wrote:
> > > >
> > > > Now both
> > > >
> > > > print $myhandle @list
> > > >
> > > > as well as
> > > >
> > > > $myhandle->print(@list)
> > > >
> > > > will work as expected.
>
> [...]
>
> > > sub garnish {
> > > ++$n;
> > > print "garnish $n\n";
> >
> > Umm... What makes you think printing something to STDOUT would make it
> > appear in the output to the tied filehande?
>
> What makes you think he doesn't want it going to STDOUT?
This, from the initial posting of the thread:
I want to write a tied filehandle class so that I may inject timestamps
into the data stream at the beginning of each line. ...
I must have missed a bend in the thread, apparently the "print" is there
for debugging and not for the original purpose. Apologies.
> [...]
>
> > As you have seen, the output appears on STDOUT.
>
> No, as we have seen, some of the output from
>
> $myhandle->print(@list)
>
> goes to STDOUT, because the print method is called but the indirect
> object call
>
> print $myhandle @list
>
> is not printing anything to STDOUT because the print method is not
> called.
>
> Perhaps the incomprehensible BUGS section of IO::Handle is meant to
> explain this.
I see now what the code is up to. I wasn't too amazed not to see the
print method called because the ordinary print operator has its own
indirect object slot (and a filehandle will fit). Reading "print
$myhandle ..." as a method call through indirect object syntax probably
doesn't occur to the parser, though it might.
Anno
------------------------------
Date: Fri, 20 Dec 2002 16:46:10 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: Tied Filehandles
Message-Id: <3E038FA2.B8CECA33@earthlink.net>
Andrew Hamm wrote:
>
> Folks,
>
> I want to write a tied filehandle class so that I may inject
> timestamps into the data stream at the beginning of each line. The
> injection is easy enough by using a trivial state which represents
> start of line (initialized to 1 of course) and switching on/off at
> each \n etc etc etc (details to be worked out when I get stuck into
> it)
>
> However, tied filehandles have a bunch of subs needing definition:
> write, print, printf.
>
> Can I get away with defining one of these only (either write or print)
> and expect the intelligence of the interpreter to exploit it
> appropriately for the other two?
If you inherit from Tie::Handle, then you only need to define a WRITE
method.
package TimeStampFH;
use IO::Handle;
use Symbol qw(gensym);
use base qw(Tie::Handle);
sub new {
my $self = gensym;
tie *$self, $_[0], @_[1 .. $#_];
$self;
}
sub TIEHANDLE {
my ($class, @args) = @_;
my $fh = IO::Handle->new(@args) or return;
bless [ $fh, 1 ], $class;
}
sub WRITE {
my $self = shift;
my $str = substr( $_[0], $_[2], $_[1] );
my ($fh, $oldstate) = @$self;
my $timestamp = localtime() . " ";
my $newstate = do { local $/ = "\n"; chomp $str };
$self->[1] = $newstate
if( $oldstate ) {
$str =~ s/^/$timestamp/mg;
} else {
$str =~ s/(?<=\n)/$timestamp/g;
}
$str .= "\n" if $newstate;
print $fh $str;
}
1;
__END__
[untested]
--
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);
------------------------------
Date: Fri, 20 Dec 2002 19:11:12 +0000 (UTC)
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Why does Perl handle "return undef;" differently then "return;"
Message-Id: <atvq0g$uvb$1@plover.com>
Keywords: fundamental, handhold, plantain, seafood
In article <atsshh$72u$1@newslocal.mitre.org>,
Aaron Simmons <asimmons@mitre.org> wrote:
>Thank you. That really does explain it. I do believe in general doing a
>"return undef;" is the safest thing to do. Can anyone give me an example of
>why doing a "return;" would be better then a "return undef;"?
'return' is what you put in a function when you want it to return a
false value. Consider:
sub returns_undef {
return undef;
}
sub returns_false {
return;
}
Now you might think these were the same, as for example:
if (returns_undef()) { die "oops" }
if (returns_false()) { die "oops" }
Neither of these will die. And this doesn't die either, because the
subroutine is returning a false value:
@result = returns_false();
if (@false) { die "oops" }
But this one is broken:
@result = returns_undef();
if (@result) { die "oops" }
because the function is NOT returning a false value; it is returning a
list of one element, and in list context, only an *empty* list is
false. In fact, after the assignment, @result is not empty; it
contains one element, which is undef.
So you use
return undef;
when you want to return a single scalar value which is undef, no
matter what, and you use
return;
when you want to return false.
Now, some functions are intended to *always* return a single scalar
value. For example
sub last_modification_date {
my $file = shift;
my @statinfo = stat $file;
return undef unless @statinfo;
return $statinfo[9];
}
This function always returns a single scalar value; when the file is
inaccessible, that scalar value is undef. In such cases 'return
undef' is entirely appropriate.
But some functions return a variable-length list of values:
sub all_dot_files {
local *HOME;
unless (opendir HOME, $ENV{HOME}) {
return;
}
my @files = readdir HOME;
return grep /^\./ && -f "$ENV{HOME}/$_", @files;
}
Here the function returns a list of all the files from the user's home
directory whose names begin with a dot. But if it can't open the home
directory for some reason, it wants to return a failure code. This
version of the function is written correctly. It can be used in any
of several ways:
if (all_dot_files()) {
# there was at least one dot file
}
@dot_files = all_dot_files();
if (@dot_files) {
# there was at least one dot file
}
for (all_dot_files()) {
# do me once for each dot file
}
$any_dot_files = all_dot_files();
if ($any_dot_files) {
# there was at least one dot file
}
But suppose the function had been written to use 'return undef'
instead:
sub all_dot_files {
local *HOME;
unless (opendir HOME, $ENV{HOME}) {
return undef; # Aaron Simmons told me to do this
}
my @files = readdir HOME;
return grep /^\./ && -f "$ENV{HOME}/$_", @files;
}
Now you can't use this function correctly. If it reads the home
directory and finds no dot files, it returns an empty list (or, in
scalar context, the number 0) but if it fails to open the home
directory, it returns the single scalar 'undef'.
In particular, this no longer works:
if (all_dot_files()) {
# ...
}
Because '...' is executed not just if there were any dot files, but
also if the home directory couldn't be opened.
And this doesn't work correctly, either:
@dot_files = all_dot_files();
if (@dot_files) {
# ...
}
for the same reason; and moreover, if the directory couldn't be
opened, @dot_files now contains a bogus 'undef' value which is likely
to trigger a big, as in the next example:
for (all_dot_files()) {
# ...
}
If the directory was opened successfully, all is well. But if it
couldn't be opened, the loop runs anyway, using the undefined value,
and that is likely to cause all sorts of trouble. For example:
for (all_dot_files()) {
open FILE, "< $ENV{HOME}/$_" or die ...;
while (<FILE>) {
...
}
}
If all_dot_files() returns undef, then Perl enters the loop and
interpolates the undefined value of $_, triggering a warning, and the
filename is just the directory name $ENV{HOME}. If you're lucky, your
operating system will refuse to allow you to open a directory as if it
were a file and the program will die at that point with an error
message like "is a directory" or some such. But if you're not lucky,
the 'open' will succeed and the '<FILE>' will start reading binary
garbage out of the directory.
>Here's a HUGE example of why I beleive it is best to do a "return undef;"
>################
>use CGI;
>
>my $cgi = new CGI();
>
># ...
>
>updateTable($ID, $cgi->param('FName'), $cgi->param('LName'), $tableName);
Unfortunately for your application, 'param' is not one of those
functions that always returns a single scalar value. In general, a
CGI widget name could have multiple values. You might have several
input boxes, all named 'LName'. Or, more realistically, that's how
checkboxes work. So 'param' returns a list of the values associated
with a particular name.
If you want to force the function to return a single scalar value, as
you do here, the proper thing to do is to use the 'scalar' operator:
updateTable($ID, scalar($cgi->param('FName')), scalar($cgi->param('LName')), $tableName);
If you don't like that, then feel free to do this:
sub CGI::sparam {
my $self = shift;
my $result = $self->param(@_);
return $result;
}
updateTable($ID,$cgi->sparam('FName'), $cgi->sparam('LName'), $tableName);
>Since the param method does a "return;" not a "return undef;", the
>line of code above is dangerous because updateTable may get 4
>arguments passed to it, or maybe 3, or maybe 2. It depends if
>'FName' and 'LName' exist in the query string (or POST'ed data). ...
>I feel like the line of code above should work just fine.
If it did, all sorts of other stuff would break. Suppose you had a bunch
of checkboxes, and you wanted to know if any of them had been checked:
my @checkboxes = $cgi->param('endorsements');
if (@checkboxes) {
...
}
This simple code won't work any more, because 'param' returns 'undef'
when none of the boxes are checked.
>It almost makes me want to go back to &ReadParse so I can do
>"updateTable($ID, $in{'FName'}, $in{'LName'}, $tableName);" and know
>it will always work.
That, of course, is always an option.
>I know from now on in my code, I will stay away from doing just
>"return;" b/c doing so prevents me from safely calling that
>subroutine in an argument list.
That sounds superstitious. You should not avoid something just
because it has once caused you a problem. You should try to
understand that nature of the problem first. I hope this article has
led you to better understanding.
------------------------------
Date: Fri, 20 Dec 2002 13:25:04 -0600
From: Lance Hoffmeyer <lance@augustmail.com>
Subject: Win32::OLE MSGraph
Message-Id: <pan.2002.12.20.19.25.04.527645.5308@augustmail.com>
I am trying to copy some data from Excel into a PPT Datasheet. I am
having problems at the end with the foreach statements at the end.
Can anyone help?
my $ppt=Win32::OLE->GetActiveObject('Powerpoint.Application')
||Win32::OLE->new('PowerPoint.Application','Quit');
$ppt->{Visible} = 1;
my $p1 = $ppt->Presentations->Open({FileName=>"b:\\perl\\test.ppt"});
my $Excel = Win32::OLE->new('Excel.Application', 'Quit');
$Excel->{Visible} = 1;
my $Book = $Excel->Workbooks->Open({FileName=>"b:\\perl\\test.xls"});
my $Sheet = $Book->Worksheets("Sheet1");
$Sheet->Select();
$Sheet->Range("A1")->{Value} = "December";
$Sheet->Range("A2")->{Value} = "10";
$Sheet->Range("A3")->{Value} = "20";
$Sheet->Range("A4")->{Value} = "30";
my $array = $Sheet->Range("A1:A4")->{Value};
$Sheet->Range("B1:B4")->{value} = $array;
# Someone suggested cutting down to this
foreach (my $Shape->$p1->ActivePresentation->Slides(3)->{Shapes}){
If ($Shape->{Type}="msoEmbeddedOLEObject")
{
my $Graph = $Shape->OLEFormat->Object;
$Graph->Application->DataSheet->Range("A1:A4") = $array;
};
};
Original Code
#With ($p1->ActivePresentation->Slides(3)
# foreach (my $Shape In .Shapes){
# If ($Shape->{Type}="msoEmbeddedOLEObject")
# {
# If ($Shape->OLEFormat->{ProgId} = "MSGraph.Chart.8"){
#
#my $Graph = $Shape->OLEFormat->Object;
#$Graph->Application->DataSheet->Range("A1:A4") = $array;
# }
# }
# }
#);
------------------------------
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 4298
***************************************