/[wait]/cvs-head/lib/WAIT/Document/Ora.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /cvs-head/lib/WAIT/Document/Ora.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 64 by ulpfr, Fri Jan 4 15:10:53 2002 UTC revision 65 by laperla, Wed Jan 23 12:22:54 2002 UTC
# Line 26  sub TIEHASH { Line 26  sub TIEHASH {
26    my @files;    my @files;
27    
28    opendir(DIR, $dir) or croak "Could not open '$dir': $!";    opendir(DIR, $dir) or croak "Could not open '$dir': $!";
29    for my $entry (readdir DIR) {   DIRENT: for my $entry (readdir DIR) {
30      if (-f "$dir/$entry/desc.html") {      if (-f "$dir/$entry/desc.html") {
31          my $index = "$dir/$entry/index.html";
32          open F, $index or Carp::confess("Could not open $index: $!");
33          local $/;
34          my $content = <F>;
35          next DIRENT unless $content =~ m|<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\s+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\s+<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">\s+<head>\s+<!-- product id:|s;
36        push @files, $entry;        push @files, $entry;
37      }      }
38    }    }
39      closedir DIR;
40    my $self   = {    my $self   = {
41                  Dir    => $dir,                  Dir    => $dir,
42                  Files  => \@files                  Files  => \@files
# Line 50  sub FETCH { Line 56  sub FETCH {
56    my $author = $fh->getline() if $fh;    my $author = $fh->getline() if $fh;
57    $fh = IO::File->new(join('/',$self->{Dir},$file,'index.html'));    $fh = IO::File->new(join('/',$self->{Dir},$file,'index.html'));
58    my $index = $fh->getline() if $fh;    my $index = $fh->getline() if $fh;
59    return { desc => $desc, author => $author, index => $index};    $fh = IO::File->new(join('/',$self->{Dir},$file,'colophon.html'));
60      my $colophon = $fh->getline() if $fh;
61      return {
62              desc => $desc,
63              author => $author,
64              index => $index,
65              colophon => $colophon,
66             };
67  }  }
68    
69  sub FIRSTKEY {  sub FIRSTKEY {

Legend:
Removed from v.64  
changed lines
  Added in v.65

  ViewVC Help
Powered by ViewVC 1.1.26