|
From: songtao32 on 31 Jan 2007 12:27 Hi, I try to pass a float[ ] [ ] array from inline java to perl. I assign the java array to a perl list variable but it doesn't work. Any suggestions? Thanks for help! Regards, Tom
From: usenet on 31 Jan 2007 12:47 On Jan 31, 9:27 am, "songta...(a)gmail.com" <songta...(a)gmail.com> wrote: [a multiposted question] Please don't multipost. It is considered bad usenet ettiquette. -- The best way to get a good answer is to ask a good question. David Filmer (http://DavidFilmer.com)
From: DJ Stunks on 31 Jan 2007 13:04 On Jan 31, 10:27 am, "songta...(a)gmail.com" <songta...(a)gmail.com> wrote: > Hi, > > I try to pass a float[ ] [ ] array from inline java to perl. I > assign the java array to a perl list variable but it doesn't work. Any > suggestions? please post a short, but complete script which demonstrates the issue. have you read the posting guidelines for this group? -jp
From: songtao32 on 31 Jan 2007 13:50 Hi, Sorry for the multipost. I apologize. Here is the script that I try to run: ***************************************************** use Inline Java => <<'EOJ'; public class TestJavaClass { public float[ ] [ ] returnArrayData(){ . . . return ArrayData[m][n]; } } EOJ my @mylist = TestJavaClass. returnArrayData(); print "$mylist[0]"; ***************************************************** I got the following output: Inline::Java::Array=ARRAY(0xa52e234) Thanks for your help! Regards, Tom
From: Andy on 31 Jan 2007 14:45 According to the output you've posted, you've succeeded. Perl is reporting you have an array of pointers to other arrays of numbers. The question now is how to read the contents of the arrays that were returned from java. All languages do not store their numbers in the same way, so the way a floating point number is stored in Java may not be compatible with the way Perl stores it. The IEEE defines a standard format for representing floating point numbers in memory. If both Perl and Java are IEEE compliant for floating point numbers, you should have little translation problems between the two languages (in that if you experiment with the different ways of using arrays in Perl, one of them should automatically work with what Java returned). Sorry, I don't know if Perl is IEEE compliant, although I know Java is. > > Inline::Java::Array=ARRAY(0xa52e234) >
|
Next
|
Last
Pages: 1 2 Prev: FAQ 3.24 Why don't Perl one-liners work on my DOS/Mac/VMS system? Next: check in mysql DB |