School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,406 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,626 people online right now. Registration is fast and FREE... Join Now!




Perl on Windows (ActivePerl) Will Not Recognize Installed Packages

 

Perl on Windows (ActivePerl) Will Not Recognize Installed Packages, Spreadsheet::WriteExcel::FromXML, though loaded is not usable.

Tracekill

19 Jun, 2009 - 11:37 AM
Post #1

New D.I.C Head
*

Joined: 17 Jan, 2009
Posts: 9

I'm very new to Perl but I've experience with many OOP languages and PHP but for some reason I can't figure out exactly what the problem is here.

CODE
use Spreadsheet::WriteExcel;
use Spreadsheet::WriteExcel::FromXML;
use warnings;

# Prompt user to enter vendor name
print "What is the vendor's name?";
$vendor = <>;

my $fromxml = Spreadsheet::WriteExcel::FromXML->new($vendor + ".xls");
print $vendor + ".xls";



The compiler finds error with the

CODE
use Spreadsheet::WriteExcel::FromXML;


Though I've installed it through PPM several times. Has anybody encountered a similar problem?

User is offlineProfile CardPM
+Quote Post


KevinADC

RE: Perl On Windows (ActivePerl) Will Not Recognize Installed Packages

19 Jun, 2009 - 01:05 PM
Post #2

D.I.C Regular
Group Icon

Joined: 23 Jan, 2007
Posts: 401



Thanked: 25 times
Dream Kudos: 50
My Contributions
Whats the error?

This looks wrong:

new($vendor + ".xls");

"+" in perl is a math operator, not concatenation, maybe you mean:

new("$vendor.xls");

User is offlineProfile CardPM
+Quote Post

Tracekill

RE: Perl On Windows (ActivePerl) Will Not Recognize Installed Packages

19 Jun, 2009 - 02:59 PM
Post #3

New D.I.C Head
*

Joined: 17 Jan, 2009
Posts: 9

QUOTE(KevinADC @ 19 Jun, 2009 - 01:05 PM) *

Whats the error?

This looks wrong:

new($vendor + ".xls");

"+" in perl is a math operator, not concatenation, maybe you mean:

new("$vendor.xls");


Ha, yeah thanks. That was a silly little error I'd inherited from coding a Java app earlier, fixed it up quickly. As for the major problem here, I've since given up on getting that module to work and promptly run into the exact same error with another module: wxPerl. The error it presents with is this:


CODE
Compilation failed in require at XMLLoader.pl line 3.


The code is:

CODE


use warnings;
use Spreadsheet::WriteExcel;
use Wx;

# Core application class
package XMLLoader;
use base 'Wx::App';

sub OnInit{
    #When initialized, construct new frame and display it.
    my $frame = Wx::Frame->new( undef, -1, 'XML to XLS Parser', [-1, -1], [250,250]);
    $frame->Show(1);
}

# Main application class. Contains event listening and drawing loop.
package main;

my $instance = XMLLoader->new;
$instance->MainLoop;



PPM confirms that packages Wx, Alien-wxWidgets and Wx-ActiveX are all installed and working normally but for some reason Perl will not recognize them. I appreciate you bearing with my newbiness.
User is offlineProfile CardPM
+Quote Post

Tracekill

RE: Perl On Windows (ActivePerl) Will Not Recognize Installed Packages

19 Jun, 2009 - 03:43 PM
Post #4

New D.I.C Head
*

Joined: 17 Jan, 2009
Posts: 9

Oh I just want to add the versions for the following related software(s):

ActivePerl 5.10
wxPerl 0.89.1
Alien-wxWidgets 0.33
User is offlineProfile CardPM
+Quote Post

KevinADC

RE: Perl On Windows (ActivePerl) Will Not Recognize Installed Packages

20 Jun, 2009 - 09:46 AM
Post #5

D.I.C Regular
Group Icon

Joined: 23 Jan, 2007
Posts: 401



Thanked: 25 times
Dream Kudos: 50
My Contributions
If PPM has installed the modules I am really not sure what the problem would be. You don't have perl installed twice on the same PC maybe? That can lead to various problems. If you only have perl installed once and PPM seems to work maybe ask on www.stackoverflow.com and see if someone there can help you out. Althought they might suggest you dump activeperl and switch to strawberry perl then you can use the CPAN shell instead of PPM.
User is offlineProfile CardPM
+Quote Post

chorny_cpan

RE: Perl On Windows (ActivePerl) Will Not Recognize Installed Packages

25 Jun, 2009 - 06:05 AM
Post #6

New D.I.C Head
Group Icon

Joined: 13 May, 2009
Posts: 35


Dream Kudos: 25
My Contributions
do you have Spreadsheet::WriteExcel installed?

Also try from command line: perl -MWx -e 1

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 10:48PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month