RE: Perl-Win32-Users Digest, Vol 16, Issue 31
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: perl-win32-users@listserv.ActiveState.com 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 LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[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 Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl-Win32-Users Digest, Vol 16, Issue 31
Replace local with my. And actually you don't even need that since the variables are global. At 03:01 PM 5/31/05 -0400, Liza Das wrote: local $sourcedir; local $destdir; local $password; local $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. -- REMEMBER THE WORLD TRADE CENTER ---= WTC 911 =-- ...ne cede males 0100 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Perl-Win32-Users Digest, Vol 16, Issue 31
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 Please help. Thanks, Liza ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Perl-Win32-Users Digest, Vol 16, Issue 31
How are you running the command? Have you tried print STDERR `dir . $sourcedir.$newfile. /b; to see what is happening? uru -Dave 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 Please help. Thanks, Liza ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
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 LuebkertMailto:[EMAIL PROTECTED] (_/ / )// // DBE CollectiblesMailto:[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 Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs