#!/usr/bin/perl

# examples.pl
# Generovani prikladu demo/*.shc z examples.txt
# Miroslav Broz (miroslav.broz@email.cz), Oct 13th 2002

open(IN, "<examples.txt");
read(IN, $in, -s IN);
close(IN);

qx!rm demo/*.shc!;

$i = 0;
foreach $l (split(/\n/, $in)) {
  $i++;
  if (length($l) == 0) {
    $i = 0;
  }
  if ($i == 1) {
    $shc = $l;
  } elsif ($i == 2) {
    $out = qx!lynx -source 'http://localhost/~mira/shc/shc.php?type=getshc&$l'!;

    open(OUT,">demo/$shc.shc");
    print OUT $out;
    close(OUT);
  }
}

exit;


