我需要在 perl.enter 代码中创建一个 zip 文件,例如现有文件名是 2.csv 我想要一个脚本来使它成为 2.zip 我已经尝试过
my $file = 'dispatch_report_seg_flo.csv' ;
# Retrieve the namme of the file to archive.
print("Name the file to archive: ");
# Confirm the file exists, if not exit the program.
(-e $file) or die("Cannot find file `$file_nm`.\n");
# Zip the file.
print("Trying file name '$file.zip'");
system("zip 'dispatch.zip' '$file'");
my $file1 = 'dispatch.zip';