static copy

[email protected] (Greg Matheson) Fri, 23 Feb 2007 19:41:25 +0800
Newsgroups perl.kwiki
Message-ID <[email protected]>
I'm blogging with a kwiki. This is how I published a static copy
from the perl debugger, after retrieving it with recursive wget,
and using IO::All of course.

  @files = glob ('index.cgi*');
  %pages = map { m/^index\.cgi\?(\w*)$/; $_ => "$1.html"} @files;
  for (keys %pages){delete $pages{$_} if $pages{$_} eq '.html'};
  $pages{'index.cgi'}='index.html';
  for (keys %pages) {io( $_) > io( $pages{$_})};
  for (glob('*.html')) { $page < io($_); $page =~  s/"index\.cgi"/"index.html"/g; $page > io($_) };
  for (glob('*.html')) { $page < io($_); $page =~ s/"index\.cgi\?(\w+)"/"$1.html"/g; $page > io($_) };
  for (glob('*.html')) { $page < io($_); $page =~ s/(<!-- BEGIN theme_toolbar2?_pane)/<comment>$1/g; $page > io($_) };
  for (glob('*.html')) { $page < io($_); $page =~ s/(<!-- END theme_toolbar2?_pane -->)/$1<\/comment>/g; $page > io($_) };

-- 
Greg Matheson                There is nothing as practical as a 
                             good theory.
                             --Kurt Lewin

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.