#!/usr/bin/perl -w use strict; use warnings; use Getopt::Long; use File::Copy; use File::Spec; use File::Glob ':glob'; use Archive::Rar; my ($source_path, $test_check, $verzeichnis, $dest_path,$file); my %options = (); GetOptions(\%options, 'test=s'); my $testdir='/home/kami/test'; my $test2dir='/home/kami/test2'; $verzeichnis=File::Spec->join($downloaddir, $options{'test'}); $test_check=File::Spec->join($testdir, '*.test'); if(bsd_glob($test_check)) { for $source_path (bsd_glob($test_check)) { if(-f $source_path) { (undef,undef,$file) = File::Spec->splitpath( $source_path ); $dest_path= $test_check=bsd_glob(File::Spec->join($test2dir, $file)); my $file2 = "/home/kami/scripts/test.txt"; open FILE3, ">$file2" or die "unable to open $file $!"; warn "oeffne jetzt die datei $file2"; print FILE3 $source_path."\n"; print FILE3 $dest_path."\n"; close(FILE3); move($source_path,$dest_path) or die("ERROR move($source_path,$dest_path) $!\n"); } } }