File: smpadd_a.pl

package info (click to toggle)
libole-storage-lite-perl 0.14-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 148 kB
  • ctags: 66
  • sloc: perl: 1,334; makefile: 41
file content (40 lines) | stat: -rw-r--r-- 952 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# OLE::Storage_Lite Sample
# Name : smpadd.pl
#  by Kawai, Takanori (Hippo2000) 2000.12.21, 2001.1.4
#=================================================================
use strict;
use OLE::Storage_Lite;
my $oOl = OLE::Storage_Lite->new('test.xls');
my $oPps = $oOl->getPpsTree(1);
die( "test.xls must be a OLE file") unless($oPps);

my $oF = OLE::Storage_Lite::PPS::File->new(
            OLE::Storage_Lite::Asc2Ucs('Last Added'), 
        'ABCDEF');
my $oF2 = OLE::Storage_Lite::PPS::File->new(
            OLE::Storage_Lite::Asc2Ucs('Length 0'), 
        '');
push @{$oPps->{Child}}, $oF;
push @{$oPps->{Child}}, $oF2;

#STDOUT
#$oPps->save('-');
#FILE
$oPps->save('file.xls');

#Scalar
my $sData;
$sData='';
$oPps->save(\$sData);
open OUT, ">scalar.xls";
binmode(OUT);
print OUT $sData;
close OUT;

#IO::File
use IO::File;
my $oIo = new IO::File;
$oIo->open(">iofile.xls");
binmode($oIo);
$oPps->save($oIo);