sz has asked for the wisdom of the Perl Monks concerning the following question:
open (TEMPLATE, "<$template_file") or die "Can't open $template_file: +$!"; $template = do { local $/; <TEMPLATE> }; close TEMPLATE; opendir (BIN, "$prod_dir") or die "Can't open $dir: $!"; while (defined ($file = readdir BIN)) { next if ($file =~/^\.\.?$/); #skip file starting with periods open (DESCR, "<$prod_dir/$file") or die "could not open $dir/$file +: $!"; $description = do { local $/; <DESCR> }; $template =~ s/%%DESCRIPTION%%/$description/; open (OUTPUT, ">$output_directory/$file.html"); print OUTPUT $template; close OUTPUT; next; } closedir (BIN);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex reset problem?
by davorg (Chancellor) on Jul 07, 2000 at 18:27 UTC | |
by sz (Friar) on Jul 07, 2000 at 18:37 UTC | |
|
Re: Regex reset problem?
by c-era (Curate) on Jul 07, 2000 at 18:29 UTC | |
|
Re: Regex reset problem?
by jjhorner (Hermit) on Jul 07, 2000 at 19:10 UTC | |
by sz (Friar) on Jul 07, 2000 at 19:36 UTC | |
by PipTigger (Hermit) on Jul 09, 2000 at 10:07 UTC | |
by Aighearach (Initiate) on Jul 09, 2000 at 18:40 UTC | |
by PipTigger (Hermit) on Jul 10, 2000 at 02:04 UTC | |
| |
by chromatic (Archbishop) on Jul 11, 2000 at 07:17 UTC |