Jemand zu Hause?Leser: 17
1 2 3 4 5 6 7 8 9 10 11 12
my $BASEPATH="D:\\temp\\x"; my $EMCY_NUMBER; $EMCY_NUMBER=$ARGV[0]; my $FILE2="I:\\transfer\\123&abc\\__Proj_EMCY-FRs\@TPS\\xhost.txt"; print "File2 : $FILE2\n"; if ( ! -e $FILE2 ) { print "$FILE2 does not exist.\n"; } else { system("copy $FILE2 $BASEPATH\\$EMCY_NUMBER"); }
File::Copy, dann musst du dich nicht um irgendwelchen shell-escaping-kram kümmern. ist auch im perl-core mit drin.
Wie frage ich & perlintro
brian's Leitfaden für jedes Perl-Problem1 2 3 4 5 6
#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use File::Copy; copy("te&st/te&st.txt","te&st/te&st_neu.txt") or die "Copy failed: $!";