I'm really no expert a this kind of stuff, but does this do what you want:
use Inline (
Java => 'STUDY',
STUDY => ['java.io.File'],
) ;
BEGIN {
%{File::} = %{java::io::File::} ;
}
my $f = new File("/tmp") ;
print $f->toString() . "\n" ;
print "$File::pathSeparator\n" ;
>> wonderful! That worked perfectly. Nice bit of symbol table jiggery pokery!
>> And it appears the namespace is truly as desired i.e. using a routine like
>> dispSymbols() from http://www.cs.cf.ac.uk/Dave/PERL/node135.html it shows
>> that only the symbol table entries from my TraceLevel class are in
>> %TraceLevel:: namespace.
1 final request....I have to document/comment this stuff...hence need to
accurately state what its doing. I put: -
#
# Our perl proxy for Java's importPackage(). We alias TraceLevel
# to the fully scoped package name so we can then use the shorter namespace
# $TraceLevel::ALL instead of
# $DSS_SCRIPTING::com::ti::ccstudio::scripting::environment::TraceLevel::ALL
# Internally this creates a TraceLevel symbol table which holds typeglobs
# to each of the class fields (ALL, INFO, CONFIG etc)
#
If u see anything wrong with above comment, pls holler.
Thanks again for your help. Thoroughly appreciated!
Cheers, Alan
____________________________________________________________________________________
Have a burning question?
Go to www.Answers.yahoo.com and get answers from real people who know.