Went to the Developer series last week. Used the code below and it worked great:
INPUT: toc_directory = full area-rooted path to a directory
OUTPUT: Titles of each HTML file in toc_directory, as an tag link to each file
# get current workarea path
($dir = `cd`) =~ s|\\|/|g;
chomp $dir;
$dir =~ s|(.*/WORKAREA/[^/]+)/.*|$1|;
$dir = "$dir$iw_arg{toc_directory}";
# read directory of all .html files
opendir(DIR, $dir);
@f = grep {/\.shtm$/} readdir(DIR);
closedir(DIR);
# for each file, extract title and insert link
foreach $x (@f) {
open(FILE, "$dir/$x");
foreach $line () {
if($line =~ m|(.*)|i) {
iwpt_output("$1\n");
last;
}
}
close(FILE);
}
[\code]
Problem is, I get back onto my server and I can't get this to work. TS 6.5 & Windows 2003... The only difference I can tell is that we're only using a c & y drive and not a d drive. We're calling other iw_perls in DCTs. We use shtm as our file extention, but this isn't even working with html.
Ideas?