Ah, Thanks that works Jay ----- Original Message ----- From: "Patrick LeBoutillier" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 19, 2004 8:04 AM Subject: RE: Turning a script into a package
> Jay, > > try this instead: > > my $simple = new InteractiveBrokers::Test::Simple ; > > > Patrick > ---------------------------------- > | Patrick LeBoutillier > | [EMAIL PROTECTED] > > > >From: "Jay Strauss" <[EMAIL PROTECTED]> > >To: <[EMAIL PROTECTED]> > >Subject: Turning a script into a package > >Date: Mon, 19 Jan 2004 00:44:24 -0600 > > > >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 > > > > > > > > > > _________________________________________________________________ > MSN 8 with e-mail virus protection service: 2 months FREE* > http://join.msn.com/?page=features/virus&pgmarket=en-ca&RU=http%3a%2f%2fjoin .msn.com%2f%3fpage%3dmisc%2fspecialoffers%26pgmarket%3den-ca > > >