Re: How to pass array from java to perl using inline java
- From: "DJ Stunks" <DJStunks@xxxxxxxxx>
- Date: 31 Jan 2007 11:58:27 -0800
On Jan 31, 11:50 am, "songta...@xxxxxxxxx" <songta...@xxxxxxxxx>
wrote:
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)
When you respond on this list you're asked to quote the attribution
and some appropriate context. Also this script does not look
"complete".
Anyway, you've said your problem is accessing a 2D array, so why are
you only printing the first dimension? In fact, when you do, Perl is
telling you that that first dimension is itself made up of an array.
This is as it should be.
If you're passing a 2D array, you need to access it in two dimensions.
print $mylist[0][0];
for instance should work, but I'm unable to verify it.
-jp
PS: read perldoc -q vars
.
- References:
- How to pass array from java to perl using inline java
- From: songtao32@xxxxxxxxx
- Re: How to pass array from java to perl using inline java
- From: DJ Stunks
- Re: How to pass array from java to perl using inline java
- From: songtao32@xxxxxxxxx
- How to pass array from java to perl using inline java
- Prev by Date: Re: How to pass array from java to perl using inline java
- Next by Date: FAQ 3.11 Where can I get Perl macros for vi?
- Previous by thread: Re: How to pass array from java to perl using inline java
- Index(es):
Relevant Pages
|