Perl replacement for Windows MSXSL.exe

I am moving some scripts I have from a Windows to a Linux system and so need to replace the MSXSL exe.

Currently I make calls like the following to reference my XSLT scripts and pass the needed parameters.

sub run {
  my $Command = $_[0];
  print "Running Command : $Command\n";
  system($Command);
}

sub ProduceSingleFile($;$)
{
  my $file = $_[0];
  my $outputPrefix = $_[1];
  my $input_file = basename($file);

  #croak "Can't cd to working directory: $!\n" unless chdir $nzrb_process_dir;

  if ($input_file =~ /(.*)\.xml$/)
   {
   	run("MSXSL $file Produce_People_Names.xsl -o $people_file");

     $temp_file = $outputPrefix.'output/'.$1.'.tmp';
     print("$file => $temp_file\n");

     run("MSXSL $file APNZ_Main.xsl -o $temp_file people_file=$people_file nzpa_testing=$nzpa_testing");
 
   unlink $temp_file
    }
}

Open in new window


I have attempted using XML::XSLT in the following way
    
        my $xslt = XML::XSLT->new ("Produce_People_Names.xsl");
        # transform XML file and print output
        print $xslt->serve($input_file);
        # free up some memory
       $xslt->dispose();

Open in new window


But get an error "Can't locate object method "new" via package "XML::XSLT". My XML::XSLT version is 0.31

What would be the best method for achieving my goal. My XSL scripts do not contain any "extras" and just use the basic commands.
LVL 1
jetbetAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wilcoxonCommented:
I've never actually used XSLT from Perl but you can use XML::LibXSLT with XML::LibXML to do XSLT.
0
jetbetAuthor Commented:
XML-LibXSLT looks like a good fit although trying to find a repository to add to ppm is not as easy to find as I feel it should be
0
jetbetAuthor Commented:
BTW
The reason for using ppm is to set it up on my windows system before I move it.
0
wilcoxonCommented:
Not sure.  I don't use ppm either.  I just use Strawberry Perl on Windows and compile-from-source on Unix.  So far, I've never had any issues moving from Windows to Unix (provided Windows-only packages like Win32::* aren't used) -- it's much easier to have issues going the other way (Unix to Windows) as there are a fair number of modules that don't work or have little bugs on Windows.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jetbetAuthor Commented:
Thanks for your help.

It looks as though Strawberry Perl is the way to go.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.