[31773] in Perl-Users-Digest
Perl-Users Digest, Issue: 3036 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 19 18:09:31 2010
Date: Mon, 19 Jul 2010 15:09:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 19 Jul 2010 Volume: 11 Number: 3036
Today's topics:
Re: building a hash path index? <bugbear@trim_papermule.co.uk_trim>
Re: Can not locate object method "AddCell" via package <user@compgroups.net/>
Re: Can not locate object method "AddCell" via package <uri@StemSystems.com>
Re: Can not locate object method "AddCell" via package <jurgenex@hotmail.com>
Re: Can not locate object method "AddCell" via package <user@compgroups.net/>
Re: Can not locate object method "AddCell" via package <jimsgibson@gmail.com>
Re: Can not locate object method "AddCell" via package <justin.1007@purestblue.com>
Re: Can not locate object method "AddCell" via package <glex_no-spam@qwest-spam-no.invalid>
Comparing arrays using pop and shift. <sreeram91@gmail.com>
Re: Comparing arrays using pop and shift. <rvtol+usenet@xs4all.nl>
Re: Comparing arrays using pop and shift. sln@netherlands.com
Re: debugging Carp <marc.girod@gmail.com>
How to install all the cpan modules? <pengyu.ut@gmail.com>
Re: How to install all the cpan modules? <sreservoir@gmail.com>
Re: How to install all the cpan modules? <smallpond@juno.com>
Re: How to install all the cpan modules? <kkeller-usenet@wombat.san-francisco.ca.us>
Re: How to install all the cpan modules? <justin.1007@purestblue.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 Jul 2010 09:28:17 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: building a hash path index?
Message-Id: <sLmdnROESuA_kdnRnZ2dnUVZ7rGdnZ2d@brightview.co.uk>
Bo Lindbergh wrote:
>
> Any more contestants, or is it time to use Benchmark qw(cmpthese)? :-)
>
I was far more interested in elegance and correctness
than performance - as it happens my data structures
are not especially large (500 hashes).
Thanks to all who helped.
BugBear
------------------------------
Date: Sun, 18 Jul 2010 13:13:01 -0500
From: PerlTrainee <user@compgroups.net/>
Subject: Re: Can not locate object method "AddCell" via package "Spreadsheet:: ParseExcel ::Workbook"
Message-Id: <RKmdnRDdr5Ow2d7RnZ2dnUVZ_vSdnZ2d@giganews.com>
Is that all you had to say? You wrote your last email as if you were so dying to solve my problem but got disappointed when you didn't see the problem code?
I think the administrators should ban trolls like you. I am otta here
------------------------------
Date: Sun, 18 Jul 2010 14:23:22 -0400
From: "Uri Guttman" <uri@StemSystems.com>
Subject: Re: Can not locate object method "AddCell" via package "Spreadsheet:: ParseExcel ::Workbook"
Message-Id: <87wrsszm1x.fsf@quad.sysarch.com>
>>>>> "P" == PerlTrainee <user@compgroups.net/> writes:
P> Is that all you had to say? You wrote your last email as if you
P> were so dying to solve my problem but got disappointed when you
P> didn't see the problem code? I think the administrators should ban
P> trolls like you. I am otta here
who are you refering to? there is no quote or attribution. for a
supposed perl trainee you aren't doing a good job listening to what
people tell you.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Sun, 18 Jul 2010 11:34:12 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Can not locate object method "AddCell" via package "Spreadsheet:: ParseExcel ::Workbook"
Message-Id: <l1i6469nmcfqrmujabelk801j8asl6i789@4ax.com>
PerlTrainee <user@compgroups.net/> wrote:
>Is that all you had to say?
What did who say? It is a time-honored proven Usenet custom to quote
sufficient context such that any posting makes sense on its own.
>You wrote your last email
Email? What does email have to do with Usenet?
>as if you were so dying to solve my problem but got disappointed when you didn't see the problem code?
No idea what you are rambling about because you didn't provide any
context.
>I think the administrators should ban trolls like you. I am otta here
What adminstrators? CLPM is -like the vast majority of Usenet- a
non-moderated group. What adminstrators are you talking about?
jue
------------------------------
Date: Mon, 19 Jul 2010 13:08:12 -0500
From: PerlTrainee <user@compgroups.net/>
Subject: Re: Can not locate object method "AddCell" via package "Spreadsheet:: ParseExcel ::Workbook"
Message-Id: <AsKdnWNJzLYRCdnRnZ2dnUVZ_hudnZ2d@giganews.com>
Thanks for the response :) It always help to fix errors that could introduce bad side effects. I have updated my code with your suggestions.
I came across a workaround on the net for this problem. Somebody adviced to use SaveParser->SaveAs() method to save the file you want to edit with a new name. This SaveAs()method returns a WriteExcel() object which can then be used to write whatever to this new file. This solution is perfect for me but unfortunately now I am getting this error:
"Can't locate object method "SaveAs" via package "Spreadsheet::ParseExcel::Workbook".
I get the same error when I access "AddCell" method of SaveParser class.
My assumption at this point is:
1) either Perl5.12 ParseExcel (v0.57) are not compatible
2) I am not referencing SaveParser methods right
It just seems to get stuck at Spreadsheet::ParseExcel. It doesn't look "below".
SaveParser->new(); should make all methods accessible to me.
The example code on the net don't seem to call these methods any differently.
Anyways, I am moving on. They say C# also has some capability to write to an Excel file.
------------------------------
Date: Mon, 19 Jul 2010 11:13:50 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Can not locate object method "AddCell" via package "Spreadsheet:: ParseExcel ::Workbook"
Message-Id: <190720101113503111%jimsgibson@gmail.com>
In article <9NmdnVWd0dsv5t_RnZ2dnUVZ_qCdnZ2d@giganews.com>, PerlTrainee
<user@compgroups.net/> wrote:
> I have installed the ParseExcel v0.57 module and I read on CSPAN that this
> module contains SaveParser. So I don't think I need to install another
> package. I am running Perl 5.12. Is it possible that this module does not
> support this version of Perl?
The Spreadsheet::ParseExcel::SaveParser (SPESP) module depends upon
these modules:
Spreadsheet::ParseExcel;
Spreadsheet::ParseExcel::SaveParser::Workbook;
Spreadsheet::ParseExcel::SaveParser::Worksheet;
Spreadsheet::WriteExcel;
You can see this from the source, which can be displayed using the
command-line
perldoc -m Spreadsheet::ParseExcel::SaveParser
or the web page
<http://cpansearch.perl.org/src/JMCNAMARA/Spreadsheet-ParseExcel-0.57/li
b/Spreadsheet/ParseExcel/SaveParser.pm>
It is possible you need to have compatible versions of all five modules
for the modules to work.
Note that SPESP was moribund for many years and has been taken over by
a new maintainer, who has placed the following warning in the source
code:
"Please note that this module is currently (versions 0.50-0.60)
undergoing a major restructuring and rewriting."
Thus, problems can be anticipated.
If you can't wait for these problems to be fixed, and if your
requirements are modest, you may be able to use the
Spreadsheet::ParseExcel and SpreadSheet::WriteExcel modules to copy an
existing spreadsheet and updates it contents.
--
Jim Gibson
------------------------------
Date: Mon, 19 Jul 2010 22:20:08 +0100
From: Justin C <justin.1007@purestblue.com>
Subject: Re: Can not locate object method "AddCell" via package "Spreadsheet:: ParseExcel ::Workbook"
Message-Id: <85seh7-cst.ln1@purestblue.com>
In article <slrni466pb.a6c.hjp-usenet2@hrunkner.hjp.at>, Peter J. Holzer wrote:
> On 2010-07-18 10:34, Justin C <justin.1007@purestblue.com> wrote:
[snip]
>>
>> I got your code to work by changing the above line to:
>> my $workbook2 = $parser2->Parse('C:\writeMe.xls');
>> (note the upper-case 'P' ^ here)
>>
>> I don't pretend to be an expert, but I've done some investigation and I
>> find that there are two methods defined: Parse, and parse, but they are
>> not the same! The one with the upper-case P is in
>> Spreadsheet::ParseExcel::SaveParser, the other is in
>> Spreadsheet::ParseExcel.
>
> They could even both be spelled the same.
>
> $parser is an object of the class 'Spreadsheet::ParseExcel', so
> $parser->parse() calls Spreadsheet::ParseExcel::parse.
>
> $parser2 is an object of the class
> 'Spreadsheet::ParseExcel::SaveParser', so $parser2->Parse() calls
> Spreadsheet::ParseExcel::SaveParser::Parse().
>
>
>> I use modules in a lot of what I code, but when they are like this I
>> don't really understand what is going on. I mean, is S::PE::SP dependant
>> on S::PE? Could ...SaveParser be installed without S::PE?
>
> Maybe. It depends on how S::PE::SP is written. The documentation of
> S::PE::SP should answer your questions. If it doesn't mention S:PE at
> all, then S::PE::SP is probably completely independent of S::PE.
>
>> If I "use
>> S::PE::SP" does S::PE automatically get "used" as well?
>
> No. S::PE::SP may use S::PE, but if it does, any symbols exported by
> S::PE are only imported into S::PE::SP, not into your current package.
>
> Note that in object-oriented Perl, symbols are not usually exported:
> Instead the full class name is used for class methods like new, and
> instance methods are referenced via the object anyway. So if you use
> class A and class A uses class B, you can use class B just as if you had
> used it yourself.
Thank you for the explanation.
Justin.
--
Justin C, by the sea.
------------------------------
Date: Mon, 19 Jul 2010 10:16:25 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Can not locate object method "AddCell" via package "Spreadsheet:: ParseExcel ::Workbook"
Message-Id: <4c446c49$0$89388$815e3792@news.qwest.net>
PerlTrainee wrote:
> Okay, here is the code. Yesterday I was running the following program on Window 7 Professional 64 bit. I thought the OS was the culprit. I got this code from CSPAN website. So, I don't think there could be something wrong with the code. I ran the same code on my home computer with Window XP Professional 32 bit but got the same error.
>
> What I don't understand is I have specified SaveParser so why it wouldn't look for "AddCell" method there? Why it keeps looking for it in ParseExcel?
>
> use strict;
> use Spreadsheet::ParseExcel;
> use Spreadsheet::ParseExcel::SaveParser;
>
> my $parser = Spreadsheet::ParseExcel->new();
> my $workbook1 = $parser->parse('C:\readMe.xls');
>
> if ( !defined $workbook1 ) {
> die $parser->error(), ".\n";
> }
>
>
> my $worksheet1 = $workbook1->worksheet('Sheet1');
> my $parser2 = Spreadsheet::ParseExcel::SaveParser->new();
> my $workbook2 = $parser2->parse('C:\writeMe.xls');
>
In addition to all of the other comments, The following:
> if (!defined $workbook2) {
> die $parser->error(),".\n";
> }
will call the error method from the Spreadsheet::ParseExcel
class. More than likely, you would want to call error from
the Spreadsheet::ParseExcel::SaveParser class.
die $parser2->error;
Also, note the side effect when you add a newline to die's output.
------------------------------
Date: Mon, 19 Jul 2010 13:13:02 -0700 (PDT)
From: sree <sreeram91@gmail.com>
Subject: Comparing arrays using pop and shift.
Message-Id: <30da65a7-455f-4481-b83c-9154da76bd59@g35g2000yqa.googlegroups.com>
Hey, can someone tell me the next step:
I wanna compare if one of this string is the reverse of the next,
using the functions- shift and pop. I could manage to print the
strings using 'while' loop.
$str1=<>;
chomp $str1;
@str1= split("", $str1);
while(@str1) {
@pop= pop(@str1);
}
print "\n";
$str2=<>;
chomp $str2;
@str2= split("", $str2);
while(@str2){
@shift= shift(@str2);
}
Now, how to compare these two arrays, to check if one of the array is
the reverse of the other.
------------------------------
Date: Mon, 19 Jul 2010 22:55:15 +0200
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: Comparing arrays using pop and shift.
Message-Id: <4c44bbb3$0$22945$e4fe514c@news.xs4all.nl>
sree wrote:
> I wanna compare if one of this string is the reverse of the next,
perldoc -f reverse
--
Ruud
------------------------------
Date: Mon, 19 Jul 2010 14:08:16 -0700
From: sln@netherlands.com
Subject: Re: Comparing arrays using pop and shift.
Message-Id: <qef946peh56uaqljcdp8ovurnnpbgldvhj@4ax.com>
On Mon, 19 Jul 2010 13:13:02 -0700 (PDT), sree <sreeram91@gmail.com> wrote:
>Hey, can someone tell me the next step:
>
>I wanna compare if one of this string is the reverse of the next,
>using the functions- shift and pop. I could manage to print the
>strings using 'while' loop.
>
>$str1=<>;
>chomp $str1;
>@str1= split("", $str1);
>
>while(@str1) {
>@pop= pop(@str1);
>}
>
>print "\n";
>
>$str2=<>;
>chomp $str2;
>@str2= split("", $str2);
>
>while(@str2){
>@shift= shift(@str2);
>}
>
>Now, how to compare these two arrays, to check if one of the array is
>the reverse of the other.
Try this:
$reverse='$print';
$print='tnirp$';
if((reverse$reverse)eq$print) {
print "$reverse equals reverse $print\n";
}
-sln
------------------------------
Date: Mon, 19 Jul 2010 09:43:49 -0700 (PDT)
From: Marc Girod <marc.girod@gmail.com>
Subject: Re: debugging Carp
Message-Id: <16e65269-a6e3-4531-91db-05e8bfbea938@l14g2000yql.googlegroups.com>
On Jul 16, 7:09=A0pm, "C.DeRykus" <dery...@gmail.com> wrote:
> > This is a bug in perl, or in the debugger. I'm not terribly surprised:
...
> A google P5P thread cites this example below.
Thanks to both of you.
I don't need a fix: it is enough for me to have some reason to trust
my own code (who said I have few?).
And I couldn't narrow my problem into a neat case.
Marc
------------------------------
Date: Sun, 18 Jul 2010 14:19:27 -0700 (PDT)
From: Peng Yu <pengyu.ut@gmail.com>
Subject: How to install all the cpan modules?
Message-Id: <185d8e01-8774-4b5e-9104-d69dc6a9668e@k39g2000yqb.googlegroups.com>
I'm getting tired of downloading each module individually and install
them. I want to either install all cpan modules (if they don't take
too much disk spaces) or install a module on demand with just one
simply command. Could anybody show me what is the most convenient way
to install cpan modules?
http://www.cpan.org/modules/INSTALL.html
------------------------------
Date: Sun, 18 Jul 2010 17:31:50 -0400
From: sreservoir <sreservoir@gmail.com>
Subject: Re: How to install all the cpan modules?
Message-Id: <i1vrt5$oju$1@speranza.aioe.org>
On 7/18/2010 5:19 PM, Peng Yu wrote:
> I'm getting tired of downloading each module individually and install
> them. I want to either install all cpan modules (if they don't take
> too much disk spaces) or install a module on demand with just one
> simply command. Could anybody show me what is the most convenient way
> to install cpan modules?
>
> http://www.cpan.org/modules/INSTALL.html
% cpan Bundle::All
I think. note that it _is_ a joke module.
mirror a minicpan and use the command cpan to install what you want,
when you want, whether you still have an internet connection or not.
--
"Six by nine. Forty two."
"That's it. That's all there is."
"I always thought something was fundamentally wrong with the universe."
------------------------------
Date: Sun, 18 Jul 2010 18:25:15 -0700 (PDT)
From: smallpond <smallpond@juno.com>
Subject: Re: How to install all the cpan modules?
Message-Id: <1f145227-8187-41f7-a384-07c3bd1f9fc5@q22g2000yqm.googlegroups.com>
On Jul 18, 5:19=A0pm, Peng Yu <pengyu...@gmail.com> wrote:
> I'm getting tired of downloading each module individually and install
> them. I want to either install all cpan modules (if they don't take
> too much disk spaces) or install a module on demand with just one
> simply command. Could anybody show me what is the most convenient way
> to install cpan modules?
>
to install a module as root:
perl -MCPAN -e 'install xxxx'
where xxxx is the module you wish to install.
------------------------------
Date: Sun, 18 Jul 2010 18:56:37 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: How to install all the cpan modules?
Message-Id: <lvnch7x5l1.ln2@goaway.wombat.san-francisco.ca.us>
On 2010-07-19, smallpond <smallpond@juno.com> wrote:
>
> to install a module as root:
>
> perl -MCPAN -e 'install xxxx'
>
> where xxxx is the module you wish to install.
You can also simply do
cpan Xxxx::Xxxxxxx
if you have a reasonably recent version of CPAN.
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information
------------------------------
Date: Mon, 19 Jul 2010 14:36:38 +0100
From: Justin C <justin.1007@purestblue.com>
Subject: Re: How to install all the cpan modules?
Message-Id: <601eh7-tam.ln1@zem.masonsmusic.co.uk>
On 2010-07-18, Peng Yu <pengyu.ut@gmail.com> wrote:
> I'm getting tired of downloading each module individually and install
> them. I want to either install all cpan modules (if they don't take
> too much disk spaces) or install a module on demand with just one
> simply command. Could anybody show me what is the most convenient way
> to install cpan modules?
>
> http://www.cpan.org/modules/INSTALL.html
cpan -i Module::Name Some::Other::Module::Name
would install two modules.
man cpan is quite useful for this!
Justin.
--
Justin C, by the sea.
------------------------------
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:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#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 V11 Issue 3036
***************************************