perl faq 学习之复制文件

xiaoxiao2025-12-31  2

目的:复制文件。 #!/usr/bin/perluse warnings;use File::Copy;$original = 'test.file';$new_copy = 'test_copy.file';# 注意,如果目标文件存在会直接覆盖。copy($original, $new_copy) or die "Copy failed: $!";print 'copy over!'; one line code on command line : perl -MFile::Copy -we "copy(\"test.file\", \"test_copy.file\") or die die \"Copy failed: $!\"" 原文: [url]http://faq.perl.org/perlfaq5.html#How_can_I_copy_a_fil[/url]
转载请注明原文地址: https://www.6miu.com/read-5041859.html

最新回复(0)