Permalink
Browse files

new style example

  • Loading branch information...
1 parent 63c67f2 commit f8197a5bfa4630f81fb65d5bbb24085afc1127ec @tokuhirom committed Aug 28, 2012
Showing with 7 additions and 6 deletions.
  1. +4 −3 README.mkdn
  2. +3 −3 eg/lwp.js
View
@@ -9,11 +9,12 @@ SYNOPSIS
var ret = perl.evaluate("reverse 'yappo'");
console.log(ret); // => oppay
+ var Perl = require('../index.js').Perl;
var perl = new Perl();
perl.use('LWP::UserAgent');
- var ua = perl.getClass('LWP::UserAgent').call('new');
- var res = ua.call('get', 'http://mixi.jp/');
- console.log(res.call('as_string'));
+ var ua = perl.getClass('LWP::UserAgent').new();
+ var res = ua.get('http://utf-8.jp/');
+ console.log(res.as_string());
Classes
-------
View
@@ -1,7 +1,7 @@
var Perl = require('../index.js').Perl;
var perl = new Perl();
perl.use('LWP::UserAgent');
-var ua = perl.getClass('LWP::UserAgent').call('new');
-var res = ua.call('get', 'http://mixi.jp/');
-console.log(res.call('as_string'));
+var ua = perl.getClass('LWP::UserAgent').new();
+var res = ua.get('http://mixi.jp/');
+console.log(res.as_string());

0 comments on commit f8197a5

Please sign in to comment.