$datadir =~ s!/$!!; $plugin_dir =~ s!/$!!; $static_dir =~ s!/$!!;
# Fix depth to take into account datadir's path
-$depth and $depth += ($datadir =~ tr[/][]) - 1;
+$depth += ($datadir =~ tr[/][]) - 1 if $depth;
# Global variable to be used in head/foot.{flavour} templates
$path_info = '';
if ( $path_info[$#path_info] =~ /(.+)\.(.+)$/ ) {
$flavour = $2;
- $1 ne 'index' and $path_info .= "/$1.$2";
+ $path_info .= "/$1.$2" if $1 ne 'index';
pop @path_info;
} else {
$flavour = param('flav') || $default_flavour;
else {
eval { require $plugin };
}
- $@ and warn "error finding or loading blosxom plugin $plugin_name - skipping\n" and next;
+ $@ and warn "$@ error finding or loading blosxom plugin $plugin_name - skipping\n" and next;
$plugin_name->start() and ( $plugins{$plugin_name} = $on_off ) and push @plugins, $plugin_name;
}
shift @INC foreach @plugin_dirs;
foreach ( ('', split /\//, $path) ) {
$p .= "/$_";
$p =~ s!^/!!;
- $done{$p}++ and next;
- (-d "$static_dir/$p" or $p =~ /\.$file_extension$/) or mkdir "$static_dir/$p", 0755;
+ next if $done{$p}++;
+ mkdir "$static_dir/$p", 0755 unless (-d "$static_dir/$p" or $p =~ /\.$file_extension$/);
foreach $flavour ( @static_flavours ) {
my $content_type = (&$template($p,'content_type',$flavour));
$content_type =~ s!\n.*!!s;
# Plugins: Skip
# Allow plugins to decide if we can cut short story generation
- my $skip; foreach my $plugin ( @plugins ) { $plugins{$plugin} > 0 and $plugin->can('skip') and defined($tmp = $plugin->skip()) and $skip = $tmp and last; }
+ my $skip;
+ foreach my $plugin (@plugins) {
+ if ( $plugins{$plugin} > 0 and $plugin->can('skip') ) {
+ if ( my $tmp = $plugin->skip() ) {
+ $skip = $tmp;
+ last;
+ }
+ }
+ }
+
# Define default interpolation subroutine
$interpolate =