Bill,
Thanks for your suggestions I have tried them both.
I am getting a new error now.
Invocation line: perl test_unzip_file.pl N:\test N:\test\uploaded password
*.zip
Script:
----------------------------------------------------------------------------
--------------------
local $sourcedir;
local $destdir;
local $password;
local $newfile;
unzipfiles();
sub unzipfiles
{
$sourcedir = shift (@ARGV);
$destdir = shift (@ARGV);
$password = shift (@ARGV);
$newfile = glob (@ARGV);
my @filelist = `C:\\WINNT\\system32\\CMD.exe /C dir /b
$sourcedir\\$newfile`;
----------------------------------------------------------------------------
--------------------
I get this message for the every time these variables are mentioned:
Global symbol "$sourcedir" requires explicit package name at
test_unzip_file.pl line 16.
Global symbol "$destdir" requires explicit package name at
test_unzip_file.pl line 17.
Global symbol "$password" requires explicit package name at
test_unzip_file.pl line 18.
Global symbol "$newfile" requires explicit package name at
test_unzip_file.pl line 19.
Global symbol "$sourcedir" requires explicit package name at
test_unzip_file.plline 25.
Global symbol "$destdir" requires explicit package name at
test_unzip_file.pl line 26.
Global symbol "$password" requires explicit package name at
test_unzip_file.pl line 27.
Global symbol "$newfile" requires explicit package name at
test_unzip_file.pl line 28.
Global symbol "$sourcedir" requires explicit package name at
test_unzip_file.plline 43.
Global symbol "$newfile" requires explicit package name at
test_unzip_file.pl line 43.
Execution of test_unzip_file.pl aborted due to compilation errors.
Thanks,
Liza
-----Original Message-----
From: $Bill Luebkert [mailto:[EMAIL PROTECTED]
Sent: Monday, May 30, 2005 5:55 PM
To: Liza Das
Cc: [email protected]
Subject: Re: Perl-Win32-Users Digest, Vol 16, Issue 31
Liza Das wrote:
> To the experts,
>
> I have an existing script to unzip encrypted files that I wasn't passing
any
> variables to.
> I am now modifying it to pass it different values so that it can be used
by
> anyone, instead
> of hardcoding the information.
>
> In the below excerpt, I'm populating my variables then trying to get a
list
> of all
> the files from the path I pass to it. The problem is the @filelist.
> The dir command is not working and I get the following message:
> "The filename, directory name, or volume label syntax is incorrect."
>
> The @filelist should show me:
> xxx.ZIP
> xxx.ZIP
>
> ----------------------------------------------------
> $sourcedir = shift (@ARGV);
> $destdir = shift (@ARGV);
> $password = shift (@ARGV);
> $newfile = glob (@ARGV);
>
> # my @filelist = `dir `.$sourcedir.$newfile.` /b`;
> my @filelist = `dir .$sourcedir.$newfile. /b`; # dir N:\Test\*.ZIP /b
# Assuming :
use strict;
use warnings;
# Assuming for example :
my $sourcedir = 'c:\temp';
my $newfile = '*.txt';
# or similar. This may work:
my @filelist = `dir /b $sourcedir\\$newfile`;
# if not, try this:
my @filelist = `D:\\windows\\system32\\cmd.exe /C dir /b
$sourcedir\\$newfile`;
> ----------------------------------------------------
What does your invocation line look like ?
--
,-/- __ _ _ $Bill Luebkert Mailto:[EMAIL PROTECTED]
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // Castle of Medieval Myth & Magic
http://www.todbe.com/
-/-' /___/_<_</_</_ http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs