I just installed PDK under Win 7, with the latest ActiveState Community perl 64 bit. I'm trying to wrap my first perl code into a DLL so I can use Visual Studio 2013 Express to build a nice gui, with the Perl code tied in, but am getting a strange run-time error as follows:
I have this 'test_perlnet.pl' file :
use strict;
# Putting the following 'use Log::Report' line here (before the package
# and subroutine definition below) causes a Visual Studio
# run time error when I try to call 'do_some_thing()'
use Log::Report; # Or, using many other perl packages also gives error
# Declare my own package now:
package test_perlnet;
=for interface
[interface: pure]
str do_some_thing();
=cut
sub do_some_thing {
return "hello there.";
}
# But putting the 'use Log::Report' line here (after the package
# and subroutine definition above) works just fine;
# Visual Studio can see and call 'do_some_thing()' and I get "hello there."
# in the C# callback.
#use Log::Report;
I created a test_perlnet.dll (using plc) and added it into my C sharp project references. I then invoke the perl code from this C# button-click callback:
{
test_perlnet tp = new test_perlnet();
Console.WriteLine("Message from the perl code: {0}", tp.do_some_thing());
}
But when I click the button, I get this Visual Studio 2013 Express error if I put the 'use Log::Report;' line before my package definition in the perl code, as shown above.
Additional information: Can't locate object method "do_some_thing" via package "test_perlnet"
Why is this? I really need to 'use' other perl, standard libraries in my code. Thank you!