How to use the existing perl module in perlaspx?
by 1 other posts by this author
Jun 26 2005 8:14PM messages near this date
view in the new Beta List Site
RE: reflection
|
RE: How to use the existing perl module in perlaspx?
FRAMEWORK hi,everyone!
I got a problem to use the existing perl module in perlaspx. For example, I want to wrap
the existing "Encode" module to transfer between the Unicode and the GB text.
Firstly, I add a new encode.pm file to wrap the existing "Encode" module:
package PerlNLPServices::Encode;
use strict;
=for interface
[interface: pure]
static str myfromto(str src,str encode1,str encode2);
=cut
require Encode;
sub myfromto
{
my($src,$encode1,$encode2) = @_;
#return Encode::from_to(src,encode1,encode2); # to test the process, I comment it!
return $src;
}
Secondly, I use the above function in my webservice main file:
....
package PerlNLPServices::MyPos;
use PerlNET qw(AUTOCALL);
use namespace "PerlNLPServices";
=for interface
[WebMethod]
string POS(string value);
=cut
sub POS {
my($this,$value) = @_; #
$value = myfromto($value,"utf8","gb2312");
return $value;
}
....
Lastly, when I test it, it turns to a mistake.
Is my way wrong? and how to solve it? Thank you.
yours,
cwh
ã??ã??ã??ã??ã??ã??cwh2k@[...].com
ã??ã??ã??ã??ã??ã??ã??ã??2005-06-27
_______________________________________________
Perl.NET mailing list
Perl.NET@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
1
Tom Humphrey
|