Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Perl for Win32

Reply
Thread Tools

Perl for Win32

 
 
Armando Torres
Guest
Posts: n/a
 
      07-04-2003
I am learning Perl, and I have never programed before.
I wrote a script that uses a Network path, but in the network path
thee is a space, and it's not working; this is a sample:

$PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
$SVRWEB = "C:/temp/eMitchell";
print " --- Getting Source Code...\n";
system("$PVCSClient get -pr$PVCSDatabase -a$SVRWEB -o -z -w
/archives")

It gives me an error becuse my folder.
If someone can give some ideas, or the place to get some info.

Thanks
 
Reply With Quote
 
 
 
 
Tassilo v. Parseval
Guest
Posts: n/a
 
      07-04-2003
[ f'up set to comp.lang.perl.misc ]

Also sprach Armando Torres:

> I am learning Perl, and I have never programed before.
> I wrote a script that uses a Network path, but in the network path
> thee is a space, and it's not working; this is a sample:
>
> $PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
> $SVRWEB = "C:/temp/eMitchell";
> print " --- Getting Source Code...\n";
> system("$PVCSClient get -pr$PVCSDatabase -a$SVRWEB -o -z -w
> /archives")
>
> It gives me an error becuse my folder.


This is because you pass one large string to system() in which case the
shell gets to see the command with the space in the path. You can use
system either with a list:

$PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
$SVRWEB = "C:/temp/eMitchell";

my @args = "get", "-pr", $PVCSDatabase, "-a", $SVRWEB,
"-o", "-z", "-w", "/archives";
system($PVCSClient, @args);

or turn the path into something the shell will understand manually:

$PVCSDatabase = '\\\\PC\Vault\temp\"my folder"';

Better use single quotes here because it saves you some escaping. The
only thing that needs escaping then are the two backslashes of an UNC-path.

Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus}) !JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexi ixesixeseg;y~\n~~dddd;eval
 
Reply With Quote
 
 
 
 
Mark Grimes
Guest
Posts: n/a
 
      07-08-2003
In article < >,
says...
> $PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
> system("$PVCSClient get -pr$PVCSDatabase -a$SVRWEB -o -z -w
> /archives")


You want the system command to see something like this once it is all
evaluated:

pvcsclient get -pr"\\PC\Vault\temp\my folder" -ac:/temp/eMitchell -o -z
-w /archives

So, try something like:

system("$PVCSClient get -pr\"$PVCSDatabase\" -a$SVRWEB -o -z -w
/archives")

 
Reply With Quote
 
Dan Ayers
Guest
Posts: n/a
 
      07-14-2003
There is a space in $PVCSDatabase - the shell won't like that.
Try including quotes (\") in the string passed into the system() function

Dan

"Armando Torres" <> wrote in message
news: om...
> I am learning Perl, and I have never programed before.
> I wrote a script that uses a Network path, but in the network path
> thee is a space, and it's not working; this is a sample:
>
> $PVCSDatabase = "\\\\PC\\Vault\\temp\\my folder";
> $SVRWEB = "C:/temp/eMitchell";
> print " --- Getting Source Code...\n";
> system("$PVCSClient get -pr$PVCSDatabase -a$SVRWEB -o -z -w
> /archives")
>
> It gives me an error becuse my folder.
> If someone can give some ideas, or the place to get some info.
>
> Thanks



 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
python-ldap/win32 or python/ldap/win32 rcmn Python 1 11-06-2006 11:47 PM
win32 process information, using win32 extension Java and Swing Python 1 10-24-2005 09:13 PM
RE: win32 process information, using win32 extension Tim Golden Python 0 10-21-2005 02:18 PM
Hmmm... problems with CPAN (MakeMaker?) on Win32+MSYS or Win32+UnixUtils and others Alex Lyman Perl 0 03-07-2004 05:10 PM
Win32::SAPI4 question (Win32 events and Perl) Michael Edmonson Perl Misc 0 02-28-2004 03:20 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57