Ich habe versucht anstelle von z. B. mkvinfo d:\programme\mkvtoolnix\mkvinfo.exe zu setzen, was aber nicht funktioniert hat. Ich habs auch mit Ausrufezeichen versucht, kenn ich so aus Batch-Dateien, war halt ein Versucht, klappte aber auch nicht.
Ich habe folgende Meldung bekommen
QuoteUnrecognized escape \V passed through at E:\pfad\suid7.1.pl line 12.
Unrecognized escape \m passed through at E:\pfad\suid7.1.pl line 12.
Unrecognized escape \m passed through at E:\pfad\suid7.1.pl line 12.
Unrecognized escape \V passed through at E:\pfad\suid7.1.pl line 13.
Unrecognized escape \m passed through at E:\pfad\suid7.1.pl line 13.
Unrecognized escape \m passed through at E:\pfad\suid7.1.pl line 13.
Unrecognized escape \V passed through at E:\pfad\suid7.1.pl line 16.
Unrecognized escape \m passed through at E:\pfad\suid7.1.pl line 16.
Unrecognized escape \m passed through at E:\pfad\suid7.1.pl line 16.
Backslash found where operator expected at E:\pfad\suid7.1.pl line 24, near "pfad\"
Number found where operator expected at E:\pfad\
suid7.1.pl line 24, near "mkvtoolnix 3.1.0"
(Do you need to predeclare mkvtoolnix?)
Backslash found where operator expected at E:\pfad\suid7.1.pl line 24, near "3.1.0\"
(Missing operator before \?)
Global symbol "$D" requires explicit package name at E:\pfad\suid7.1.pl line 16.
Global symbol "$D" requires explicit package name at E:\pfad\suid7.1.pl line 24.
syntax error at E:\pfad\suid7.1.pl line 24, near "$D:"
Execution of E:\pfad\suid7.1.pl aborted due to compilation errors.
Das Skript lautet:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use 5.010;
use strict;
use warnings;
# Dateien auflisten und sortieren
my @files = sort glob '*.mkv';
# Segment-UIDs via mkvinfo auslesen
my @uids = map {
my $file = $_;
open my $mkvinfo, '-|', qq/D:\Video\mkvtoolnix 3.1.0\mkvinfo --ui-language en "$file"/
or die "Couldn't run D:\Video\mkvtoolnix 3.1.0\mkvinfo on $file: $!";
my $uid;
while (my $_ = <$D:\Video\mkvtoolnix 3.1.0\mkvinfo>) {
if (/\+ Segment UID:\s+(.*?)[\r\n]*\z/) {
$uid = $1;
$uid =~ s/\s*0x//g;
last;
}
}
close $D:\Video\mkvtoolnix 3.1.0\mkvinfo
or die "Error running mkvinfo on $file: $!";
warn "Couldn't determine UID for $file" unless (defined $uid);
$uid
} @files;
# Ueber alle Dateien iterieren und Felder setzen
for ($[ .. $#files) {
my $file = $files[$_];
my $next_uid = ($_ + 1 <= $#uids ? $uids[$_ + 1] : undef);
my @options;
push @options, qq/--set next-uid="$next_uid"/ if (defined $next_uid);
if (@options) {
system(qq/mkvpropedit "$file" --edit info @options/) == 0
or die "Couldn't run mkvpropedit on $file: status $?"
}
}