The Perl Advent Calendar needs more articles for 2022. Submit your idea today!

NAME

  Win32::File::Summary - Perl extension read property informations from MS compound files and normal files.

SYNOPSIS

  use Win32::File::Summary;
  my $Prop = Win32::File::Summary->new($file);
  my $iscorOS = $Prop->IsWin2000OrNT();
  print "This OS is the correct one\n";
  my $isStgfile = $Prop->IsStgFile();
  print "The file contains a storage object.\n";
  my $result = $Prop->Read();
  if(ref($result) eq "SCALAR")
  {
        my $err = $Prop->GetError();
        print "The Error: " . $$err  . "\n";
        exit;
  }

  my %hash = %{ $result };

  foreach my $key (keys %hash)
  {
        print "$key=" . $hash{$key} . "\n";
  }

DESCRIPTION

The modul Win32::File::Summary can be used to get the summary informations from a MS compound file or normal (text) files. What are the summary information: For compound documents, e.g. Word, you can add Title, Author, Description and some other informations to the document. The same, but not all of them you can add also to normal (text) files. This informationes can be read and add in the Property Dialog under the Summary Tab. The module reads these informations.

FUNCTIONS

new(file)
  This method is the constructor. The only parameter is the filename of the document which informations you want to get.
  
IsWin2000OrNT()
   This method returns 1 if the operating system currently used is Windows NT/2000/XP otherwise  0.
   
IsStgFile()
  This method returns 1 if that the file contains a storage object, otherwise 0.
  
Read()
  This method reads the property set and returns a refernce to a hash which contain the informations.
  If the method fail a scalar reference with the value \"0\" will be returned.
  To check use the following code:
  if(ref($result) eq "SCALAR")
  {
        my $err = $Prop->GetError();
        print "The Error: " . $$err  . "\n";
        exit;
  } else
  {
        my %hash = %{ $result };
        (Do something with the hash.)
  }

  
GetError()
  The GetError method returns the error message (scalar reference).
  The method shall only called if the result from the Read() methode is a scalar reference.

AUTHOR

Reinhard Pagitsch, <rpirpag@gmx.at>

SEE ALSO

perl.

TODO

  Adding support for OpenOffice and Star Office documents.
  Adding suport to write summary informations.