my $localpath = "c:/apps/Sync/"; my $localpathfiles; open(Source, '<', $localpath."localpath.txt") or die "Konnte Quelldatei nicht oeffen $!"; while() { $localpathfiles = $_; } close(Source); chomp ($localpathfiles); $localpathfiles =~ s/\s+$//g; $localpathfiles =~ s/\\/\//g; if ($localpathfiles ne~ /\/$/) { $localpathfiles = $localpathfiles."\/"; }