[13478] in Perl-Users-Digest
Perl-Users Digest, Issue: 888 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 23 13:07:24 1999
Date: Thu, 23 Sep 1999 10:05:14 -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: <938106313-v9-i888@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 23 Sep 1999 Volume: 9 Number: 888
Today's topics:
Re: ./ -- why? c_j_marshall@hotmail.com
Re: Ad hominem (was Re: perl related question now!) <laurensmith@sprynet.com>
Adding commas to long numbers. mirak63@yahoo.com
Re: Adding commas to long numbers. (Kragen Sitaker)
Re: Be careful about using constants <rootbeer@redcat.com>
Re: CGI sending email with attachment <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com>
Re: CGI sending email with attachment <gellyfish@gellyfish.com>
Re: CGI sending email with attachment (Kragen Sitaker)
Re: CGI sending email with attachment <rhomberg@ife.ee.ethz.ch>
Re: cookbook: nonforker <SternSZ@gmx.de>
Re: Grouping in REs, no doc found (Kragen Sitaker)
HELP: Newbie opendir question <bwelton@enteract.com>
Re: How can I "undo" a require ? (Lack Mr G M)
Re: HTTP file upload on NT problem <gellyfish@gellyfish.com>
Re: New trolling strategy ? <rhomberg@ife.ee.ethz.ch>
Re: pattern matching options (Randal L. Schwartz)
Re: pattern matching options <rhomberg@ife.ee.ethz.ch>
Re: Perl/CGI and counter questions <sariq@texas.net>
Re: Problem doing authentication with Apache::DBI <madebeer@igc.apc.org>
problems with program using Win32::OLE... <mshenoy@us.oracle.com>
Re: sorting like numbers an array of strings (Greg Snow)
Re: sorting like numbers an array of strings (Larry Rosler)
Re: split comp.lang.perl.misc ? (David Salvador Flores)
Re: Substitution fails intermittently <rhomberg@ife.ee.ethz.ch>
Two frames using perl nallurichandu@my-deja.com
Two frames using perl nallurichandu@my-deja.com
Two frames using perl nallurichandu@my-deja.com
Re: You should be admired (Randal L. Schwartz)
Re: You should be admired (Kragen Sitaker)
Re: You should be admired <elaine@chaos.wustl.edu>
Re: You should be admired <elaine@chaos.wustl.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 23 Sep 1999 16:30:49 GMT
From: c_j_marshall@hotmail.com
Subject: Re: ./ -- why?
Message-Id: <7sdkjp$d6h$1@nnrp1.deja.com>
In article <7scaag$91b$1@gaddy.interpath.net>,
"Jeff" <post.it@in.newsgroup.pls> wrote:
> Hello,
> I am wondering why would I need to precede my Perl script with a " ./
" to
> get it to execute? I am using a Red Hat server. When I run this
script on
> a Slackware server it doesn't need the ./ in front of the file name.
>
> Thanks for any help in advance.
>
> Jeff
>
>
I've not used Linux - but under 'normal' Unix the first thing I would
suggest is to run the command 'rehash' which recomputes the path
variable.
Secondly check your path
- does it actually include "."
- is there a directory before "." which also contains a script of the
same name ?
I find it comforting to run scripts with ./ preceding because you know
what you are getting.
Cheers,
Chris
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 23 Sep 1999 09:25:20 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: Ad hominem (was Re: perl related question now!)
Message-Id: <7sdk9p$ddi$1@brokaw.wa.com>
Anno Siegel wrote in message <7sa7gg$tqa$1@lublin.zrz.tu-berlin.de>...
>Hemogoblin?
I think we have one of those under the Fremont bridge here in Seattle...
Or is it made of concrete? humm...
=)
Lauren
------------------------------
Date: Thu, 23 Sep 1999 19:31:25 GMT
From: mirak63@yahoo.com
Subject: Adding commas to long numbers.
Message-Id: <37ea7ee9.82764281@news.vnet.net>
Can anyone tell me a way to add the commas to long numbers?
Example: 123456789 to 123,456,789.
I could probably write a sub that could do this for me but it would be
nice if perl had a quick way of doing it.
Thanks,
Karim Wall
------------------------------
Date: Thu, 23 Sep 1999 16:48:08 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Adding commas to long numbers.
Message-Id: <cRsG3.6271$QJ.364267@typ11.nn.bcandid.com>
In article <37ea7ee9.82764281@news.vnet.net>, <mirak63@yahoo.com> wrote:
>Can anyone tell me a way to add the commas to long numbers?
>Example: 123456789 to 123,456,789.
>
>I could probably write a sub that could do this for me but it would be
>nice if perl had a quick way of doing it.
See perlfaq5, "How can I output my numbers with commas added?"
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 23 Sep 1999 09:09:30 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Be careful about using constants
Message-Id: <Pine.GSO.4.10.9909230900560.26916-100000@user2.teleport.com>
On 23 Sep 1999, Michael Fowler wrote:
> As the TECHNICAL NOTE states in perldoc constant, constants are
> currently implemented as possibly inlineable subroutines. They are
> defined with an empty prototype.
Correct.
> Because autoloading is done at run-time, any constant lookups do incur
> the overhead of a subroutine call.
[Maybe I'm misunderstanding you?] No, this happens at compile time. If
your code uses a constant like this:
use constant PI => 3.1416;
$sin_two_pi = sin(2 * PI);
...perl should calculate the sin of two PI at compile time, so there's
only a simple numeric assignment at runtime. Note that this optimization
won't happen under the debugger, so if you step through your code, you can
step through the "constant" subroutine call.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 23 Sep 1999 12:06:15 -0400
From: "Burt Hwang" <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com>
Subject: Re: CGI sending email with attachment
Message-Id: <GdsG3.53$RA1.2320@client>
To tell you the truth, I don't really know what I'm doing. But as I've
observed from other email source codes, it looks like you would define a
boundary, then use it with "--" before each. Am I wrong? To me, it looks
like I AM using the same boundary, no? Here's my code again and sample
email source(see bottom)
Jonathan Stowe wrote in message <37ea48ed_1@newsread3.dircon.co.uk>...
>Burt Hwang <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com> wrote:
>>
>>
>> print MAIL "Content-Type: multipart/mixed; boundary=\"gc0y0pkb9ex\"\n";
>
>In the rest of the output you are using a different boundary. If you dont
>understand what you are doing with this code then I would recommend
>that you use the module MIME::Lite available from CPAN.
>
>/J\
Here's my code:
open (MAIL, "|/usr/sbin/sendmail -t") || die "Cannot send mail\n";
print MAIL "To:$emailto\n";
print MAIL "From:$emailfromName <$emailfrom>\n";
print MAIL "Subject: Proofreadme.com - job #XXXXXXX\n";
print MAIL "MIME-Version: 1.0\n";
print MAIL "Content-Type: multipart/mixed; boundary=\"gc0y0pkb9ex\"\n";
print MAIL "\n--gc0y0pkb9ex\n";
print MAIL "Content-Type: text/plain;\n
charset=us-ascii\nContent-Transfer-Encoding: 7bit\n\n";
print MAIL "Hello Everyone!!! This is a test.\n";
print MAIL "\n--gc0y0pkb9ex\n";
print MAIL "Content-Type: application/msword;\n name=\"$filename\"\n";
print MAIL "Content-Disposition: attachment;\n
filename=\"$filename\"\nContent-Transfer-Encoding: base64\n";
open (FILE_FP, "DATA/attachedFile.doc");
while (<FILE_FP>){
print MAIL $_;
}
close FILE_FP;
print MAIL "\n--gc0y0pkb9ex\n";
close MAIL;
Here's my sample email source:
Return-Path: <anonymous@ns2.sslsite.com>
Received: from ns2.sslsite.com ([128.121.140.11])
by hvmta03-stg.us.psimail.psi.net
(InterMail v4.01.01.00 201-229-111) with SMTP
id <19990923150941.QYPV1102.hvmta03-stg@ns2.sslsite.com>
for <BurtHwang@ufsltd.com>; Thu, 23 Sep 1999 11:09:41 -0400
Received: (qmail 6946 invoked by uid 682); 23 Sep 1999 15:02:31 -0000
Date: 23 Sep 1999 15:02:31 -0000
Message-ID: <19990923150231.6945.qmail@ns2.sslsite.com>
To: BurtHwang@ufsltd.com
From: Proofreadme Staff <proofreader@proofreadme.com>
Subject: Proofreadme.com - job #XXXXXXX
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="gc0y0pkb9ex"
X-Mozilla-Status: 8001
X-Mozilla-Status2: 00000000
X-UIDL: <19990923150231.6945.qmail@ns2.sslsite.com>
--gc0y0pkb9ex
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello Everyone!!! Please look at the attached email for details.
--gc0y0pkb9ex
Content-Type: application/msword;
name="testFile.doc"
Content-Disposition: attachment;
filename="testFile.doc"
Content-Transfer-Encoding: base64
ÐÏࡱá
--gc0y0pkb9ex
------------------------------
Date: 23 Sep 1999 17:14:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI sending email with attachment
Message-Id: <37ea51cd_2@newsread3.dircon.co.uk>
Burt Hwang <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com> wrote:
> To tell you the truth, I don't really know what I'm doing. But as I've
> observed from other email source codes, it looks like you would define a
> boundary, then use it with "--" before each. Am I wrong? To me, it looks
> like I AM using the same boundary, no? Here's my code again and sample
> email source(see bottom)
>
Yes you are wrong. You are not using the same boundary because the one
that you declare has no dashes in from of it. Again if you dont what
you are doing use a module like MIME::Lite.
/J\
--
"Boring: See Civil Engineers" - Yellow Pages
------------------------------
Date: Thu, 23 Sep 1999 16:24:59 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: CGI sending email with attachment
Message-Id: <vvsG3.6202$QJ.362386@typ11.nn.bcandid.com>
In article <37ea51cd_2@newsread3.dircon.co.uk>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
>Burt Hwang <BurtHwangSPAMSUCKS@SPAMSUCKS.ufsltd.com> wrote:
>> To tell you the truth, I don't really know what I'm doing. But as I've
>> observed from other email source codes, it looks like you would define a
>> boundary, then use it with "--" before each. Am I wrong? To me, it looks
>> like I AM using the same boundary, no? Here's my code again and sample
>> email source(see bottom)
>
>Yes you are wrong. You are not using the same boundary because the one
>that you declare has no dashes in from of it. Again if you dont what
>you are doing use a module like MIME::Lite.
Actually, Burt Hwang is correct. From RFC 1521:
The Content-Type field for multipart entities requires one parameter,
"boundary", which is used to specify the encapsulation boundary. The
encapsulation boundary is defined as a line consisting entirely of
two hyphen characters ("-", decimal code 45) followed by the boundary
parameter value from the Content-Type header field.
I suggest that he read RFC 1521 if he's going to be writing his own
MIME messages instead of using MIME::Lite.
I may reply to his original message if I get time.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 23 Sep 1999 18:08:14 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: CGI sending email with attachment
Message-Id: <37EA506E.3DCAD8CE@ife.ee.ethz.ch>
Burt Hwang wrote:
> I have no clue
> why I can't receive attachments correctly with my email
> program. I'll get the attachment, but when I open it, it looks nothing like
> when I sent it.
>
> Here's my code:
[snip]
> filename=\"$filename\"\nContent-Transfer-Encoding: base64\n";
> open (FILE_FP, "DATA/attachedFile.doc");
> while (<FILE_FP>){
> print MAIL $_;
> }
> close FILE_FP;
apart from the fact that you use different boundaries as pointed out by
Jonathan Stowe, it wouldn't hurt to actually base64 encode the file
after telling everybody that it would be base64 encoded.
- Alex
------------------------------
Date: 23 Sep 1999 18:33:08 +0200
From: Benjamin Schweizer <SternSZ@gmx.de>
Subject: Re: cookbook: nonforker
Message-Id: <m3zoyd6117.fsf@anthrax.local.net>
+-->Rick Delaney <rick.delaney@home.com>:
| > I´ve got a non forking daemon which is pretty nice. If I mark the
| > following code as a comment it runs pretty nice, else Perl reports
| > that IO::Select has no method has_exception.
|
| If you want that method then you should upgrade your version of
| IO::Select to the one that has that method. Better yet, upgrade your
| perl since this is a standard module.
I´ve upgraded my version from 5.005_2 to 5.005_3, but IO::Select
doesn´t include "has_exception". What´s going wrong; is IO::Select not
in the perl.rpm file?
regards
-Benjamin
--
http://privat.schlund.de/SternSZ/
"Some animals are more equal than others."
------------------------------
Date: Thu, 23 Sep 1999 16:16:57 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Grouping in REs, no doc found
Message-Id: <ZnsG3.6154$QJ.361602@typ11.nn.bcandid.com>
In article <37EA4B3B.8517D624@ife.ee.ethz.ch>,
Alex Rhomberg <rhomberg@ife.ee.ethz.ch> wrote:
>lt lindley wrote:
>> :>I didn't find info about what happens when a group is followed by a
>> :>quantifier *?+{}
>>
>> That is silly. There is a huge amount of info about this subject in
>> perlre. You just haven't read it carefully enough.
>
>Can you point me to it? I'm sorry, I again didn't find it.
Actually, I never did figure it out either.
(BTW: perldoc perlre's explanation of /m erroneously claims that
without /m, $ matches only at the end of the string. It actually will
match before a newline if the newline is the last character of the
string.)
I just read all of perldoc perlre, including the parts about creating
overloaded constants and so forth, and as far as I can tell, nowhere
does it mention what happens if a subexpression inside capturing
parentheses matches more than once during a successful match attempt.
It would be reasonable to think that it left the first match, the last
match, or a concatenation of all matches in $2 or whatever.
>I don't want to rewrite it. IMHO something along the following lines is
>missing from perlre:
>
><PROPOSED DOC TEXT>
>If a subpattern in parentheses is followed by a quantifier ?*+{}, the
>value stored in the corresponding \<digit> or $<digit> is the last match
>of the subpattern (the empty string if the subpattern didn't match).
This is, unfortunately, not correct.
#!/usr/bin/perl -w
use strict;
my $string = 'How old is your CAT?';
$string =~ /(CAT)/; # succeeds
$string =~ /(flibberti-gibbet)/; # fails
print "$1\n"; # prints CAT
The sad truth is that it leaves the value unchanged if the subpattern
didn't match, or if it matched only as part of an unsuccessful pattern
match.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 23 Sep 1999 12:03:26 -0500
From: Bruce Welton <bwelton@enteract.com>
To: wbwelton@enteract.com
Subject: HELP: Newbie opendir question
Message-Id: <37EA5D5E.4AEA4EAA@enteract.com>
I am trying to use the opendir function in a script to open a directory
one level up from my cgi-bin, and something in my setup does not allow
that script to process. It is as follows:
#!/usr/local/bin/perl
require "headfoot.lib";
require "error.lib";
#opendir(DIR,"/home/~wbwelton/public_html/entry");
#@logfiles = readdir (DIR);
#closedir(DIR);
while($somedir = </home/wbwelton/public_html/entry/*>) {
open(FILE, "$file") || die "can't open $file for reading.\n";
$n=0;
&Header;
print "<table border=0 cellspacing=0 cellpadding=3>";
flock(FILE,2);
while (<FILE>) {
if ($_ =~/<TITLE>(.*)<\/TITLE>/i) {
$n++;
print "<TR>";
print "<TD>$n";
print "<TD>";
print "<A HREF=\"www.enteract.com/~wbwelton/entry/$file\">";
print $1;
print "</A>";
} else {
print "<TR>";
print "<TD><TD>";
}
if ($_ =~/meta=\"date\" content\"(.*)\"/i) {
print "<TD>$1<\/TR>";
} else {
print "<TD><\/TR>";
}
}
flock(FILE,8);
close(FILE);
}
If I need to give you more info, please let me know.
------------------------------
Date: Thu, 23 Sep 1999 17:38:08 BST
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: How can I "undo" a require ?
Message-Id: <1999Sep23.173808@ukwit01>
In article <37EA2A18.9CC3277E@sophos.com>, Csaba Raduly <csaba.raduly@sophos.com> writes:
|>
|> For each test case there's an automatically generated file with
|> the expected results:
|> =========testcase1.exp=======
|> %expected = {
|> 'file1.doc', 'virus1',
|> 'file2.doc', 'virus2',
|> # etc...
|> }
|> =======testcase1.exp end=====
|> # THERE!
|> require $expfile;
|>....
|> close FILE;
|> undef %expected; # get a fresh start
|> }
|>
|> This doesn't work when I start it with
No. You have undefined %expected, but perl knows that you have
already read $expfile, so won't do it again unless you tell it to.
Perl keeps a hash of what it has already been require()d to read. It
is called %INC (read the require section of perlfunc...).
So, instead of:
undef %expected;
use:
undef %INC{$expfile};
which will tell perl to forget that you have read it already, and so to
read it again on the next require. Since you defined %expected
absolutely each time you don't need to undef that.
--
--------- Gordon Lack --------------- gml4410@ggr.co.uk ------------
This message *may* reflect my personal opinion. It is *not* intended
to reflect those of my employer, or anyone else.
------------------------------
Date: 23 Sep 1999 17:04:31 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: HTTP file upload on NT problem
Message-Id: <37ea4f8f_1@newsread3.dircon.co.uk>
Daniel Ward <warddc@cat.com> wrote:
> How do I tell perl to use a different hard drive for its temp
> files? It creates CGITEM999999 files in c:\temp, I want
> to tell perl to place the CGI temp files on d:\temp
> how do I do that?
>
I dont think this documented in the CGI manpage but is obvious from the
code :
$TempFile::TMPDIRECTORY = 'D:/temp';
/J\
--
"Is there no demand for mechanical pussies?" - Mrs Slocombe
------------------------------
Date: Thu, 23 Sep 1999 18:44:53 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: New trolling strategy ?
Message-Id: <37EA5905.AAE8B75B@ife.ee.ethz.ch>
c_j_marshall@hotmail.com wrote:
>
> I've just been wondering (after reading some of the recent posts to this
> newsgroup) whether the 12 year old children who plague most newsgroups
> with rubbish have just learned a new strategy to wind us all up - namely
> by posting sensible looking, yet consistantly off topic, mails.
>
> Just a thought I had after thinking for 100th time "oh come on - you
> must know that has absolutely nothing to do with perl so why post it
> here?"
"oh come on - you must know that has absolutely nothing to do with perl
so why post it here?"
Sorry, couldn't resist
at least, here is some perl
- Alex
#test byte order
perl -le'print unpack "A*", pack "L*", reverse unpack "N*", pack "H*",
"72656b636148206c72655020726568746f6e61207473754a"'
------------------------------
Date: 23 Sep 1999 09:25:01 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: pattern matching options
Message-Id: <m1ogetvbmq.fsf@halfdome.holdit.com>
>>>>> "cleat" == cleat <cleat@umich.edu> writes:
cleat> Is there a way to make options to pattern match dynamic?
cleat> while ( $string =~ /$term/$searchops )
cleat> { $count++; }
cleat> where $searchops is either "gi" or "g"
cleat> does not work.
Yes. I illustrate the technique in column #12 of my WebTechniques
columns online at:
http://www.stonehenge.com/merlyn/WebTechniques/
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 23 Sep 1999 18:14:06 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: pattern matching options
Message-Id: <37EA51CE.D8036A81@ife.ee.ethz.ch>
cleat@umich.edu wrote:
> Is there a way to make options to pattern match dynamic?
>
> while ( $string =~ /$term/$searchops )
> { $count++; }
>
> where $searchops is either "gi" or "g"
look up (?imsx-imsx)
in perlre
- Alex
------------------------------
Date: Thu, 23 Sep 1999 10:59:14 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Perl/CGI and counter questions
Message-Id: <37EA4E52.ABB32E4D@texas.net>
Frodo wrote:
>
> Return e-mail is spam-proof.
And is *really* going to piss people off.
If you absolutely *must* munge your address, do it properly.
- Tom
P.S. If 'Frodo' replies, any bets on whether the response comes before
or after the quoted text?
------------------------------
Date: Thu, 23 Sep 1999 09:32:52 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Problem doing authentication with Apache::DBI
Message-Id: <APC&1'0'50775dbd'834@igc.apc.org>
>> '/usr/local/lib/perl5/site_perl/5.005/i386-bsdos/auto/DBD/mysql/mysql.so'
>> for module DBD::mysql: File not found at
>If this is the actual message then somewhere you have made a typo because
>that mysql should be capitalized -
I'm not sure this is so. I did locate myql.so on two boxes and this is
what I found, on an Solaris on Intel box, and on a Linux on Intel box:
/opt/solaris_x86.usr.local/lib/perl5.004/site_perl/i86pc-solaris/auto/DBD/mysql/mysql.so
/usr/lib/perl5/site_perl/5.005/i386-linux-thread/auto/DBD/mysql/mysql.so
-Mike
------------------------------
Date: Thu, 23 Sep 1999 12:44:24 -0400
From: Manoj Shenoy <mshenoy@us.oracle.com>
Subject: problems with program using Win32::OLE...
Message-Id: <37EA58E8.DE43E7C2@us.oracle.com>
Hi all, sorry if this situation has arisen before but I'm getting the
following error for some routine code i got out of an example (i think
on the ActivePerl help page) for using Win32::OLE to interact with Excel
and save a chart in Excel as a gif file. Any help or steer in the right
direction would be much appreciated! The error is below:
Win32::OLE(0.1005) error 0x80020006: "Unknown name"
in GetIDsOfNames of "Export" at gif.pl line 20
Here is the program:
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const;
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3; # die on errors...
my $filename =
"m:\\manoj\\tools\\www\\cust98dir\\cust98WScriptResults.xls";
my $filter = 'GIF'; # can be GIF, JPG, JPEG or PNG
my $count = 0;
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit'); # use the Excel
application if it's open, otherwise open new
my $Book = $Excel->Workbooks->Open( $filename ); # open the file
foreach my $Sheet (in $Book->Sheets) { # loop through all
sheets
foreach my $ChartObj (in $Sheet->ChartObjects) { # loop through all
chartobjects in the sheet
my $savename = "$filename." . $count++ . ".$filter";
$ChartObj->Chart->Export({
FileName => $savename,
FilterName => $filter,
Interactive => 0});
}
}
$Book->Close;
------------------------------
Date: 23 Sep 1999 16:14:01 GMT
From: snow@statsci.com (Greg Snow)
Subject: Re: sorting like numbers an array of strings
Message-Id: <7sdjk9$71l$1@junior.statsci.com>
In article <MPG.1253d934b93132f1989fc3@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
>> Uri and Larry Rosler have an even faster method.
>
>Indeed we do. It is faster in this case too, of course.
>
I've heard a lot about this article, but apparently missed the anouncement
of where it is. My searches of deja web have not turned it up (ok so I'm
lousy at comming up with good search terms).
Could you please post where it is?
Thanks,
--
-------------------------------------------------------------------------------
Gregory L. Snow | Inertia makes the world go round,
(Greg) | Love makes the trip worth taking.
snow@statsci.com |
------------------------------
Date: Thu, 23 Sep 1999 10:01:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: sorting like numbers an array of strings
Message-Id: <MPG.1253fca9ef8610ea989fc7@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7sdjk9$71l$1@junior.statsci.com> on 23 Sep 1999 16:14:01
GMT, Greg Snow <snow@statsci.com> says...
> In article <MPG.1253d934b93132f1989fc3@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
>
> >> Uri and Larry Rosler have an even faster method.
> >
> >Indeed we do. It is faster in this case too, of course.
>
> I've heard a lot about this article, but apparently missed the anouncement
> of where it is. My searches of deja web have not turned it up (ok so I'm
> lousy at comming up with good search terms).
>
> Could you please post where it is?
http://www.hpl.hp.com/personal/Larry_Rosler/sort/
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 23 Sep 1999 16:24:53 GMT
From: dsf3g@node10.unix.Virginia.EDU (David Salvador Flores)
Subject: Re: split comp.lang.perl.misc ?
Message-Id: <7sdk8l$iv3$1@murdoch.acc.Virginia.EDU>
In article <37DE0ADC.A8C09BE0@hl.siemens.de>,
Michel Combes <michel.combes@hl.siemens.de> wrote:
>All,
>
>Can we split comp.lang.perl.misc
>to have a clear separation of the Perl articles related to Web/CGI stuff
>
>and the Perl articles for others utilities /scripts ...
>because misc is just too big!
>
> may I suggest :
>+ comp.lang.perl.cgi or comp.lang.perl.web
>+ comp.lang.perl.util
>
>can we have a Call for Vote
>
>Regards,
>-Michel
>
You're gonna have to call it something like"
comp.lang.perl.not-cgi
To get a group like you want. Its not a bad idea, as repeated calls
to limit this group to non-cgi issues have fallen on deaf ears.
-Dave
------------------------------
Date: Thu, 23 Sep 1999 18:25:02 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Substitution fails intermittently
Message-Id: <37EA545E.9A3F3E42@ife.ee.ethz.ch>
drew3966@my-deja.com wrote:
> Regular expression: s/(\D{2}(\d{4})(\d?9\d?[789]))/19$3\/$1/gi);
>
> Open/read the file:
> open(HTMLFILE,"<$Dir"."$File") || ErrorOpen("$Dir"."$File", $!);
> $Bytes = 0;
> $Bytes = read(HTMLFILE, $Buffer, $HTML_MAX) ||
^^^^
are you sure this is big enough?
> LogError("$Dir"."$File", $!);
> print "$Dir . $File length ($Bytes)\n";
> close(HTMLFILE);
>
> Substitution:
> $rc = ($Buffer =~ s/(\D{2}(\d{4})(\d?9\d?[789]))/19$3\/$1/gi);
>
> Close/write the file:
> open(HTMLFILE,">$Dir"."$File") || ErrorOpen($Dir . $File, $!);
> $Bytes = length $Buffer;
> $Bytes = syswrite(HTMLFILE, $Buffer, $Bytes) || ErrorOpen($Dir .
> $File, $!);
> close(HTMLFILE);
>
> Any ideas?
for me, this looks like a case for in-place editing.
perl -i -pe's/(\D{2}(\d{4})(\d?9\d?[789]))/19$3\/$1/gi' my_file.html
(untested, should do the same)
This way, you at least get rid of any possible bugs in the code around
the substitution
- Alex
ps
your re smells fishy to me. what should the (\d?9\d?[789]) part match?
------------------------------
Date: Thu, 23 Sep 1999 16:44:43 GMT
From: nallurichandu@my-deja.com
Subject: Two frames using perl
Message-Id: <7sdldn$du1$1@nnrp1.deja.com>
Hello Friends,
my home page consists of frames in the home1frame
i have the user name and password field once i
submit the data to login.pl file.if he is a valied
user then i want to open a up a new frame removing
the existing frame. if he is a invalied user it
should give a message in the homeframe2.please
help me in this regard.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 23 Sep 1999 16:44:44 GMT
From: nallurichandu@my-deja.com
Subject: Two frames using perl
Message-Id: <7sdldp$du2$1@nnrp1.deja.com>
Hello Friends,
my home page consists of frames in the home1frame
i have the user name and password field once i
submit the data to login.pl file.if he is a valied
user then i want to open a up a new frame removing
the existing frame. if he is a invalied user it
should give a message in the homeframe2.please
help me in this regard.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Thu, 23 Sep 1999 16:44:42 GMT
From: nallurichandu@my-deja.com
Subject: Two frames using perl
Message-Id: <7sdldl$du0$1@nnrp1.deja.com>
Hello Friends,
my home page consists of frames in the home1frame
i have the user name and password field once i
submit the data to login.pl file.if he is a valied
user then i want to open a up a new frame removing
the existing frame. if he is a invalied user it
should give a message in the homeframe2.please
help me in this regard.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 23 Sep 1999 09:22:37 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: You should be admired
Message-Id: <m1so45vbqq.fsf@halfdome.holdit.com>
>>>>> "Kragen" == Kragen Sitaker <kragen@dnaco.net> writes:
Kragen> [...] You don't even know Abigail's a man. [...] I don't know
Kragen> Abigail well; I've never met him in person. I wouldn't
Kragen> presume to call him my friend. [...]
Those that *have* met Abigail in person know that it is appropriate to
call Abigail using feminine pronouns. Those that *haven't* usually
defer to those who have, at least in this society. :)
What makes you so special that you can choose not to respect Abigail's
wishes on this matter? Paraphrasing you, "You don't even know Abigail
should always be referenced using feminine nouns and pronouns!".
Sorta shakes up the faith now in *your* ability to define and explain
CLPM culture.
In Usenet tradition... "Pot. Kettle. Black."
I would also challenge you on your basis for determining that the
person that posts here as Abigail is in fact a "man", but that could
lead to DNA testing and PGP signature webs-of-trust. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Thu, 23 Sep 1999 16:43:48 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: You should be admired
Message-Id: <8NsG3.6267$QJ.362468@typ11.nn.bcandid.com>
In article <m1so45vbqq.fsf@halfdome.holdit.com>,
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
>>>>>> "Kragen" == Kragen Sitaker <kragen@dnaco.net> writes:
>Kragen> [...] You don't even know Abigail's a man. [...] I don't know
>Kragen> Abigail well; I've never met him in person. I wouldn't
>Kragen> presume to call him my friend. [...]
>
>Those that *have* met Abigail in person know that it is appropriate to
>call Abigail using feminine pronouns. Those that *haven't* usually
>defer to those who have, at least in this society. :)
I talked to someone who met Abigail at YAPC, evidently without learning
her pronoun preferences. I thought I had seen a few references on
c.l.p.m to Abigail by a male personal pronoun in the past; I have,
however, seen very few references to her using any pronoun at all.
>What makes you so special that you can choose not to respect Abigail's
>wishes on this matter?
Ignorance? Can I plead ignorance?
I'm sorry; I really didn't mean to be offensive to Abigail.
> Paraphrasing you, "You don't even know Abigail
>should always be referenced using feminine nouns and pronouns!".
>Sorta shakes up the faith now in *your* ability to define and explain
>CLPM culture.
As it should, I suppose.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Thu Sep 23 1999
46 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Thu, 23 Sep 1999 12:52:27 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: You should be admired
Message-Id: <37EA59F3.112E809A@chaos.wustl.edu>
Henry Penninkilampi wrote:
> the argument?) and tried to have a go at me instead. I responded by
> isolating her behavioural problem and delivered it to her on the end of a
> sharp tongue. That had the desired effect - it shut her up and put her
> back in her place (for now).
As an academic curiosity, would you have done the same if she were a he?
I ask because there has been some speculation as to why there are so few
women in the Perl community who are active participants.
Either way, I'm curious because of the way you worded it 'put her back
in her place' as this is generally a chauvenistic boast.
e.
------------------------------
Date: Thu, 23 Sep 1999 12:58:33 -0400
From: Elaine -HFB- Ashton <elaine@chaos.wustl.edu>
Subject: Re: You should be admired
Message-Id: <37EA5B61.EAF0F419@chaos.wustl.edu>
"Randal L. Schwartz" wrote:
> What makes you so special that you can choose not to respect Abigail's
> wishes on this matter? Paraphrasing you, "You don't even know Abigail
> should always be referenced using feminine nouns and pronouns!".
> Sorta shakes up the faith now in *your* ability to define and explain
> CLPM culture.
She can defend herself Randal. :)
And now all of you have ruined my query to the guy who said he 'put her
in her place'. Hrmph.
/me hand out the happy kool-aid and goes back to work.
e.
------------------------------
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 888
*************************************