sub split_path ($) {
my ($path) = @_;
- my ($dir, $base, $ext) = $path =~ m#^(?:(.*)/)?(?:([^/]*)\.)?([^./]*)$#;
+ my ($dir, $base, $ext) =
+ $path =~ m#^ (?: (.*) /)?
+ (?: ([^/]*) \.)?
+ ([^./]*) $#x;
if (defined $base) { $ext = ".$ext"; }
else { $base = $ext; $ext = ""; }
return ($dir, $base, $ext);
$comment = defined $comment ? $comment . "\n" . $_ : $_;
} else {
if ($item && $comment) { $item->comment($comment); }
- my ($indexp, $name, $c) = /^(!\s+)?(\S+)\s*(\S|\S.*\S)?\s*$/;
+ my ($indexp, $name, $c) =
+ /^ (! \s+)? # index flag
+ (\S+) \s* # filename
+ (\S | \S.*\S )? # start of the comment
+ \s*
+ $/x;
$name = urldecode $name;
my $list;
if ($name =~ m#/$#) {