Hi, I'm trying to turn a simple script:
#!/usr/bin/perl
use Inline (
Java => 'DATA',
PORT => 7890,
);
my $simple = new Simple();
print $simple->Print("test"),"\n";
__END__
__Java__
class Simple {
public Simple(){ }
public String Print(String s){
return s;
}
}
Into a package, I've read the perldoc Inline (especially "Writing Modules
with Inline"), but I can't seem to get the syntax correct. My latest try
was:
[o901]:~/tradestudy/lib/perl/InteractiveBrokers> cat Test.pm
package InteractiveBrokers::Test;
use base 'Exporter';
@EXPORT_OK = qw(new Print);
use Inline (
Java => 'DATA',
PORT => 7890,
);
1;
__DATA__
__Java__
class Simple {
public Simple(){ }
public String Print(String s){
return s;
}
}
[o901]:~/tradestudy/lib/perl/InteractiveBrokers/TWS/t> cat 03.t
#!/usr/bin/perl
use InteractiveBrokers::Test qw/new Print/;
my $simple = new InteractiveBrokers::Test;
print $simple->Print("Made It"),"\n";
[o901]:~/tradestudy/lib/perl/InteractiveBrokers/TWS/t> ./03.t
Undefined subroutine &InteractiveBrokers::Test::new called at ./03.t line 4.
Can anyone point to my error?
Thanks
Jay