[25686] in Perl-Users-Digest
Perl-Users Digest, Issue: 7927 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 30 18:05:46 2005
Date: Wed, 30 Mar 2005 15:05:10 -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 Wed, 30 Mar 2005 Volume: 10 Number: 7927
Today's topics:
[ANN]: Last Chance 2005 IORCC Entries iorcc@yahoo.com
Re: Accessing Single Parameters in Perl Script <joe@inwap.com>
compress utility != Compress::Zlib::compress() on linux john_ramsden@sagitta-ps.com
Re: FAQ 6.6 How can I make "\w" match national characte <flavell@ph.gla.ac.uk>
LWP:RobotUA site retrieval <sams@freeddns.org>
Re: Perl script hangs (Kurt)
Re: problem with old version of (Active) Perl <pilkowsk@informatik.uni-marburg.de>
Re: problem with old version of (Active) Perl k9boy@hotmail.com
Re: problem with old version of (Active) Perl <joe@inwap.com>
Re: problem with old version of (Active) Perl <pilkowsk@informatik.uni-marburg.de>
Re: problem with old version of (Active) Perl <flavell@ph.gla.ac.uk>
Re: Pulling hair out with pattern matching <matternc@comcast.net>
Re: Pulling hair out with pattern matching <pilkowsk@informatik.uni-marburg.de>
Re: Question on perl script. <joe@inwap.com>
Re: regexp compilation <do-not-use@invalid.net>
Re: regexp compilation <tadmc@augustmail.com>
Re: regexp compilation <pilkowsk@informatik.uni-marburg.de>
Saving an xls file as HTML or JPG using Perl (deep)
Re: Saving an xls file as HTML or JPG using Perl <1usa@llenroc.ude.invalid>
Soap::Lite Cant get array of results? <spam_box@gmx.net>
Re: Soap::Lite Cant get array of results? <gabriel.reid@mail.to.gmail.dot.com>
Using HTTPS with LWP::UserAgent = Bad Service <richard.lawrence@gmail.com>
Re: Using HTTPS with LWP::UserAgent = Bad Service <usenet@vyznev.invalid>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Mar 2005 11:38:06 -0800
From: iorcc@yahoo.com
Subject: [ANN]: Last Chance 2005 IORCC Entries
Message-Id: <1112211486.370283.30070@g14g2000cwa.googlegroups.com>
FOR IMMEDIATE RELEASE: Wed Mar 30 11:58:39 CST 2005
LOCATION: http://iorcc.dyndns.org/2005/press/033005.html
ANNOUNCEMENT: 2005 IORCC Deadline Approaches
Entry Deadline March 31st, 2005
Less than 36 Hours Left, Great Prizes and Fun!
Dear Rubyists, Perlists, Shellists, Cists and Hackers,
Well, it has boiled down to this, a great finish for the International
Obfuscated Ruby Code Contest, 2005 Edition. There is still 30 hours
left to get your obscure and wacky Ruby code entered. Surf on over to
the Official IORCC rules and website:
http://iorcc.dyndns.org
With over $2000 USD in prizes from notable industry leaders like Stone
Design, OmniGroup, Luscious Monster, OpenBase, Bare Bones Software,
O'Reilly Press, Syngress, Purgatory Design, Running With Scissors,
BasaSoft, Ecto, Puzzles Forever, Pragmatic Programmer, Bartas Tech,
Macro Mates, Ambrosia Software, Sol Robots, Code Tek, dbSuite and more!
You just won't believe the list of prizes these generous people have
committed to giving away! Dust off your Ruby compiler, take your Perl,
Shell, Python and Tcl skills to the test, making a really obscure and
obfuscated entry for this years contest.
Entry window closes at 23:59:59 Universal Time March 31st, 2005.
Official Sponsors, Rules and Entry Guidelines are available online at
the IORCC Website. Enter Today! We'd like to also say thanks to the
following people and companies in chronological order of sponsorship:
- Dave Thomas, Signed copies of PickAxe and Ruby on Rails books!
- Syngress Press, Ruby the Developers Guide (700+ pages of real world
Ruby)
- Purgatory Design's Intaglio, graphics application for charting
obscure entries.
- O'Reilly and Associates, The Ruby Nutshell book, need we say more?
- Andrew Stone's, Stone Design Suite, Create, Graphics, WebApps,
Applets and more!
- Puzzles Forever, the folks that invented Solitaire Forever.
- OpenBase SQL, OpenStep and now OSX Database solutions for Linux,
Windows and MacOSX.
- Postal2: Share the Pain from the sick puppies at Running With
Scissors/Infamous Gary Coleman.
- Sol Robot's CrosswordForge, word finder and crossword puzzle
generator. Fun for all.
- Bartas Technologies' CopyWrite, got a book or documents to publish?
Use CopyWrite.
- MacroMates' TextMate. Lightweight and POWERFUL code project
management tool, really slick!
- CodeTek's Virtual Desktop. The definitive way to expand and maximize
your desktop workspace.
- OmniGroup's OmniGraffle and OmniOutline, the way to go in
professional presentations.
- InterServices New Media's, dbSuite WebBuilder and SQL4X Manager J for
OS X.
- Ecto for OS X, the power of the blog!
- BasaSoft's, BasaOne, the Integrated Web Application Development
Environment.
- Bare Bones Software, with Mail Smith and BBEdit, the Professional
HTML editing for OS X.
- Pipe, simple, elegant, powerful. The utility editor for OS X.
- Ambrosia Software, with SnapzProX 2 and WireTap Pro. Make moves from
the desktop!
- Delicious Monster, with of course Delicious Library. Catalog your
videos, music and more!
A big thank you to all the contestants, sponsors and support from the
Ruby community. We have had a great time putting this together, and
now we can (almost) begin the judging process. Winners will be
announced after noon April 1st, 2005. A public voting forum for the
2005 IORCC People's Choice Award will be opened with voting continuing
thru the 15th of April, 2005. Winners will be announced shortly after
the web voting is closed and counted.
Best of luck to you all!
Todd Nathan
IORCC Founder/Judge
irc://irc.freenode.net/iorcc (SeaForth)
http://iorcc.dyndns.org/
"What you talkin about Willis?" - GC
2005 IORCC Sponsor Home Page Links:
http://www.pragprog.com/
http://www.syngress.com/
http://www.purgatorydesign.com/
http://www.oreilly.com/
http://www.stone.com/
http://www.solitaireforever.com/
http://www.openbase.com/
http://www.gopostal.com/
http://www.solrobots.com/
http://www.bartastechnologies.com/
http://www.macromates.com/
http://www.codetek.com/
http://www.omnigroup.com/
http://www.dbsuite.de/
http://ecto.kung-foo.tv/
http://www.basasoft.com/
http://www.barebones.com/index.shtml
http://www.kcore.de/
http://www.ambrosiasw.com/news/
http://www.delicious-monster.com/
------------------------------
Date: Wed, 30 Mar 2005 13:21:39 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Accessing Single Parameters in Perl Script
Message-Id: <NLCdnZiQyIf6hdbfRVn-iw@comcast.com>
Francis wrote:
> I am told (by my ecommerce people) that it the parameter is
> included in the HTTP POST. I gather that this can be accessed in the
> perl script and the parameter(s) extracted.
Baby steps.
First, learn how to create a simple CGI that processes a simple POST.
You need to get experience with simple CGI-in-Perl tutorials before
tackling the ecommerce problem.
-Joe
------------------------------
Date: 30 Mar 2005 06:25:12 -0800
From: john_ramsden@sagitta-ps.com
Subject: compress utility != Compress::Zlib::compress() on linux and Windows
Message-Id: <1112192712.172514.144830@f14g2000cwb.googlegroups.com>
For some reason when the compress utility is used to
create a .Z file, the result is not recognized by the Compress::Zlib
uncompress() function (on either Linux
or Windows).
And it turns out that Compress::Zlib::compress() produces
a _different_ .Z file. Editing the two seems to show that
the contents are the same after a certain point and thus
the headers differ. DOH!
I am running with perl v5.8.6, in which Compress::Zlib
v1.33 is bundled. (v1.34 was released in 2005-01; but I
doubt if 1.33 is drastically out of date.)
Can anyone shed some light on this? If so, you'll be doing
better than the Compress::Zlib documentation and any other
reference I've found after two hours Googling!!
Appended is my test script, which I'm sure is sound.
Cheers
John Ramsden
use strict;
use warnings;
use Compress::Zlib qw(compress uncompress);
#----------------------------------------------
sub jr_read ($)
{
my $x_name = shift;
local ($/);
open (my $fh, "< $x_name")
or die "open ('< $x_name') failed: $!";
binmode ($fh);
my $contents = <$fh>;
close ($fh);
return $contents;
}
#----------------------------------------------
sub jr_write ($$)
{
my ($x_name, $x_contents) = @_;
local ($/);
open (my $fh, "> $x_name")
or die "open ('> $x_name') failed: $!";
binmode ($fh);
print $fh $x_contents;
close ($fh);
return;
}
#----------------------------------------------
# my $arch_path = 'jr.tar.Z';
# try a compress of a small text file
my $contents = compress (jr_read ('ls.txt'));
jr_write ('ls.txt.Z', $contents);
$contents = uncompress (jr_read ('ls.txt.Z'));
jr_write ('ls_hack.txt', $contents);
# ls_hack.txt ends up identical to ls.txt, as expected.
#
# BUT - if ls.txt.Z is created by command "compress ls.txt"
# then uncompress() call above fails!!
exit (0);
------------------------------
Date: Wed, 30 Mar 2005 18:52:58 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: FAQ 6.6 How can I make "\w" match national character sets?
Message-Id: <Pine.LNX.4.61.0503301836140.32369@ppepc56.ph.gla.ac.uk>
On Wed, 30 Mar 2005, PerlFAQ Server wrote:
> 6.6: How can I make "\w" match national character sets?
>
> Put "use locale;" in your script. The \w character class is taken from
> the current locale.
>
> See perllocale for details.
Hmmm... I suspect this could use some re-working?
The problem is that Perl's unicode support is said to be only
partially compatible with its locale support.
If I look at (e.g) ActivePerl 5.8.6, then it's evidently got somewhat
better than in earlier 5.8.* versions, but perllocale does say this:
| Usually locale settings and Unicode do not affect each other,
| but there are exceptions, see Locales in the perlunicode
| manpage for examples.
and perlunicode still says this:
| Use of locales with Unicode is discouraged.
Taking that in conjunction with the earlier, and stronger, warnings
about using locales in conjunction with unicode, I suspect that those
who need unicode support and are writing code that's meant to be
compatible with some non-latest Perl versions, are in need of guidance
on this matter? Just exactly what that guidance should be, I'm afraid
I don't have enough expertise to go into detail on, but I do have a
strong feeling that something is needed (sorry!).
At any rate, see perlunicode, subheading "Security implications of
Unicode", second bullet item.
all the best
------------------------------
Date: 30 Mar 2005 10:04:28 -0800
From: "Ohm" <sams@freeddns.org>
Subject: LWP:RobotUA site retrieval
Message-Id: <1112205867.969407.156320@f14g2000cwb.googlegroups.com>
Hello,
I have a question on LWP:RobotUA, I made it to work in my ActivePerl5.x
script but its only able to get the default index.htm(l) page how I
get the entire site content, in a tree format?
Is there something already there in Perl or I have to tinker with this
code? Also I like to get the content instead of something like *.asp
link?
my $ua = LWP::RobotUA->new('my-robot/0.1', 'info@DONTBLAMEME.com');
$ua->delay(60);
Appreciate any help.
Sam.
------------------------------
Date: 30 Mar 2005 04:42:36 -0800
From: kurt.semba@gmx.de (Kurt)
Subject: Re: Perl script hangs
Message-Id: <4ac4c245.0503300442.1fef26ec@posting.google.com>
phaylon wrote:
>
> For maybe real help: Do you check the return values of your open's,
> close's and so on? Do you use warnings and strict? Have you turned off
> buffering (per C<$|++>)? So you could maybe see more exactly where your
> script hangs.
Thanks so far :)
I checked that the daemon will properly open and close all files. The
only file that it keeps open all the time is the log file. I made the
filehandle for this log file "hot" so perl doesn't buffer anything
while writing to the log file. I hope this will give me a better hint
where the error really occurs.
Of course I use strict, warnings, diagnostics...
For debugging reasons I redirected the daemons stdout and stderr to
specific file. I just changed this to /dev/null maybe this helps...
I'll post again if I can define the part of the code where the error
(hope it's a singe error source) occurs.
Bye,
Kurt
------------------------------
Date: Wed, 30 Mar 2005 14:28:27 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: problem with old version of (Active) Perl
Message-Id: <3avk9aF69lilmU1@individual.net>
* k9boy@hotmail.com schrieb:
>
> I wrote the code on my local machine, which runs ActivePerl 5.8. The
> machine that will use this code runs ActivePerl 5.6. Part of the code
> opens up a large file (>85MB), substitute string values line by line,
> then writes it to another file. Surprisingly, this part of the code
> quits after reading about 10MB [...]
Problems like this could happen due to forgetting binmode() on windowish
systems. Have a look at
perldoc -f binmode
and try out if that helps. Apart from that your code seems to be correct
for me, just your escaped backslashes in filenames give less readability
than a simple forward slash »/« which is already sufficient on windows.
regards,
fabian
------------------------------
Date: 30 Mar 2005 06:27:41 -0800
From: k9boy@hotmail.com
Subject: Re: problem with old version of (Active) Perl
Message-Id: <1112192861.950345.314060@l41g2000cwc.googlegroups.com>
*slaps head* Thanks. Looks like binmode does it, although my files
should have been pure text.
I originally had forward slashes, but I noticed that Windows (XP Pro)
doesn't always behave properly with them. For example, at the command
prompt:
C:\>type C:\A.txt
This is in C:\
C:\>type C:\temp\A.txt
This is in C:\temp
C:\>type C:/A.txt
The syntax of the command is incorrect.
C:\>type "C:/A.txt"
This is in C:\
C:\>type "C:/temp/A.txt"
This is in C:\
The last result is incorrect... unless I'm doing it wrong.
In my Perl script, I'm making a "system" call to an EXE. When using
back slashes, the EXE generates a log file in the directory it was run
from. When using foward slashes, the EXE generates a log file in the
directory containing the EXE. I can't explain it, so I'm playing it
safe.
Thanks for the replies.
------------------------------
Date: Wed, 30 Mar 2005 12:05:59 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: problem with old version of (Active) Perl
Message-Id: <5fidnT9znpQ3m9bfRVn-ow@comcast.com>
Fabian Pilkowski wrote:
> just your escaped backslashes in filenames give less readability
> than a simple forward slash »/« which is already sufficient on windows.
You should qualify that statement. Forward slashes can be used
instead of backslashes in Perl programs. The same is not true
for other Windows programs invoked by exec(), system(), or qx``.
-Joe
------------------------------
Date: Wed, 30 Mar 2005 22:48:34 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: problem with old version of (Active) Perl
Message-Id: <3b0hihF6cssjgU1@individual.net>
* Joe Smith schrieb:
> Fabian Pilkowski wrote:
> >
> > just your escaped backslashes in filenames give less readability
> > than a simple forward slash »/« which is already sufficient on windows.
>
> You should qualify that statement. Forward slashes can be used
> instead of backslashes in Perl programs. The same is not true
> for other Windows programs invoked by exec(), system(), or qx``.
You're right. That is, what I've meant.
thanks,
fabian
------------------------------
Date: Wed, 30 Mar 2005 22:59:47 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: problem with old version of (Active) Perl
Message-Id: <Pine.LNX.4.61.0503302257500.32369@ppepc56.ph.gla.ac.uk>
On Wed, 30 Mar 2005, Fabian Pilkowski wrote:
> * Joe Smith schrieb:
> > Fabian Pilkowski wrote:
> > >
> > > just your escaped backslashes in filenames give less readability
> > > than a simple forward slash »/« which is already sufficient on windows.
> >
> > You should qualify that statement. Forward slashes can be used
> > instead of backslashes in Perl programs. The same is not true
> > for other Windows programs invoked by exec(), system(), or qx``.
>
> You're right. That is, what I've meant.
AFAIK, forward slashes are OK in the depths of Windows APIs: the
key problem is with the Windows shell itself (due to the tradition of
using "/" to introduce options, somewhat analogous to the Unix-ish
habit of using "-").
------------------------------
Date: Wed, 30 Mar 2005 06:48:46 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Pulling hair out with pattern matching
Message-Id: <hYSdnTGBpbGDD9ffRVn-tg@comcast.com>
AcCeSsDeNiEd wrote:
> $string=qq
<ahref="/fggfd/ra/client/getPolOwnerList.do?startWith=*&selectedUnitID=5445&selectedAdvID=95456&sid=gfhfghfh"|;
>
> if ($string =~ m/getPolOwnerList.do?startWith=*/) {
>
> print $string;
>
> }
>
>
> This doesn't work.
> It seems anything after the '?' in the pattern match is causing problems
> because this works:
>
>
> if ($string =~ m/getPolOwnerList.do?/) {
>
>
> Any clues to what is wrong?
> I'm using perl v5.6.1 built for MSWin32-x86-multi-thread.
>
> Thanks
>
>
>
> To e-mail, remove the obvious
? has special meaning in a regular expression. Unless you escape it,
it won't match a literal ?.
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Wed, 30 Mar 2005 14:34:57 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: Pulling hair out with pattern matching
Message-Id: <3avkleF6dkbitU1@individual.net>
* AcCeSsDeNiEd schrieb:
>
> Ok, I don't understand why I always end up finding a solution after posting for help.
> This works:
>
> if ($string =~ m/getPolOwnerList.do\?startWith=*/) {
>
> add '\' in front of ?
As Ala has mentioned you have to escape dots and asterisks too.
Otherwise you could use »\Q« and »\E« to fix your regex. Have a look at
perldoc perlre
to learn more about this.
regards,
fabian
------------------------------
Date: Wed, 30 Mar 2005 11:57:36 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Question on perl script.
Message-Id: <bP2dnTF1p5IomdbfRVn-qw@comcast.com>
Unix_Shell wrote:
> /usr/bin/perl
> -014pe's|^|"'$PAGE1FORM'".(/Page:\s+1\s/?"\n":"'$CONTFORMSFX'\n")|e'
>
> the first line from page 2 onwards with pg2form (i.e. with whatever I
> pass as $2 and *not* a concatenation of $1 and $2).
/usr/bin/perl
-014pe's|^|(/Page:\s+1\s/?"'$PAGE1FORM'\n":"'$CONTFORMSFX'\n")|e'
I would recommend getting rid of test.sh and using a perl script
instead of a perl one-liner.
-Joe
------------------------------
Date: 30 Mar 2005 14:11:29 +0200
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: regexp compilation
Message-Id: <yzdmzslqqoe.fsf@invalid.net>
alythh@netscape.net writes:
> hi all - I'm having some troubles, that seem related to regexp
> compilation.
>
> Trying to use the WordNet::SenseRelate module, I get a lot of errors
> like the following:
>
> Use of uninitialized value in regexp compilation at
> /usr/lib/perl5/site_perl/5.6.1/WordNet/SenseRelate.pm line 1109, <SFH>
> line 1.
> ...
>
> the incriminated line is:
> sub _loadStoplist
> {
> my $self = shift;
> my $file = shift;
> open SFH, '<', $file or die "Cannot open stoplist $file: $!";
> $stoplist{$self} = [];
> while (my $line = <SFH>) {
> chomp $line;
> $line =~ m|/(.*)/|;
> push @{$stoplist{$self}}, qr/$1/; # <<<<< LINE1109
> }
> close SFH;
> }
>
> ... so $1 comes from a previous pattern match on lines read from a file
> at runtime.
> I'm not at all an expert in quote-like operators, so I'm not able to
> debug this problem - anybody can help ?
The first thing to try when there is some indication that the value of
a variable is not what you expect is to find out what its value really is.
Here, this would probably show that $1 is undef after the line
$line =~ m|/(.*)/|;
and you can analyse that, disregarding the regexp compilation.
Perhaps the line doesn't contain two slashes. Then the match will fail
and $1 not be set. You need to be prepared for that case.
Or what you really mean is
$line =~ m/(.*)/;
or
$line =~ m|(.*)|;
but then just using $line instead of $1 would be more straightforward,
so that's probably not it.
------------------------------
Date: Wed, 30 Mar 2005 06:47:39 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: regexp compilation
Message-Id: <slrnd4l7vb.7et.tadmc@magna.augustmail.com>
alythh@netscape.net <alythh@netscape.net> wrote:
> Use of uninitialized value in regexp compilation at
> $line =~ m|/(.*)/|;
> push @{$stoplist{$self}}, qr/$1/; # <<<<< LINE1109
You should never use the dollar-digit variables unless you
have first ensured that the pattern match *succeeded*.
if ( $line =~ m|/(.*)/| )
{ push @{$stoplist{$self}}, qr/$1/ }
else
{ die "'$line' does not contain 2 slashes\n" }
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 30 Mar 2005 16:57:26 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: regexp compilation
Message-Id: <3avt0jF6c7ptnU1@individual.net>
* alythh@netscape.net schrieb:
>
> Trying to use the WordNet::SenseRelate module, I get a lot of errors
> like the following:
>
> Use of uninitialized value in regexp compilation at
> /usr/lib/perl5/site_perl/5.6.1/WordNet/SenseRelate.pm line 1109, <SFH>
> line 1.
Have you read the doc shipped with this module? Have a look at
http://search.cpan.org/~tpederse/WordNet-SenseRelate-v0.03/lib/WordNet/SenseRelate.pm
There you can see, that
Note: the methods below will die() on certain errors (actually, they
will Carp::croak()). Wrap calls to the methods in an eval BLOCK to
catch the exceptions. See 'perldoc -f eval' for more information.
Are you doing an eval() and looking into the special var »$@«?
>
> the incriminated line is:
> sub _loadStoplist
> {
> my $self = shift;
> my $file = shift;
> open SFH, '<', $file or die "Cannot open stoplist $file: $!";
> $stoplist{$self} = [];
> while (my $line = <SFH>) {
> chomp $line;
> $line =~ m|/(.*)/|;
> push @{$stoplist{$self}}, qr/$1/; # <<<<< LINE1109
> }
> close SFH;
> }
>
> ... so $1 comes from a previous pattern match on lines read from a file
> at runtime.
> I'm not at all an expert in quote-like operators, so I'm not able to
> debug this problem - anybody can help ?
I assume that your input file is corrupt. This module presupposed that
*you* have to garantee a correct syntax in your files.
Nevertheless the module's author should check if the regex above matchs
and $1 is defined. Perhaps you send him an email to fix this for other
users. Line 1109 could be written as
push @{$stoplist{$self}}, qr/$1/ if defined $1;
regards,
fabian
------------------------------
Date: 30 Mar 2005 13:42:51 -0800
From: dbanerji@gmail.com (deep)
Subject: Saving an xls file as HTML or JPG using Perl
Message-Id: <bfbf388.0503301342.e8358e0@posting.google.com>
Hi,
I have an xls file.
I'd like my perl script to open it, and either
1. save it as HTML with all the images stored in a directory (exactly
how Excel does it through windows)
2. save each worksheet as a jpg
any idea on how to do so?
-deepesh
------------------------------
Date: Wed, 30 Mar 2005 22:00:19 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Saving an xls file as HTML or JPG using Perl
Message-Id: <Xns9629ACFF87846asu1cornelledu@127.0.0.1>
dbanerji@gmail.com (deep) wrote in news:bfbf388.0503301342.e8358e0
@posting.google.com:
> Hi,
>
> I have an xls file.
>
> I'd like my perl script to open it, and either
>
> 1. save it as HTML with all the images stored in a directory (exactly
> how Excel does it through windows)
> 2. save each worksheet as a jpg
>
> any idea on how to do so?
Use Win32::OLE:
<URL: http://search.cpan.org/~jdb/libwin32-0.24/OLE/lib/Win32/OLE.pm>
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 30 Mar 2005 12:42:21 GMT
From: Lordy <spam_box@gmx.net>
Subject: Soap::Lite Cant get array of results?
Message-Id: <Xns96298BE2BF8CFlordybigfootcom@140.99.99.130>
[Many apologies for the duplicate post. Problem is quite urgent !]
I am using ActiveState Perl 5.8.6
I have a .NET web service that returns
<soap:Envelope ...>
<soap:Body>
<myOperationResponse xmlns="nyService">
<myOperationResult>
<Wrapper>
<Customer>customer 1 data</Customer>
<Customer>customer 2 data</Customer>
...
...
...
...
<Customer>customer 50 data</Customer>
</wrapper>
</myOperationResult>
</myOperationResponse>
</soap:Body>
</soap:Envelope>
The number of levels of 'wrapper' elements are for intergration reasons
and cannot be reasonably changed during this phase.
However when I query the first example using SOAP::Lite I can only see
the data for Customer 50 in the example above. It is like a hash was
used to hold the low level elements. It is definitely the first and NOT
the last customer element when looking at the raw data coming down the
wire.
Using paramsout() doenst help as paramsout is always undefined.
I'm sure I'm missing something as it seems such a simple problem and not
one I would expect to be a bug in SOAP::Lite. But I'm at a loss!
You will have to excuse my perl, but the function I use to display the
result is as follows:
sub showElem() {
( my $indent,my $tag,my $elem ) = @_;
if ( ref($elem) eq 'ARRAY' ) {
# This clause doesnt get invoked at all
my $i=0;
foreach my $item ( @$elem ) {
&showElem("$indent ","$tag"."[$i]",$item);
$i++;
}
} elsif ( ref($elem) eq 'HASH' ) {
print "\n$indent<$tag>\n";
foreach my $key ( keys %$elem ) {
my $value = $$elem{$key}; #Could something be wrong
here?
&showElem("$indent ",$key,$value);
}
print "$indent</$tag>\n";
} else {
print "$indent<$tag>$elem</$tag>\n";
}
}
Any ideas why only my last customer element is being shown?
--
Lordy
------------------------------
Date: Wed, 30 Mar 2005 16:06:53 GMT
From: Gabriel Reid <gabriel.reid@mail.to.gmail.dot.com>
Subject: Re: Soap::Lite Cant get array of results?
Message-Id: <x8A2e.50692$Vl7.4066437@phobos.telenet-ops.be>
Lordy wrote:
>
> I have a .NET web service that returns
>
>
> <soap:Envelope ...>
> <soap:Body>
> <myOperationResponse xmlns="nyService">
> ...
> </soap:Body>
> </soap:Envelope>
>
>
> The number of levels of 'wrapper' elements are for intergration reasons
> and cannot be reasonably changed during this phase.
>
> However when I query the first example using SOAP::Lite I can only see
> the data for Customer 50 in the example above. It is like a hash was
> used to hold the low level elements. It is definitely the first and NOT
> the last customer element when looking at the raw data coming down the
> wire.
>
> ...
> the function I use to display the
> result is as follows:
>
> sub showElem() {
> .....
>
> }
>
> Any ideas why only my last customer element is being shown?
>
First of all, no, I don't know why you're only seeing the last customer
record. However, all that I've seen is the SOAP envelope as tranferred
on the wire (I assume), and your method of displaying the values. There
are a number of places things could be going wrong here, but I don't
think you've provided enough information to see them.
What I would do first is use the Data::Dumper module to output the
value(s) you're getting back from SOAP::Lite (instead of your own output
function, which may just be hiding the problem).
Gabriel
------------------------------
Date: 30 Mar 2005 05:45:33 -0800
From: "Richard Lawrence" <richard.lawrence@gmail.com>
Subject: Using HTTPS with LWP::UserAgent = Bad Service
Message-Id: <1112190333.321753.152250@o13g2000cwo.googlegroups.com>
Hi all,
I'm trying to access https://www.nodeworks.com/ through a proxy which
requires a proxy username and password. The code I have is as follows:
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
use Data::Dumper qw(Dumper);
# If they provide an argument, connect to https else http
my $url = "http://www.nodeworks.com";
$url = "https://www.nodeworks.com" if ($ARGV[0]);
print "Going to get $url\n";
my $ua = new LWP::UserAgent;
# According to Crypt::SSLeay:
# "Use of the HTTPS_PROXY environment variable in this way is
# similar to LWP::UserAgent->env_proxy() usage, but calling that
# method will likely override or break the Crypt::SSLeay support,
# so do not mix the two."
# so only define $ua->proxy when using http.
if ($url =~ /^https/i)
{
print "Using HTTPS proxy $ENV{HTTPS_PROXY}\n";
}
else
{
$ua->env_proxy();
print "Using HTTP proxy $ENV{HTTP_PROXY}\n";
}
$ua->timeout(15);
my $req = new HTTP::Request('HEAD', $url);
my $res = $ua->request($req);
print "Result is:\n";
print Dumper($res);
My environment variable for http_proxy is set up like so:
http_proxy=http://richard:mypassword@10.10.200.44:8080/
HTTP_PROXY=http://richard:mypassword@10.10.200.44:8080/
export ...all of the above...
and running the code above with no arguments produces the desired
result.
However, if I try the code above with an argument (so it trys https)
with the following environment variables:
https_proxy=http://richard:mypassword@10.10.200.44:8080/
HTTPS_PROXY=http://richard:mypassword@10.10.200.44:8080/
export ...all of the above...
or even:
https_proxy=http://10.10.200.44:8080/
HTTPS_PROXY=http://10.10.200.44:8080/
https_proxy_username=richard
HTTPS_PROXY_USERNAME=richard
https_proxy_password=mypassword
HTTPS_PROXY_PASSWORD=mypassword
export ...all of the above...
then I always get the following error:
$VAR1 = bless( {
'_content' => '500 Can\'t connect to www.nodeworks.com:443 (Bad service
\'8080/\')',
'_rc' => 500,
'_headers' => bless( {
'client-warning' => 'Internal response',
'client-date' => 'Wed, 30 Mar 2005 13:41:12 GMT',
'content-type' => 'text/plain'
}, 'HTTP::Headers' ),
'_msg' => 'Can\'t connect to www.nodeworks.com:443 (Bad service
\'8080/\')',
'_request' => bless( {
'_content' => '',
'_uri' => bless( do{\(my $o = 'https://www.nodeworks.com')},
'URI::https' ),
'_headers' => bless( {
'user-agent' => 'libwww-perl/5.803'
}, 'HTTP::Headers' ),
'_method' => 'HEAD'
}, 'HTTP::Request' )
}, 'HTTP::Response' );
Can anyone offer any suggestions?
Many thanks,
Richard
------------------------------
Date: Thu, 31 Mar 2005 00:42:24 +0300
From: Ilmari Karonen <usenet@vyznev.invalid>
Subject: Re: Using HTTPS with LWP::UserAgent = Bad Service
Message-Id: <slrnd4m7a0.3ig.usenet@boojum.home.vyznev.net>
["Followup-To:" set to comp.lang.perl.misc.]
Richard Lawrence <richard.lawrence@gmail.com> kirjoitti 30.03.2005:
>
> I'm trying to access https://www.nodeworks.com/ through a proxy which
> requires a proxy username and password. The code I have is as follows:
I don't have a proxy that would require a username and a password, but
I've tested your code as far as I've can. As far as I can tell, your
code works just as it should -- the problem is elsewhere.
> my $req = new HTTP::Request('HEAD', $url);
> my $res = $ua->request($req);
> print "Result is:\n";
> print Dumper($res);
Just so you know, you can get a much cleaner dump of the response by
using $res->as_string(). In fact, those four lines can be reduced to:
print "Result is:\n", $ua->head($url)->as_string;
> However, if I try the code above with an argument (so it trys https)
> with the following environment variables:
>
> https_proxy=http://richard:mypassword@10.10.200.44:8080/
You don't need this; the uppercase version is the proper one.
> HTTPS_PROXY=http://richard:mypassword@10.10.200.44:8080/
It appears that Crypt::SSLeay doesn't support this syntax, and will
fail with an error similar to what you report. So this is likely to
be at least a part of your problem.
> HTTPS_PROXY=http://10.10.200.44:8080/
> HTTPS_PROXY_USERNAME=richard
> HTTPS_PROXY_PASSWORD=mypassword
This, however, seems to work just fine. Of course, I can't really
test if the authentication works or not, but at least there is no
error. You're reporting that you get the same "Bad service" error
each time, but I'd really suggest you try it one more time, and make
sure $ENV{HTTPS_PROXY} really contains what you think it does. You
could add something like this to your code to dump the relevant
environment variables:
/^HTTPS?_PROXY/ and print "$_=$ENV{$_}\n" for sort keys %ENV;
Hope this helps.
--
Ilmari Karonen
To reply by e-mail, please replace ".invalid" with ".net" in address.
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 7927
***************************************