#!/usr/bin/perl -w # /* # * ---------------------------------------------------------------------------- # * "THE BEERWARE LICENSE" (Revision 13a): # * As long as you retain this notice you can do whatever you want with # * this shit. If we meet some day you, you can buy me a beer or two in return. # * mAhdi ... # * ---------------------------------------------------------------------------- # */ use strict; use Cwd; use Getopt::Std; use File::Copy; opendir (DIR, ".") or die "Cannot open dir ($!) \n"; &parse; sub parse { my @files = readdir(DIR); foreach my $soubor (sort @files) { if (!-f $soubor) { } else { my $name = ""; my $desc = ""; my $autor = ""; print "processing file ".$soubor."\n"; open (IN, $soubor) || die "cannot open $!"; open (OUT, '>>summary.txt') || die "cannot open $!"; undef $/; while () { if (m|(.+?)|mg) { $name= $1."\n\n"; } if (/gal_prop_name">Autor(.*?)a>/s) { $autor = $1; } if (/gal_photo_note">(.*?)td>/s) { $desc = $1; print OUT $autor."\n"."\n".$name."\n".$desc."\n"."----------------------------------///----------------------------------"."\n"; } } } } }