# read in everything until what would have been the first =head
# directive, patching the index as we go.
- open(H, "<$file.html") ||
+ open(H, '<', "$file.html") ||
die "$0: error opening $file.html for input: $!\n";
$/ = "";
my @data = ();
close(H);
# now rewrite the file
- open(H, ">$file.html") ||
+ open(H, '>', "$file.html") ||
die "$0: error opening $file.html for output: $!\n";
print H "@data", "\n";
close(H);
my @files = sort(grep(/\.html?$/, readdir(DIR)));
closedir(DIR);
- open(HTML, ">$html") ||
+ open(HTML, '>', $html) ||
die "$0: error opening $html for output: $!\n";
# for each .html file in the directory, extract the index
foreach my $file (@files) {
my $filedata = do {
- open(my $in, "<$dir/$file") ||
+ open(my $in, '<', "$dir/$file") ||
die "$0: error opening $dir/$file for input: $!\n";
local $/ = undef;
<$in>;
# read the file in paragraphs
$/ = "";
- open(SPLITIN, "<$pod") ||
+ open(SPLITIN, '<', $pod) ||
die "$0: error opening $pod for input: $!\n";
@filedata = <SPLITIN>;
close(SPLITIN) ||
# create the new .pod file
print "\tcreating $poddir/$file\n" if $verbose;
- open(SPLITOUT, ">$poddir/$file") ||
+ open(SPLITOUT, '>', "$poddir/$file") ||
die "$0: error opening $poddir/$file for output: $!\n";
$poddata[$i] =~ s,L<([^<>]*)>,
defined $heads{anchorify($1)} ? "L<$dir/$1>" : "L<$1>"
no_upwards($_) or next;
my $is_dir = -d "$podroot/$dir/$_";
next if $is_dir and not $recurse;
- my $target = (
- $is_dir ? \@dirlist :
- s/\.pod$// ? \@podlist :
- s/\.pm$// ? \@pmlist :
- undef
- );
+ my $target
+ = $is_dir ? \@dirlist
+ : s/\.pod$// ? \@podlist
+ : s/\.pm$// ? \@pmlist
+ : undef
+ ;
push @$target, "$dir/$_" if $target;
}