[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] shuck suggestions



At 20.45 -0400 1998.09.25, Xah Lee wrote:
>* Add a "reload" command to the menu, so that package developer can
>easily see the update of his file that is  package and documentation in one.

I'd like this.

>* Add the file names to the section. (e.g. perlmod) , so that we
>know which description correspond to which file. (in most references,
>the file names are mentioned.)

Not so much a Shuck issue.  Regardless, this script will do as you ask.  :-)

It copies the existing Help file (unless it has already been copied), then
changes the menu names, then quits MacPerl.  Restart MacPerl (and/or Shuck)
to see the new names in the menu.

#!perl -w
use DB_File;
use File::Copy;

$file = "$ENV{MACPERL}MacPerl Help";  # data stored in Help file, a DBM
unless (-e "$file.old") {             # only make copy if copy does not exist
  copy($file, "$file.old") or die $!;
}

tie(%s, 'DB_File', $file, O_RDWR, 0644) or die $!;
$s{' MENU'} =~ s|^(.*)\t(.*/((?:mac)?perl[^/]*)\.pod)$|$1 ($3)\t$2|mg;
                                      # fun with regexes!
untie(%s);                            # clean up nicely
MacPerl::Quit(2);                     # quit MacPerl app
__END__

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch