Something like this should work:
#! /usr/bin/perl
use strict;
my($file_nm);
# Retrieve the namme of the file to archive. print("Name the file to archive: "); chomp($file_nm = <STDIN>);
# Confirm the file exists, if not exit the program. (-e $file_nm) or die("Cannot find file `$file_nm`.\n");
# Zip the file. print("Trying file name '$file_nm.zip'"); system("zip '$file_nm.zip' '$file_nm'");
Regards, Adam
Does the file's name contain spaces? On Jan 29, 2004, at 1:24 AM, Owen wrote:
On Wed, 28 Jan 2004 15:37:12 -0500 "RL" <[EMAIL PROTECTED]> wrote:
I would like to "zip" a file using perl script. I used following command:-
system ("zip <zip name> <file name>");
However this command fails when the filename is more than 8 characters.
I really have no idea.
have you tried
system ("zip <eightchr.zip> <file name>")
rename ("eightchr.zip","nine_or_more_characters.zip")
-- Owen
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>