[kw-pm] Using backticks in Perl script

Robert Pike roberthpike at yahoo.com
Tue Feb 2 07:19:17 PST 2010


Hi All,
   I've been passed a script that does unzipping of files and I can't seem to get it to work on a Windows machine. The server I'm trying this on I have to VPN in to. I've commented out the code that is trying to unzip a file and decided to put a simplier command in and see if I can get that to work but still w/o success.

   my $testStr = "dir";   #--- line 1
   my $newTest = `$testStr`;
   print "<br>Test string returned :" . $newTest . "<br>";
        
   When I run the overall script I get errors on the third line of code above telling me <name of script.pl>: Use of uninitialized value $newTest in concatenation (.) or string at <name of script>.pl line 82.
   I'm trying this simplier example to see if I can get it working first, the piece of code in the script (I was passed) is trying to use the gunzip executable but w/o success (i.e. gunzip -cf <$filePath) using the backticks again. Any help would be appreciated. Thanks.

Rob


      __________________________________________________________________
Make your browsing faster, safer, and easier with the new Internet Explorer® 8. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/


More information about the kw-pm mailing list