OLE::Storage_Lite - Simple Class for OLE document interface.
use OLE::Storage_Lite; use strict; my $oOl = OLE::Storage_Lite->new("some.xls"); my $oPps = $oOl->getPpsTree(1); #Read and Get Data $oPps->save("kaba.xls", 1); #Save Data as "kaba.xls"
OLE::Storage_Lite allows you to read and write an OLE structured file. Please refer OLE::Storage by Martin Schwartz.
OLE::Storage_Lite::PPS is a class representing PPS. OLE::Storage_Lite::PPS::Root, OLE::Storage_Lite::PPS::File and OLE::Storage_Lite::PPS::Dir are subclasses of OLE::Storage_Lite::PPS.
$oOle = OLE::Storage_Lite->new($sFile);
Constructor. Creates a OLE::Storage_Lite object for $sFile. $sFile must be a correct file name.
$oPpsRoot = oOle->getPpsTree([$bData]);
returns PPS as OLE::Storage_Lite::PPS::Root object. Other PPS objects will be included as its children. if $bData is true, the objects will have data in the file.
$oPpsRoot = oOle->getPpsTree($raName [, $bData]);
returns PPSs as OLE::Storage_Lite::PPS objects that has the name specified in $raName array. if $bData is true, the objects will have data in the file.
$oPpsRoot = oOle->getNthPps($iNth [, $bData]);
returns PPS as OLE::Storage_Lite::PPS object specified number($iNth). if $bData is true, the objects will have data in the file.
$sUcs2 = OLE::Storage_Lite::Asc2Ucs($sAsc);
Utility function. Just adding 0x00 afeter every characters in $sAsc.
$sAsc = OLE::Storage_Lite::Ucs2Asc($sUcs2);
Utility function. Just deletes 0x00 afeter words in $sUcs.
OLE::Storage_Lite::PPS has these properties:
order number in saving.
its name in UCS2 (a.k.a Unicode).
its type (1:Dir, 2:File (Data), 5: Root)
previous pps (as No)
next pps (as No)
dir pps (as No).
timestamp1st in array ref as similar fomat of localtime.
timestamp2nd in array ref as similar fomat of localtime.
start block number
size of the pps
its data
its child PPSs in array ref
OLE::Storage_Lite::PPS::Root has 2 methods.
$oRoot = OLE::Storage_Lite::PPS::Root->new( $raTime1st, $raTime2nd, $raChild);
Constructor.
$raTime1st, $raTime2nd is a array ref as ($iSec, $iMin, $iHour, $iDay, $iMon, $iYear, $iHSec). $iSec means seconds, $iMin means minutes. $iHour means hours. $iDay means day. $iMon is month -1. $iYear is year - 1900. $iHSec is seconds/10,000,000 in Math::BigInt.
$raChild is a array ref of children PPSs.
$oRoot = $o<oRoot>->save( $sFile, $bNoAs);
Saves infomations into $sFile. $sFile is '-', this will use STDOUT.
if $bNoAs is defined, this function will use the No of PPSs for saving order. if $bNoAs is undefined, this will calculate PPS saving order.
OLE::Storage_Lite::PPS::Dir has 1 method.
$oRoot = OLE::Storage_Lite::PPS::Dir->new( $sName [, $raTime1st] [, $raTime2nd] [, $raChild]);
$sName is a name of the PPS.
OLE::Storage_Lite::PPS::File has 1 method.
$oRoot = OLE::Storage_Lite::PPS::File->new($sName, $sData);
$sName is name of the PPS.
$sData is data of the PPS.
A saved file with VBA (a.k.a Macros) by this module will not work correctly. However modules can get the same information from the file, the file occurs a error in application(Word, Excel ...).
Kawai Takanori GCD00051@nifty.ne.jp
OLE::Storage
To install OLE::Storage_Lite::PPS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OLE::Storage_Lite::PPS
CPAN shell
perl -MCPAN -e shell install OLE::Storage_Lite::PPS
For more information on module installation, please visit the detailed CPAN module installation guide.