Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 01-05-2004, 04:44 PM
tim.bertalot tim.bertalot is online now
Registered User
 
Join Date: 01-01-1970
Posts: 8
Can't get single quotes to work properly.

I have some perl script that is designed to store a directories contents in a variable and then use it. The code works fine if run directly from a command prompt (substituting print for the LogMessage function), but when i try to run it through visual build I get no errors and nothing stored in the variable. Note the single quotes tell it to substitute the commands output for the command. And yes i intended my path separators to be "/"

my @history=`cmd.exe /c dir \"B:/3.0_history/server/windows/distro_files\" /ad /od /b`;

foreach $folder(@history)
{
$Builder->LogMessage($folder);
}

Thanks for your help!
Reply With Quote
  #2  
Old 01-06-2004, 11:26 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
I got errors in both cases when using forward slashes with the dir command, but using ActivePerl 5.8.2.808 produced the expected output in both of these cases:

test.pl:
my @history=`cmd.exe /c dir c:\\windows\\*.ini /b`;

foreach $folder(@history)
{
print $folder;
}


test.bld:
<step action='Run Script' type='0'>
<Language>PerlScript</Language>
<Script><![CDATA[my @history=`cmd.exe /c dir c:\\windows\\*.ini /b`;

foreach $folder(@history)
{
$Builder->LogMessage($folder, False);
}
]]></Script>
<indent type='3'>1</indent>
<name>perl test</name>
</step>


output:
control.ini
desktop.ini
msdfmap.ini
ODBCINST.INI
system.ini
vb.ini
vbaddin.ini
win.ini
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 02:56 AM.


Copyright © 1999-2023 Kinook Software, Inc.