Arie Kusuma Atmaja wrote:
> 1:48:06 PM Prof: mantaaaab http://code. google.com/ p/ruby-perl/

cool. interop antar scripting language yang seharusnya dilakukan oleh
parrot, tapi mungkin baru 5 tahun lagi terjadi :p

> require 'perl'
> require 'perl/spreadsheet/ parse_excel'
> 
> # put class in top-level namespace. Perl is currently a class so you
> can't include
> Spreadsheet = Perl::Spreadsheet
> 
> # extend perl class in ruby
> class Spreadsheet: :ParseExcel
> class Worksheet
> def inspect
> # Worksheet is a blessed hash, "instance variables" are hash members
> "#<#{self.class} :#{self[' Name']}>"
> end
> end
> end
> 
> book = Spreadsheet: :ParseExcel: :Workbook. parse 'test.xls'
> # note that the array of worksheets is stored in this hash key:
> p book['Worksheet' ]
> # => [#<Perl::Spreadshee t::ParseExcel: :Worksheet: Sheet1>]

-- 
Mirror CPAN, Debian, Fedora di IIX:
* http://mirror-id1.masterwebnet.com/
* http://mirror-id2.masterwebnet.com/

Kirim email ke